Class StatelessClient
- java.lang.Object
-
- org.marketcetera.util.ws.stateless.Node
-
- org.marketcetera.util.ws.stateless.StatelessClient
-
- All Implemented Interfaces:
UsesPort
- Direct Known Subclasses:
Client
public class StatelessClient extends Node
A client node for stateless communication. Its (optional) application ID is that of the application which hosts the client.- Since:
- 1.0.0
- Version:
- $Id: StatelessClient.java 17757 2018-11-13 20:41:13Z colin $
- Author:
- tlerios@marketcetera.com
-
-
Field Summary
Fields Modifier and Type Field Description private ContextClassProvidercontextClassProvidercontext classes to add to the client context, if anyprivate AppIdmAppId-
Fields inherited from class org.marketcetera.util.ws.stateless.Node
DEFAULT_CLIENT_HOST, DEFAULT_PORT, DEFAULT_SERVER_HOST
-
-
Constructor Summary
Constructors Constructor Description StatelessClient()Creates a new client node with the default server host name and port, and no client application ID.StatelessClient(String host, int port, AppId appId)Creates a new client node with the given server host name, port, and client application ID.StatelessClient(String inHost, int inPort, AppId inAppId, ContextClassProvider inContextClasses)Create a new StatelessClient instance.StatelessClient(AppId appId)Creates a new client node with the default server host name and port, and the given client application ID.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfillContext(StatelessClientContext context)Sets the properties of the given client context, so that it may be used for remote calls made via proxies obtained from the receiver.AppIdgetAppId()Returns the receiver's application ID.StatelessClientContextgetContext()Returns a client context which the client must supply as an argument to every remote call made via proxies obtained from the receiver.<T extends StatelessServiceBase>
TgetService(Class<T> inInterface)Retrieves the client-side proxy for the given service interface.-
Methods inherited from class org.marketcetera.util.ws.stateless.Node
getConnectionUrl, getHost, getId, getNodeDescription, getPort, getPortDescriptors, setHost, setNodeDescription, setPort
-
-
-
-
Field Detail
-
mAppId
private final AppId mAppId
-
contextClassProvider
private final ContextClassProvider contextClassProvider
context classes to add to the client context, if any
-
-
Constructor Detail
-
StatelessClient
public StatelessClient(String inHost, int inPort, AppId inAppId, ContextClassProvider inContextClasses)
Create a new StatelessClient instance.- Parameters:
inHost- aStringvalueinPort- anintvalueinAppId- anAppIdvalueinContextClasses- aContextClassProvidervalue
-
StatelessClient
public StatelessClient(String host, int port, AppId appId)
Creates a new client node with the given server host name, port, and client application ID.- Parameters:
host- The host name.port- The port.appId- The application ID, which may be null.
-
StatelessClient
public StatelessClient(AppId appId)
Creates a new client node with the default server host name and port, and the given client application ID.- Parameters:
appId- The application ID, which may be null.
-
StatelessClient
public StatelessClient()
Creates a new client node with the default server host name and port, and no client application ID.
-
-
Method Detail
-
getAppId
public AppId getAppId()
Returns the receiver's application ID.- Returns:
- The application ID, which may be null.
-
fillContext
protected void fillContext(StatelessClientContext context)
Sets the properties of the given client context, so that it may be used for remote calls made via proxies obtained from the receiver.- Parameters:
context- The context.
-
getContext
public StatelessClientContext getContext()
Returns a client context which the client must supply as an argument to every remote call made via proxies obtained from the receiver.- Returns:
- The context.
-
getService
public <T extends StatelessServiceBase> T getService(Class<T> inInterface)
Retrieves the client-side proxy for the given service interface.- Type Parameters:
T- aT extends StatelessServiceBasevalue- Parameters:
inInterface- The interface class.
-
-