Class IMSConnection
- java.lang.Object
-
- com.ibm.connector2.ims.ico.IMSConnection
-
public class IMSConnection extends java.lang.ObjectAn IMSConnection instance is an application-level handle that is used by a component to access an underlying physical connection to IMS Connect. IMS Connect in turn uses the Cross System Coupling Facility (XCF) to access IMS OTMA. A physical connection, such as a TCP/IP socket or Local Option connection, is represented by an IMSManagedConnection instance. An application that uses the Common Client Interface (CCI) obtains an IMSConnection instance by invoking the getConnection() method of an IMSConnectionFactory instance.
The variant of the getConnection() method that is used depends on how the the application is configured. For example:
- If an application uses component-managed sign-on, an IMSConnectionSpec object containing the security information must be provided to the getConnection() method.
Connection connection = null; // Populate an IMSConnectionSpec object IMSConnectionSpec aCSpec = new IMSConnectionSpec(); aCSpec.setUserName("myUserName"); aCSpec.setPassword("myPassword"); aCSpec.setGroupName("myGroupName"); // Obtain a connection handle connection = connectionFactory.getConnection(aCSpec);- If an application is using a dedicated persistent socket connection to IMS Connect, an IMSConnectionSpec object containing the clientID must be provided to the getConnection() method.
Connection connection = null; // Populate an IMSConnectionSpec object IMSConnectionSpec aCSpec = new IMSConnectionSpec(); aCSpec.setClientID("CLIENT01"); // Obtain a connection handle connection = connectionFactory.getConnection(aCSpec);- If an application uses container-managed sign-on and does not need to provide a clientID it does not provide an IMSConnectionSpec object.
Connection connection = null; // Obtain a connection handle connection = connectionFactory.getConnection();- If an application is using a shareable persistent socket, the clientID is exposed through the IMSConnectionMetaData class. From the IMSConnection class the user can call the IMSConnectionMetaData class. Then, using the IMSConnectionMetaData class, the user can call the 'getClientID' method to retrieve the clientID, which can be either user provided or generated by the adapter.
Connection connection = null; IMSConnectionMetaData meta = (IMSConnectionMetaData)connection.getMetaData(); String clientID = meta.getClientID();- See Also:
IMSConnectionSpec,IMSManagedConnectionFactory
-
-
Constructor Summary
Constructors Constructor and Description IMSConnection(ManagedConnection aManagedConnection)Creates an IMSConnection instance as an application handle to an IMSManagedConnection instance representing a physical connection such as a TCP/IP socket or a Local Option connection.
-
Method Summary
Methods Modifier and Type Method and Description voidclose()Releases an allocated connection handle.javax.resource.cci.InteractioncreateInteraction()Creates an IMSInteraction instance to use to interact with IMS OTMA via IMS Connect.IMSConnectionFactorygetConnectionFactory()javax.resource.cci.LocalTransactiongetLocalTransaction()Returns a LocalTransaction instance that enables a component to demarcate resource manager local transactions (not supported).javax.resource.cci.ConnectionMetaDatagetMetaData()Returns information about the IMS Connect and IMS instances connected by an IMSConnection instance.javax.resource.cci.ResultSetInfogetResultSetInfo()Returns a ResultSetInfo object (not supported).voidsetConnectionFactory(IMSConnectionFactory connectionFactory)
-
-
-
Constructor Detail
-
IMSConnection
public IMSConnection(ManagedConnection aManagedConnection)
Creates an IMSConnection instance as an application handle to an IMSManagedConnection instance representing a physical connection such as a TCP/IP socket or a Local Option connection.- Parameters:
aManagedConnection- The instance representing the physical connection to IMS Connect.
-
-
Method Detail
-
close
public void close() throws javax.resource.ResourceExceptionReleases an allocated connection handle.- Throws:
javax.resource.ResourceException-Note: The derived exception javax.resource.spi.IllegalStateException is thrown by close() if the IMSConnection instance is already closed.
-
createInteraction
public javax.resource.cci.Interaction createInteraction() throws javax.resource.ResourceExceptionCreates an IMSInteraction instance to use to interact with IMS OTMA via IMS Connect. For example, an application that uses the Common Client Interface (CCI) can use an IMSInteraction instance to submit an IMS transaction using the associated IMSConnection instance.- Returns:
- An IMSInteraction object.
- Throws:
javax.resource.ResourceException-Note: The derived exception javax.resource.spi.IllegalStateException is thrown by createInteraction() when an attempt to create an IMSInteraction instance is made when the IMSConnection instance is already closed.
- See Also:
IMSInteraction
-
getLocalTransaction
public javax.resource.cci.LocalTransaction getLocalTransaction() throws javax.resource.ResourceExceptionReturns a LocalTransaction instance that enables a component to demarcate resource manager local transactions (not supported).Note: IMS TM Resource Adapter currently does not have local transaction support.
- Returns:
- A LocalTransaction instance.
- Throws:
javax.resource.ResourceException-Note: The derived exception javax.resource.NotSupportedException is thrown by getLocalTransaction().
-
getMetaData
public javax.resource.cci.ConnectionMetaData getMetaData() throws javax.resource.ResourceExceptionReturns information about the IMS Connect and IMS instances connected by an IMSConnection instance.- Returns:
- The IMSConnectionMetaData instance.
- Throws:
javax.resource.ResourceException
-
getResultSetInfo
public javax.resource.cci.ResultSetInfo getResultSetInfo() throws javax.resource.ResourceExceptionReturns a ResultSetInfo object (not supported).Note: ResultSetInfo is not supported by IMS TM Resource Adapter.
- Returns:
- A ResultSetInfo instance.
- Throws:
javax.resource.ResourceException-Note: The derived exception javax.resource.NotSupportedException is thrown by getResultSetInfo(). .
-
getConnectionFactory
public IMSConnectionFactory getConnectionFactory()
- Returns:
- Returns the connectionFactory.
-
setConnectionFactory
public void setConnectionFactory(IMSConnectionFactory connectionFactory)
- Parameters:
connectionFactory- The connectionFactory to set.
-
-