CICS® Transaction Gateway Programming Reference v1.1.0.0

com.ibm.connector2.cics
Class CICSManagedConnectionFactory

java.lang.Object
  extended by com.ibm.connector2.cics.CICSManagedConnectionFactory
All Implemented Interfaces:
CICSLogTraceLevels, java.io.Serializable, javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ResourceAdapterAssociation, javax.resource.spi.ValidatingManagedConnectionFactory
Direct Known Subclasses:
ECIManagedConnectionFactory, EPIManagedConnectionFactory

public abstract class CICSManagedConnectionFactory
extends java.lang.Object
implements javax.resource.spi.ManagedConnectionFactory, javax.resource.spi.ValidatingManagedConnectionFactory, CICSLogTraceLevels, javax.resource.spi.ResourceAdapterAssociation

Abstract class that provides the managed connection factory framework for CICS resource adapters.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.ibm.connector2.cics.CICSLogTraceLevels
RAS_TRACE_ENTRY_EXIT, RAS_TRACE_ERROR_EXCEPTION, RAS_TRACE_INTERNAL, RAS_TRACE_OFF
 
Constructor Summary
CICSManagedConnectionFactory()
          Default constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Adds a PropertyChangeListener.
 boolean equals(java.lang.Object inObj)
          Returns a flag indicating whether the objects are identical or not.
 void firePropertyChange(java.lang.String strPropertyName, java.lang.Object oOld, java.lang.Object oNew)
          Fires a PropertyChangeEvent to any listeners.
 java.lang.String getApplid()
          Get the applid for this connection.
 java.lang.String getApplidQualifier()
          Get the applid qualifier for this connection.
 java.lang.String getCipherSuites()
          Return the comma delimited list of cipher suites a SSL connection is able to use.
 java.lang.String getClientSecurity()
          Get the client security class name.
 java.lang.String getConnectionURL()
          Get the CTG gateway URL.
 java.lang.String getInterceptPlugin()
          Gets the name of the GatewayIntercept plugin class for this managed connection factory.
 java.util.Set getInvalidConnections(java.util.Set connectionSet)
          Returns a Set of invalid connections (those that have been identifed as dirty) from the entire set of CICS managed connections that current exist
 java.lang.String getKeyRingClass()
          Get the key ring class name (applicable only to SSL Protocol).
 java.lang.String getKeyRingPassword()
          Get the key ring password (applicable only to SSL Protocol(s)).
 com.ibm.connector2.cics.CICSLogHelper getLogHelper()
          Get the log helper object.
 java.io.PrintWriter getLogWriter()
          Return the current log writer for this instance.
 java.lang.String getPassword()
          Get the password for this connection.
 java.lang.String getPortNumber()
          Get the port to communicate with the CTG on.
 java.lang.String getRequestExits()
          Get the requestExits for this connection.
 javax.resource.spi.ResourceAdapter getResourceAdapter()
           
 java.lang.String getServerName()
          Return the server to connect to (must be defined to the CTG).
 java.lang.String getServerSecurity()
          Get the server security class name.
 java.lang.String getSocketConnectTimeout()
          Returns the socket connect timeout value for a connection to CICS TG.
 java.lang.Integer getTraceLevel()
          Get the trace level for this managed connection factory.
 java.lang.String getUserName()
          Get the username for this connection.
 int hashCode()
          Returns a hashcode based on connectionURL, serverName and portNumber which uniquely identifies the backend server.
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Removes a PropertyChangeListener.
 void setApplid(java.lang.String newApplid)
          Set the applid for this connection.
 void setApplidQualifier(java.lang.String newApplidHLQ)
          Set the applid qualifier for this connection.
 void setCipherSuites(java.lang.String cipherSuites)
          Set the cipher suites a SSL connection is able to use.
 void setClientSecurity(java.lang.String newClSec)
          Set the client security class name to be used.
 void setConnectionURL(java.lang.String newURL)
          Set the CTG gateway URL.
 void setInterceptPlugin(java.lang.String interceptPlugin)
          Sets the name of the GatewayIntercept plugin class for this managed connection factory.
 void setKeyRingClass(java.lang.String newKeyRing)
          Set the key ring class name to use (applicable and mandatory for SSL protocol(s)).
 void setKeyRingPassword(java.lang.String newPassword)
          Set the key ring password to use (applicable and mandatory for SSL protocol).
 void setLogWriter(java.io.PrintWriter newLog)
          Set the log writer to be used by this object.
 void setPassword(java.lang.String newPassword)
          Set the password for this connection.
 void setPortNumber(java.lang.String newPort)
          Set the port to communicate with the CTG on.
 void setRequestExits(java.lang.String newRequestExits)
          Set the requestExits for this connection.
 void setResourceAdapter(javax.resource.spi.ResourceAdapter cicsRA)
           
 void setServerName(java.lang.String newServer)
          Set the server to connect to (this name must be defined in the CTG config).
 void setServerSecurity(java.lang.String newSvrSec)
          Set the server security class name to be used.
 void setSocketConnectTimeout(java.lang.String newTimeout)
          Sets the socket connection timeout value for a connection to CICS TG.
 void setTraceLevel(java.lang.Integer newLevel)
          Set the trace level for this managed connection factory and anything it creates.
 void setUserName(java.lang.String newUser)
          Set the username for this connection.
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.resource.spi.ManagedConnectionFactory
createConnectionFactory, createConnectionFactory, createManagedConnection, matchManagedConnections
 

Constructor Detail

CICSManagedConnectionFactory

public CICSManagedConnectionFactory()
Default constructor. All properties must be set using the appropriate setters.

Method Detail

getConnectionURL

public java.lang.String getConnectionURL()
Get the CTG gateway URL.

Returns:
Gateway URL.

setConnectionURL

public void setConnectionURL(java.lang.String newURL)
Set the CTG gateway URL.

Parameters:
newURL - The new CTG gateway URL.

getServerName

public java.lang.String getServerName()
Return the server to connect to (must be defined to the CTG).

Returns:
The server name.

setServerName

public void setServerName(java.lang.String newServer)
Set the server to connect to (this name must be defined in the CTG config). If this is left unset, the default server defined in the gateway is used.

Parameters:
newServer - The server to connect to.

getUserName

public java.lang.String getUserName()
Get the username for this connection.

Returns:
The username.

setUserName

public void setUserName(java.lang.String newUser)
Set the username for this connection.

Parameters:
newUser - The new username.

getRequestExits

public java.lang.String getRequestExits()
Get the requestExits for this connection.

Returns:
The requestExits.

setRequestExits

public void setRequestExits(java.lang.String newRequestExits)
Set the requestExits for this connection.

Parameters:
newRequestExits - The new requestExits.

getApplid

public java.lang.String getApplid()
Get the applid for this connection.

Returns:
The Applid.

setApplid

public void setApplid(java.lang.String newApplid)
Set the applid for this connection.

Parameters:
newApplid - The new applid.

getApplidQualifier

public java.lang.String getApplidQualifier()
Get the applid qualifier for this connection.

Returns:
The Applid Qualifier.

setApplidQualifier

public void setApplidQualifier(java.lang.String newApplidHLQ)
Set the applid qualifier for this connection.

Parameters:
newApplidHLQ - The new applid qualifier.

getPassword

public java.lang.String getPassword()
Get the password for this connection.

Returns:
The password.

setPassword

public void setPassword(java.lang.String newPassword)
Set the password for this connection.

Parameters:
newPassword - The new password.

getPortNumber

public java.lang.String getPortNumber()
Get the port to communicate with the CTG on.

Returns:
The port number.

setPortNumber

public void setPortNumber(java.lang.String newPort)
Set the port to communicate with the CTG on. Default is 2006 for negative or non numeric values.

Parameters:
newPort - The new port number.

getSocketConnectTimeout

public java.lang.String getSocketConnectTimeout()
Returns the socket connect timeout value for a connection to CICS TG. The timeout represents the maximum amount of time (in milliseconds) a connection will attempt to open a socket connection successfully to a remote Gateway daemon. The timeout is ignored for attempted connections to a local Gateway instance.

Returns:
String socketConnectTimeout The timeout value (in milliseconds). A value of 0 represents no timeout.

setSocketConnectTimeout

public void setSocketConnectTimeout(java.lang.String newTimeout)
                             throws javax.resource.spi.InvalidPropertyException
Sets the socket connection timeout value for a connection to CICS TG. This timeout represents the maximum amount of time (in milliseconds) a managed connection will attempt to open a socket connection successfully to a remote Gateway daemon. The timeout is ignored for attempted connections to a local Gateway instance.

Parameters:
newTimeout - The timeout value (in milliseconds). A value of 0 represents no timeout. Note the value is passed as a String
Throws:
javax.resource.spi.InvalidPropertyException - If a negative value is passed

getClientSecurity

public java.lang.String getClientSecurity()
Get the client security class name.

Returns:
The client security class name.

setClientSecurity

public void setClientSecurity(java.lang.String newClSec)
Set the client security class name to be used.

Parameters:
newClSec - The client security class name.

getServerSecurity

public java.lang.String getServerSecurity()
Get the server security class name.

Returns:
The server security class name.

setServerSecurity

public void setServerSecurity(java.lang.String newSvrSec)
Set the server security class name to be used.

Parameters:
newSvrSec - The server security class name.

getKeyRingClass

public java.lang.String getKeyRingClass()
Get the key ring class name (applicable only to SSL Protocol).

Returns:
The key ring class name.

setKeyRingClass

public void setKeyRingClass(java.lang.String newKeyRing)
Set the key ring class name to use (applicable and mandatory for SSL protocol(s)).

Parameters:
newKeyRing - The key ring class name.

getKeyRingPassword

public java.lang.String getKeyRingPassword()
Get the key ring password (applicable only to SSL Protocol(s)).

Returns:
The key ring password.

setKeyRingPassword

public void setKeyRingPassword(java.lang.String newPassword)
Set the key ring password to use (applicable and mandatory for SSL protocol).

Parameters:
newPassword - The key ring class password.

setCipherSuites

public void setCipherSuites(java.lang.String cipherSuites)
Set the cipher suites a SSL connection is able to use.

Parameters:
cipherSuites - A comma delimited list of cipher suites.

getCipherSuites

public java.lang.String getCipherSuites()
Return the comma delimited list of cipher suites a SSL connection is able to use.

Returns:
The list of cipher suites.

getInvalidConnections

public java.util.Set getInvalidConnections(java.util.Set connectionSet)
                                    throws javax.resource.ResourceException
Returns a Set of invalid connections (those that have been identifed as dirty) from the entire set of CICS managed connections that current exist

Specified by:
getInvalidConnections in interface javax.resource.spi.ValidatingManagedConnectionFactory
Parameters:
connectionSet - The set of all CICS managed connections
Returns:
The set of all CICS managed connection that have determined to be invalid
Throws:
javax.resource.ResourceException

getLogWriter

public java.io.PrintWriter getLogWriter()
Return the current log writer for this instance.

Specified by:
getLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Returns:
The log writer.

setLogWriter

public void setLogWriter(java.io.PrintWriter newLog)
Set the log writer to be used by this object. Setting this to null will switch off logging. Setting it to a PrintWriter object will turn logging on.

Specified by:
setLogWriter in interface javax.resource.spi.ManagedConnectionFactory
Parameters:
newLog - The PrintWriter object to use.

getTraceLevel

public java.lang.Integer getTraceLevel()
Get the trace level for this managed connection factory.

Returns:
trace level.
See Also:
CICSLogTraceLevels

setTraceLevel

public void setTraceLevel(java.lang.Integer newLevel)
Set the trace level for this managed connection factory and anything it creates.

Parameters:
newLevel - The trace level to use.
See Also:
CICSLogTraceLevels

getInterceptPlugin

public java.lang.String getInterceptPlugin()
Gets the name of the GatewayIntercept plugin class for this managed connection factory.

Returns:
the name of the Gateway intercept plugin class

setInterceptPlugin

public void setInterceptPlugin(java.lang.String interceptPlugin)
Sets the name of the GatewayIntercept plugin class for this managed connection factory.

Parameters:
interceptPlugin - the name of the Gateway intercept plugin class

getLogHelper

public com.ibm.connector2.cics.CICSLogHelper getLogHelper()
Get the log helper object. As the log helper is transient, we must use this method. It will create a log helper object at the first use.


hashCode

public int hashCode()
Returns a hashcode based on connectionURL, serverName and portNumber which uniquely identifies the backend server.

Specified by:
hashCode in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
hashCode in class java.lang.Object
Returns:
The hashcode.

equals

public boolean equals(java.lang.Object inObj)
Returns a flag indicating whether the objects are identical or not. Objects are identical if they have the same reference or the connection properties match. This version tests everything except userid and password. Note that equals here assumes null and "" are NOT the same, although they will have the same behaviour in the framework.

Specified by:
equals in interface javax.resource.spi.ManagedConnectionFactory
Overrides:
equals in class java.lang.Object
Returns:
true if the objects are equal, false otherwise.

toString

public java.lang.String toString()
Return a string representation of this object. It is made up of the super.toString() and the properties held in this object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this instance.

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
Adds a PropertyChangeListener.

Parameters:
pcl - java.beans.PropertyChangeListener.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
Removes a PropertyChangeListener.

Parameters:
pcl - java.beans.PropertyChangeListener.

firePropertyChange

public void firePropertyChange(java.lang.String strPropertyName,
                               java.lang.Object oOld,
                               java.lang.Object oNew)
Fires a PropertyChangeEvent to any listeners.

Parameters:
strPropertyName - java.lang.String.
oOld - java.lang.Object.
oNew - java.lang.Object.

getResourceAdapter

public javax.resource.spi.ResourceAdapter getResourceAdapter()
Specified by:
getResourceAdapter in interface javax.resource.spi.ResourceAdapterAssociation

setResourceAdapter

public void setResourceAdapter(javax.resource.spi.ResourceAdapter cicsRA)
                        throws javax.resource.ResourceException
Specified by:
setResourceAdapter in interface javax.resource.spi.ResourceAdapterAssociation
Throws:
javax.resource.ResourceException

©Copyright IBM Corp. 1994, 2014
Legal