@Exported public abstract class IdcClient<TConfig extends IdcClientConfig,TProtocol extends Protocol,TConnection extends Connection> extends Object
Modifier | Constructor and Description |
---|---|
protected |
IdcClient(IdcClientManager clientManager,
TConfig clientConfig) |
Modifier and Type | Method and Description |
---|---|
DataBinder |
createBinder() |
protected abstract ConnectionManager<TConnection,TConfig> |
createConnectionManager()
Create the connection manager
|
protected ConnectionPool<TConnection> |
createConnectionPool() |
protected abstract TProtocol |
createProtocol(ServiceRequest<TConnection> serviceRequest)
Create the protocol to handle the request
|
protected ServiceRequest<TConnection> |
createRequest(IdcContext userContext,
DataBinder dataBinder,
TConnection connection,
IdcRequestConfig requestConfig)
Create the service request object
|
protected ServiceResponse |
createResponse(ServiceRequest<TConnection> request,
Protocol protocol,
ServiceResponse response)
Analyze the response from the protocol and return
|
IdcClientManager |
getClientManager() |
TConfig |
getConfig() |
ConnectionManager<TConnection,TConfig> |
getConnectionManager() |
ConnectionPool<TConnection> |
getConnectionPool() |
DataFactory |
getDataFactory() |
String |
getVersion() |
void |
initialize()
Initialize the client.
|
boolean |
isCompatible(String version)
Tests to see if version of RIDC library is compatible with requested version
|
boolean |
isInitialized() |
void |
logout(IdcContext userContext)
Logout
|
void |
logout(IdcContext userContext,
IdcRequestConfig requestConfig)
Logout
|
ServiceResponse |
sendRequest(IdcContext userContext,
DataBinder dataBinder)
Execute the request; sends the request to the Content Server and reads
the response.
|
ServiceResponse |
sendRequest(IdcContext userContext,
DataBinder dataBinder,
IdcRequestConfig requestConfig)
Execute the request; sends the request to the Content Server and reads
the response.
|
void |
setDataFactory(DataFactory dataFactory)
Set the data factory for this client
|
void |
setInitialized(boolean initialized) |
protected IdcClient(IdcClientManager clientManager, TConfig clientConfig)
public void setInitialized(boolean initialized)
public void initialize() throws IdcClientException
IdcClientException
public boolean isInitialized()
public IdcClientManager getClientManager()
public DataFactory getDataFactory()
public DataBinder createBinder()
public void setDataFactory(DataFactory dataFactory)
dataFactory
- the factory used to create the data model objectspublic TConfig getConfig()
public ConnectionPool<TConnection> getConnectionPool() throws ProtocolException
ProtocolException
- if the pool cannot be createdpublic ConnectionManager<TConnection,TConfig> getConnectionManager()
public ServiceResponse sendRequest(IdcContext userContext, DataBinder dataBinder) throws IdcClientException
userContext
- the user contextdataBinder
- the data binder objectIdcClientException
public ServiceResponse sendRequest(IdcContext userContext, DataBinder dataBinder, IdcRequestConfig requestConfig) throws IdcClientException
userContext
- the user contextdataBinder
- the data binder objectrequestConfig
- the request specific configuration / overridesIdcClientException
public void logout(IdcContext userContext) throws IdcClientException
userContext
- the user contextIdcClientException
public void logout(IdcContext userContext, IdcRequestConfig requestConfig) throws IdcClientException
userContext
- the user contextrequestConfig
- the request specific configuration / overridesIdcClientException
protected abstract TProtocol createProtocol(ServiceRequest<TConnection> serviceRequest) throws ProtocolException
serviceRequest
- the service requestProtocolException
protected abstract ConnectionManager<TConnection,TConfig> createConnectionManager()
protected ServiceRequest<TConnection> createRequest(IdcContext userContext, DataBinder dataBinder, TConnection connection, IdcRequestConfig requestConfig)
userContext
- the user contextdataBinder
- the data binderconnection
- the connectionrequestConfig
- the request specific configuration / overridesprotected ServiceResponse createResponse(ServiceRequest<TConnection> request, Protocol protocol, ServiceResponse response)
request
- the request objectprotocol
- the protocol handlerresponse
- the response from the protocol handlerprotected ConnectionPool<TConnection> createConnectionPool() throws ProtocolException
ProtocolException
- if the pool cannot be createdpublic String getVersion()
public boolean isCompatible(String version)
version
- required version of library