com.ibm.cics.core.connections
Interface IConnectionService


public interface IConnectionService

Service for controlling the lifecycle of IConnectables.


Field Summary
static java.lang.String COPYRIGHT
           
 
Method Summary
 void addConnectionServiceListener(ConnectionServiceListener listener)
          Registers a lister for notification of events pertaining to this IConnectionService
 void connect(java.lang.String configurationId)
          Establish a new connection synchronously, using the ConnectionProfile identified by the supplied ID.
 void connectAsync(java.lang.String configurationId)
          Establishes a new connection asynchronously, using the ConnectionProfile identified by the supplied ID.
 void disconnect(java.lang.String categoryId)
          Disconnects any {@link IConnectable registered with the supplied connection category ID.
 void disconnectAsync(java.lang.String categoryId)
          Disconnects any {@link IConnectable registered with the supplied connection category ID.
 IConnectable getConnectable(java.lang.String connectionCategoryId)
          Returns the IConnectable associated with the supplied connection category ID
 java.util.List<IConnectionCategory> getConnectionCategories()
           
 ConnectionException getConnectionException(java.lang.String currentCategory)
          Returns any ConnectionException that occurred for a connection category
 IConnectionManager getConnectionManager()
           
 IConnectionState getConnectionState(ConnectionProfile profile)
          Returns an IConnectionState corresponding to the supplied connection profile, or a disconnected state, if there was no pre-existing state for that connection profile.
 IConnectionState getConnectionState(java.lang.String connectionCategoryId)
          Retrieve the IConnectionState of a connection category.
 void setConnectable(java.lang.String connectionCategoryId, IConnectable connectable)
          Sets the connectable to be used when interacting with a particular connection category.
 void signOff()
          Asynchronously disconnects from all connected IConnectables, and unauthenticates all credentials
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

connect

void connect(java.lang.String configurationId)
Establish a new connection synchronously, using the ConnectionProfile identified by the supplied ID. The connection service will determine the IConnectionCategory for the supplied connection and locate the IConnectable for that connection category. If the connectable is already connected, it will be syncronously disconnected. A new connection will be established, according to the parameters of the supplied ConnectionProfile by using the IConnectionDescriptor to create an {@link IConnection} class, configuring it by deriving a {@link ConnectionConfiguration} from the supplied {@link ConnectionParameters} and {@link CredentialsConfiguration}, and connecting to it. This new connection will be set as the active connection for the IConnectable.

Parameters:
the - ID of the ConnectionProfile to use to establish a connection.
Throws:
java.lang.IllegalArgumentException - if a ConnectionProfile with the supplied ID can not be found
See Also:
for an asynchronous variant that does not block

connectAsync

void connectAsync(java.lang.String configurationId)
Establishes a new connection asynchronously, using the ConnectionProfile identified by the supplied ID. The connect is performed asynchronously. See {connect(String) for a description of the behaviour.

Parameters:
configurationId -
See Also:
connect(String)

disconnect

void disconnect(java.lang.String categoryId)
                throws ConnectionException
Disconnects any IConnectable registered with the supplied connection category ID. See {@link #disconnectAsync(String)} for an asynchronous variant that does not block.

Parameters:
categoryId - the ID of the category to disconnect from
Throws:
ConnectionException - if disconnecting fails
See Also:
for an asynchronous variant

disconnectAsync

void disconnectAsync(java.lang.String categoryId)
Disconnects any IConnectable registered with the supplied connection category ID. See {@link #disconnect(String)} for an synchronous variant that blocks.

Parameters:
categoryId - the ID of the category to disconnect from
See Also:
for a synchronous variant

getConnectable

IConnectable getConnectable(java.lang.String connectionCategoryId)
Returns the IConnectable associated with the supplied connection category ID

Parameters:
connectionCategoryId - the connection category ID to find the connectable for
Returns:
the corresponding IConnectable or null

addConnectionServiceListener

void addConnectionServiceListener(ConnectionServiceListener listener)
Registers a lister for notification of events pertaining to this IConnectionService

Parameters:
listener - the ConnectionServiceListener to register

setConnectable

void setConnectable(java.lang.String connectionCategoryId,
                    IConnectable connectable)
Sets the connectable to be used when interacting with a particular connection category.

Parameters:
connectionCategoryId - the ID of the connection category to assign the connectable for
connectable - the IConnectable to assign.

signOff

void signOff()
Asynchronously disconnects from all connected IConnectables, and unauthenticates all credentials


getConnectionManager

IConnectionManager getConnectionManager()
Returns:
the IConnectionManager used to source ConnectionProfiles

getConnectionException

ConnectionException getConnectionException(java.lang.String currentCategory)
Returns any ConnectionException that occurred for a connection category

Parameters:
currentCategory - the ID of the connection category to query for
Returns:
any ConnectionException for that catgory, or null if the category is not in exception state.

getConnectionState

IConnectionState getConnectionState(java.lang.String connectionCategoryId)
Retrieve the IConnectionState of a connection category.

Parameters:
connectionCategoryId - the ID of the IConnectionCategory to query for.
Returns:
the IConnectionState of that category. If the category is unrecognised, the state will represent no connection.

getConnectionCategories

java.util.List<IConnectionCategory> getConnectionCategories()
Returns:
a List of all registered IConnectionCategorys

getConnectionState

IConnectionState getConnectionState(ConnectionProfile profile)
Returns an IConnectionState corresponding to the supplied connection profile, or a disconnected state, if there was no pre-existing state for that connection profile.

Parameters:
profile - the ConnectionProfile to retrieve the IConnectionState for.
Returns:
an IConnectionState representing the state of the supplied profile.


Copyright © 2013 IBM Corp. All Rights Reserved.