public class LoginServiceImpl extends RemoteServiceServlet implements
LoginService {
@Override
public UserAccount login(String requestUri) {
UserAccount userAccount = null;
UserService userService = UserServiceFactory.getUserService();
assert (userService != null);
User user = userService.getCurrentUser();
if (user != null) {
String logoutUrl = userService.createLogoutURL(requestUri);
userAccount = new UserAccount(user.getUserId(), user.getNickname(),
user.getEmail(), true, null, logoutUrl);
} else {
String loginUrl = userService.createLoginURL(requestUri);
userAccount = new UserAccount(null, null, null, false, loginUrl,
null);
}
return userAccount;
}