【Java开源代码栏目提醒】:网学会员在Java开源代码频道为大家收集整理了AuthenticationService.java提供大家参考,希望对大家有所帮助!
/*
* Created on Jul 13, 2005
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package springexample.services;
import springexample.commands.LoginCommand;
/**
* @author naveenb
*/
public class AuthenticationService {
public AuthenticationService(){
}
public void authenticate(LoginCommand command) throws Exception{
//Check with some dummy data.
if(command.getUserId()!= null && command.getUserId().equalsIgnoreCase("admin")
&& command.getPassword()!= null && command.getPassword().equalsIgnoreCase("password")){
System.out.println("Login sucessful");
}else{
throw new Exception("User id is not authenticated");
}
}
}
上一篇:
AuthenticationHome.java
下一篇:
让我掉下眼泪的