Class Server<SessionClazz>
- java.lang.Object
-
- org.marketcetera.util.ws.stateless.Node
-
- org.marketcetera.util.ws.stateless.StatelessServer
-
- org.marketcetera.util.ws.stateful.Server<SessionClazz>
-
- All Implemented Interfaces:
ServerProvider<SessionClazz>,UsesPort
public class Server<SessionClazz> extends StatelessServer implements ServerProvider<SessionClazz>
A server node for stateful communication. Its (optional) authenticator checks credentials and its (optional) session manager maintains active sessions.- Since:
- 1.0.0
- Version:
- $Id: Server.java 17411 2017-04-28 14:50:38Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Field Summary
Fields Modifier and Type Field Description private AuthenticatormAuthenticatorprivate ServiceInterfacemAuthServiceprivate SessionManager<SessionClazz>mSessionManager-
Fields inherited from class org.marketcetera.util.ws.stateless.Node
DEFAULT_CLIENT_HOST, DEFAULT_PORT, DEFAULT_SERVER_HOST
-
-
Constructor Summary
Constructors Constructor Description Server()Creates a new server node with the default server host name and port, and no authenticator or session manager.Server(String host, int port, Authenticator authenticator, SessionManager<SessionClazz> sessionManager)Creates a new server node with the given server host name, port, authenticator, and session manager.Server(String inHost, int inPort, Authenticator inAuthenticator, SessionManager<SessionClazz> inSessionManager, ContextClassProvider inContextClassProvider)Create a new Server instance.Server(Authenticator authenticator, SessionManager<SessionClazz> sessionManager)Creates a new server node with the default server host name and port, and 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.private ServiceInterfacegetAuthService()Returns the receiver's authentication service interface.Server<SessionClazz>getServer()Gets the server value.SessionManager<SessionClazz>getSessionManager()Returns the receiver's session manager.voidstop()Shuts down the receiver.-
Methods inherited from class org.marketcetera.util.ws.stateless.StatelessServer
publish
-
Methods inherited from class org.marketcetera.util.ws.stateless.Node
getConnectionUrl, getHost, getId, getNodeDescription, getPort, getPortDescriptors, setHost, setNodeDescription, setPort
-
-
-
-
Field Detail
-
mAuthenticator
private final Authenticator mAuthenticator
-
mSessionManager
private final SessionManager<SessionClazz> mSessionManager
-
mAuthService
private final ServiceInterface mAuthService
-
-
Constructor Detail
-
Server
public Server(String host, int port, Authenticator authenticator, SessionManager<SessionClazz> sessionManager)
Creates a new server node with the given server host name, port, authenticator, and session manager.- Parameters:
host- The host name.port- The port.authenticator- The authenticator, which may be null.sessionManager- The session manager, which may be null.
-
Server
public Server(String inHost, int inPort, Authenticator inAuthenticator, SessionManager<SessionClazz> inSessionManager, ContextClassProvider inContextClassProvider)
Create a new Server instance.- Parameters:
inHost- aStringvalueinPort- anintvalueinAuthenticator- anAuthenticatorvalue ornullinSessionManager- aSessionManager<T>value ornullinContextClassProvider- aContextClassProvidervalue ornull
-
Server
public Server(Authenticator authenticator, SessionManager<SessionClazz> sessionManager)
Creates a new server node with the default server host name and port, and the given authenticator and session manager.- Parameters:
authenticator- The authenticator, which may be null.sessionManager- The session manager, which may be null.
-
Server
public Server()
Creates a new server node with the default server host name and port, and no authenticator or session manager.
-
-
Method Detail
-
getAuthenticator
public Authenticator getAuthenticator()
Returns the receiver's authenticator.- Returns:
- The authenticator, which may be null.
-
getSessionManager
public SessionManager<SessionClazz> getSessionManager()
Returns the receiver's session manager.- Returns:
- The session manager, which may be null.
-
getAuthService
private ServiceInterface getAuthService()
Returns the receiver's authentication service interface.- Returns:
- The interface, which may be null.
-
stop
public void stop()
Description copied from class:StatelessServerShuts down the receiver.- Overrides:
stopin classStatelessServer
-
getServer
public Server<SessionClazz> getServer()
Description copied from interface:ServerProviderGets the server value.- Specified by:
getServerin interfaceServerProvider<SessionClazz>- Returns:
- a
Server<T>value
-
-