Class AuthServiceImpl<T>
- java.lang.Object
-
- org.marketcetera.util.ws.stateless.StatelessServiceBaseImpl
-
- org.marketcetera.util.ws.stateful.ServiceBaseImpl<T>
-
- org.marketcetera.util.ws.stateful.AuthServiceImpl<T>
-
- All Implemented Interfaces:
AuthService,ServiceBase,StatelessServiceBase
public class AuthServiceImpl<T> extends ServiceBaseImpl<T> implements AuthService
An authentication service implementation.- Since:
- 1.0.0
- Version:
- $Id: AuthServiceImpl.java 16154 2012-07-14 16:34:05Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Field Summary
Fields Modifier and Type Field Description private AuthenticatormAuthenticator
-
Constructor Summary
Constructors Constructor Description AuthServiceImpl(Authenticator authenticator, SessionManager<T> sessionManager)Creates a new authentication service implementation with the given authenticator and session manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticatorgetAuthenticator()Returns the receiver's authenticator.SessionIdlogin(StatelessClientContext context, String user, char[] password)Logs in the client with the given context, provided the given credentials are acceptable.private SessionIdloginImpl(StatelessClientContext context, String user, char[] password)Logs in the client with the given context, provided the given credentials are acceptable.voidlogout(ClientContext context)Logs out the client with the given context.private voidlogout(ClientContext context, SessionHolder<T> sessionHolder)Logs out the client with the given context and associated session holder.-
Methods inherited from class org.marketcetera.util.ws.stateful.ServiceBaseImpl
getSessionManager
-
-
-
-
Field Detail
-
mAuthenticator
private final Authenticator mAuthenticator
-
-
Constructor Detail
-
AuthServiceImpl
public AuthServiceImpl(Authenticator authenticator, SessionManager<T> sessionManager)
Creates a new authentication service implementation with the given authenticator and session manager.- Parameters:
authenticator- The authenticator.sessionManager- The session manager.
-
-
Method Detail
-
getAuthenticator
public Authenticator getAuthenticator()
Returns the receiver's authenticator.- Returns:
- The authenticator.
-
loginImpl
private SessionId loginImpl(StatelessClientContext context, String user, char[] password) throws I18NException
Logs in the client with the given context, provided the given credentials are acceptable.- Parameters:
context- The context.user- The user name.password- The password.- Returns:
- The ID of the new session.
- Throws:
I18NException- Thrown if the authenticator rejects the credentials.
-
logout
private void logout(ClientContext context, SessionHolder<T> sessionHolder)
Logs out the client with the given context and associated session holder. This method is a no-op if there is no active session for that client.- Parameters:
sessionHolder- The holder, which may be null.
-
login
public SessionId login(StatelessClientContext context, String user, char[] password) throws RemoteException
Description copied from interface:AuthServiceLogs in the client with the given context, provided the given credentials are acceptable.- Specified by:
loginin interfaceAuthService- Parameters:
context- The context.user- The user name.password- The password. Upon return, its contents are cleared (on the server) by overwriting all prior characters with the nul ('\0') character.- Returns:
- The ID of the new session.
- Throws:
RemoteException- Thrown if the operation cannot be completed.
-
logout
public void logout(ClientContext context) throws RemoteException
Description copied from interface:AuthServiceLogs out the client with the given context. This method is a no-op if there is no active session for that client.- Specified by:
logoutin interfaceAuthService- Parameters:
context- The context.- Throws:
RemoteException- Thrown if the operation cannot be completed.
-
-