com.ibm.connector2.cics
Class ECIManagedConnectionFactory

java.lang.Object
  extended bycom.ibm.connector2.cics.ECIManagedConnectionFactory
All Implemented Interfaces:
CICSLogTraceLevels

public class ECIManagedConnectionFactory
extends java.lang.Object
implements CICSLogTraceLevels

Abstract class that provides the ManagedConnectionFactory Framework for CICS Resource Adapters


Field Summary
static java.lang.String CLASS_VERSION
           
 
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
ECIManagedConnectionFactory()
          Default Constructor.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Adds a PropertyChangeListener.
 java.lang.Object createConnectionFactory()
          This method is the default route to creating ECIConnectionFactory objects.
 java.lang.Object createConnectionFactory(ConnectionManager cm)
          This method allows a ConnectionManager to be specified as the one to be used by the returned ECIConnectionFactory.
 ManagedConnection createManagedConnection(javax.security.auth.Subject security, ConnectionRequestInfo request)
          When no ECIManagedConnections matching the requirements laid down in the security or request parameters are found this method is used to create a new ECIManagedConnection object.
 boolean equals(java.lang.Object inObj)
          Returns a flag indicating if 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 getClientSecurity()
          get the Client Security Class Name
 java.lang.String getConnectionURL()
          get the CTG Gateway URL
 java.lang.String getKeyRingClass()
          get the Keyring class name (applicable only to SSL Protocol)
 java.lang.String getKeyRingPassword()
          get the Keyring password to (applicable only to SSL Protocol(s))
 java.io.PrintWriter getLogWriter()
          return the Current Logwriter for this instance
 java.lang.String getPassword()
          get the password for this connection
 java.lang.String getPortNumber()
          get the port to communicate to the CTG on
 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 getTPNName()
          Allows access to the TPN Transaction Name that all CICS request will run under.
 java.lang.Integer getTraceLevel()
          get the trace level for this Managed Connection Factory
 java.lang.String getTranName()
          Allows access to the Transaction Name that all CICS request will run under.
 java.lang.String getUserName()
          get the username for this connection
 int hashCode()
          Returns a hashcode based on connectionURL, serverName, portNumber, which uniquely identify the backend server.
 ManagedConnection matchManagedConnections(java.util.Set connections, javax.security.auth.Subject security, ConnectionRequestInfo request)
          In order for a generic J2EE environment to successfully match a connection request to a ManagedConnection implementation it must delegate to the specific Resource Adapter.
 void removePropertyChangeListener(java.beans.PropertyChangeListener pcl)
          Removes a PropertyChangeListener.
 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 setKeyRingClass(java.lang.String newKeyRing)
          set the Keyring class name to use (applicable and mandatory for SSL protocol(s))
 void setKeyRingPassword(java.lang.String newPassword)
          set the keyring Password to use (applicable and mandatory for SSL protocol)
 void setLogWriter(java.io.PrintWriter newLog)
          set the logwriter to be used by this object.This is not used by CCI for CICS TS.
 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 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 Client Security Class Name to be used
 void setTPNName(java.lang.String name)
          Sets the TPN Transaction Name that all CICS requests will run under.
 void setTraceLevel(java.lang.Integer newLevel)
          set the trace level for this managed connection factory and anything it creates.
 void setTranName(java.lang.String name)
          Sets the Transaction Name that all CICS requests will run under.
 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
 

Field Detail

CLASS_VERSION

public static final java.lang.String CLASS_VERSION
See Also:
Constant Field Values
Constructor Detail

ECIManagedConnectionFactory

public ECIManagedConnectionFactory()
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:
ServerName

setServerName

public void setServerName(java.lang.String newServer)
set the Server to connect to (this name must be defined in the CTG config)

Parameters:
newServer - The Server to connect to

getUserName

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

Returns:
Username

setUserName

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

Parameters:
newUser - Username

getPassword

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

Returns:
password

setPassword

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

Parameters:
newPassword - password

getPortNumber

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

Returns:
port

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 -

getClientSecurity

public java.lang.String getClientSecurity()
get the Client Security Class Name

Returns:
Client Security class name

setClientSecurity

public void setClientSecurity(java.lang.String newClSec)
set the Client Security Class Name to be used


getServerSecurity

public java.lang.String getServerSecurity()
get the Server Security Class Name

Returns:
Server Security class name

setServerSecurity

public void setServerSecurity(java.lang.String newSvrSec)
set the Client Security Class Name to be used


getKeyRingClass

public java.lang.String getKeyRingClass()
get the Keyring class name (applicable only to SSL Protocol)

Returns:
keyRing Class Name

setKeyRingClass

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

Parameters:
newKeyRing - The keyring class name

getKeyRingPassword

public java.lang.String getKeyRingPassword()
get the Keyring password to (applicable only to SSL Protocol(s))

Returns:
keyRing Password

setKeyRingPassword

public void setKeyRingPassword(java.lang.String newPassword)
set the keyring Password to use (applicable and mandatory for SSL protocol)

Parameters:
newPassword - The keyring class password

getLogWriter

public java.io.PrintWriter getLogWriter()
return the Current Logwriter for this instance

Returns:
the log writer

setLogWriter

public void setLogWriter(java.io.PrintWriter newLog)
set the logwriter to be used by this object.This is not used by CCI for CICS TS. In the CICS TS environment trace entries are always written to the MVS dataset DFHxUXT and the trace level is set using the CICS transaction CETR.

Parameters:
newLog - The PrintWriter 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. This is not used by CCI for CICS TS. In the CICS TS environment trace entries are always written to the MVS dataset DFHxUXT and the trace level is set using the CICS transaction CETR.

Parameters:
newLevel - Trace Level to use
See Also:
CICSLogTraceLevels

getTranName

public java.lang.String getTranName()
Allows access to the Transaction Name that all CICS request will run under.

Returns:
The current Transid to run under

getTPNName

public java.lang.String getTPNName()
Allows access to the TPN Transaction Name that all CICS request will run under.

Returns:
The current TPN id to run under

setTranName

public void setTranName(java.lang.String name)
Sets the Transaction Name that all CICS requests will run under.

Parameters:
name - The new Transid to use.

setTPNName

public void setTPNName(java.lang.String name)

Sets the TPN Transaction Name that all CICS requests will run under.

Note: This takes precedence over TranName so if both are specified TPNName will be used.

Parameters:
name - The new Transid to use.

hashCode

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

Returns:
Hashcode

equals

public boolean equals(java.lang.Object inObj)
Returns a flag indicating if the objects are identical or not. objects are identical if the 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.

Returns:
flag

toString

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

Returns:
A String representation

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

createConnectionFactory

public java.lang.Object createConnectionFactory()
                                         throws ResourceException
This method is the default route to creating ECIConnectionFactory objects. The returned object will be associated with the supplied DefaultConnectionManager that it will use in its factory methods.

Throws:
ResourceException

createConnectionFactory

public java.lang.Object createConnectionFactory(ConnectionManager cm)
                                         throws ResourceException
This method allows a ConnectionManager to be specified as the one to be used by the returned ECIConnectionFactory.

Parameters:
cm - The ConnectionManager object to associate with the new ECIConnectionFactory
Returns:
The new ECIConnectionFactory object
Throws:
ResourceException

createManagedConnection

public ManagedConnection createManagedConnection(javax.security.auth.Subject security,
                                                 ConnectionRequestInfo request)
                                          throws ResourceException
When no ECIManagedConnections matching the requirements laid down in the security or request parameters are found this method is used to create a new ECIManagedConnection object.

Parameters:
security - A system supplied set of security credentials
request - An ECIConnectionRequestInfo object containing the client components security credentials if supplied
Returns:
A new logged on ECIManagedConnection object
Throws:
ResourceException - Thrown when the parameters are not of the required type

matchManagedConnections

public ManagedConnection matchManagedConnections(java.util.Set connections,
                                                 javax.security.auth.Subject security,
                                                 ConnectionRequestInfo request)
In order for a generic J2EE environment to successfully match a connection request to a ManagedConnection implementation it must delegate to the specific Resource Adapter. This method is used in that delegation to match one of the supplied ManagedConnection objects to the properties defined in the deployed Resource Adapter.

Parameters:
connections - The java.util.Set of candidate ManagedConnection objects that are to be tested for a match.
security - A possibly null set of security credentials
request - An ECIConnectionRequestInfo object
Returns:
An ECIManagedConnection object if a succesful match is made otherwise null