📄 userserviceimpl.java
字号:
package net.sf.jawp.gf.server;
import net.sf.jawp.gf.api.domain.User;
import net.sf.jawp.gf.api.services.LoginService;
import net.sf.jawp.gf.api.services.UserService;
import net.sf.jawp.gf.domain.GameWorldBase;
import net.sf.jawp.gf.domain.GameWorldRO;
import net.sf.jawp.gf.persistence.PersistenceController;
import net.sf.jawp.gf.system.RootSystem;
import net.sf.jawp.gf.system.RootSystemUnmodifiable;
import net.sf.jawp.gf.system.transaction.RegisterUser;
/**
*
* @author jarek
* @version $Revision: 1.14 $
*
* @param <GAME> the game type
* @param <GAMEVIEW> read only access to game
* @param <GAMESERVICE> service definition for game
*/
public class UserServiceImpl<GAMESERVICE , GAME extends GameWorldBase<GAMEVIEW>, GAMEVIEW extends GameWorldRO>
implements UserService<GAMESERVICE>
{
private final PersistenceController<RootSystem<GAME, GAMEVIEW, GAMESERVICE>, RootSystemUnmodifiable< GAMEVIEW> > persistence;
public UserServiceImpl(final PersistenceController<RootSystem<GAME, GAMEVIEW, GAMESERVICE>, RootSystemUnmodifiable<GAMEVIEW> > persistence)
{
super();
this.persistence = persistence;
}
/*public final User login(final String login, final String encodedPass )
{
throw new UnsupportedOperationException();
}*/
public final User registerUser( final String login, final String encodedPass)
{
final RegisterUser<GAME, GAMEVIEW, GAMESERVICE> regUsr = new RegisterUser<GAME, GAMEVIEW, GAMESERVICE>( login, encodedPass);
return persistence.runCommand( regUsr);
}
public final LoginService<GAMESERVICE> initLogin(final String login)
{
return new LoginServiceImpl<GAMESERVICE, GAME, GAMEVIEW>(persistence.getUnmodifiableObject(), login
, this.persistence);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -