CICS® Transaction Gateway Programming Reference V3.1

com.ibm.ctg.client
Class JavaGateway

java.lang.Object
  |
  +--com.ibm.ctg.client.JavaGateway
Direct Known Subclasses:
EPIGateway

public class JavaGateway
extends java.lang.Object

This class is now a wrapper class around underlying classes that do the real work of managing a connection/pseudo-connection between a program and the Gateway or local-client. These underlying classes must implement the JavaGatewayInterface. This class then simply passes through any calls.

See Also:
AutoJavaGateway, HttpJavaGateway, HttpsJavaGateway, LocalJavaGateway, SslJavaGateway, TcpJavaGateway

Constructor Summary
JavaGateway()
          Constructs a default JavaGateway object.
JavaGateway(java.lang.String strSetURL, int iSetPort)
          Constructs a JavaGateway object and connects it via the relevant protocol to a CICS Gateway for Java or local client.
JavaGateway(java.lang.String strSetURL, int iSetPort, java.lang.String strSetClientSecurity, java.lang.String strSetServerSecurity)
          Constructs a JavaGateway object and connects it via the relevant protocol to a CICS Gateway for Java or local client.
 
Method Summary
 void close()
          Pass through to the underlying real Gateway object
 int flow(GatewayRequest gatRequest)
          Pass through to the underlying real Gateway object
 java.lang.String getAddress()
          Returns the address that this JavaGateway is/will be connected to.
 java.util.Locale getGatewayLocale()
          Returns the Locale of the remote Gateway if it is known.
 java.lang.String getGatewayOs()
          Returns a string containing the JVM platform, architecture and version.
 int getPort()
          Returns the port that this JavaGateway is/will be connected to.
 java.lang.String getProtocol()
          Returns the protocol that this JavaGateway is/will be connected via.
 java.lang.String getURL()
          Returns the URL that this JavaGateway is/will be connected via.
 boolean isInitialFlow()
          Checks whether an initial flow will be sent when this JavaGateway is opened
 boolean isOpen()
          Checks both our expected state and the real state of any wrappered object
 void open()
          Opens this JavaGateway type object.
 void setAddress(java.lang.String strSetAddress)
          Set the address that this JavaGateway connects to.
 void setInitialFlow(boolean bSetInitialFlow)
          When a JavaGateway connects to a remote Gateway host, an initial flow takes place.
 void setPort(int iSetPort)
          Sets the port that this JavaGateway connects to.
 void setProtocol(java.lang.String strSetProtocol)
          Set the protocol that this JavaGateway connects via.
 void setSecurity(java.lang.String strSetClientSecurity, java.lang.String strSetServerSecurity)
          Sets the security classes to be used on the client and server sides of this connection.
 void setURL(java.lang.String strSetURL)
          Sets the protocol, address and port of this JavaGateway by means of a single URL string.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaGateway

public JavaGateway()
Constructs a default JavaGateway object. This object is connected to no where, and has settings. You should use the various set... methods to the JavaGateway's properties, before calling the open method to connect it to the relevant CICS Gateway for Java or local client.

JavaGateway

public JavaGateway(java.lang.String strSetURL,
                   int iSetPort)
            throws java.io.IOException
Constructs a JavaGateway object and connects it via the relevant protocol to a CICS Gateway for Java or local client. This constructor calls the relevant setURL(), setPort() and open() methods, and so has the same result as constructing a default JavaGateway and then setting its properties prior to opening it.
Parameters:
strSetURL - URL specifying the remote/local Gateway to connect to
iSetPort - TCP/IP port to connect to, if relevant
Throws:
java.io.IOException - If an error occurs when opening the JavaGateway

JavaGateway

public JavaGateway(java.lang.String strSetURL,
                   int iSetPort,
                   java.lang.String strSetClientSecurity,
                   java.lang.String strSetServerSecurity)
            throws java.io.IOException
Constructs a JavaGateway object and connects it via the relevant protocol to a CICS Gateway for Java or local client. This constructor calls the relevant setURL(), setPort(), setSecurity() and open() methods, and so has the same result as constructing a default JavaGateway and then setting its properties prior to opening it.
Parameters:
strSetURL - URL specifying the remote/local Gateway to connect to
iSetPort - TCP/IP port to connect to, if relevant
strSetClientSecurity - Name of class implementing ClientSecurity to use on this connection
strSetServerSecurity - Name of class implementing ServerSecurity to use on this connection
Throws:
java.io.IOException - If an error occurs when opening the JavaGateway
Method Detail

open

public void open()
          throws java.io.IOException
Opens this JavaGateway type object. We use the previous set parameters to decide what type of underlying JavaGatewayInterface object to create.
Throws:
java.io.IOException - If an error occurs when creating things

flow

public int flow(GatewayRequest gatRequest)
         throws java.io.IOException
Pass through to the underlying real Gateway object
Parameters:
gatRequest - GatewayRequest object containing the request
Returns:
Return code from this flow operation
Throws:
java.io.IOException - If a network I/O error occurs during the operation

close

public void close()
           throws java.io.IOException
Pass through to the underlying real Gateway object
Throws:
java.io.IOException - If a network I/O error occurs during the operation

setAddress

public void setAddress(java.lang.String strSetAddress)
                throws java.io.IOException
Set the address that this JavaGateway connects to. This is only allowed when the JavaGateway is in a closed state.
Parameters:
strSetAddress - Address (normally TCP/IP) to connect to
Throws:
java.io.IOException - If the JavaGateway is in an open state

getAddress

public java.lang.String getAddress()
Returns the address that this JavaGateway is/will be connected to.
Returns:
String address

setPort

public void setPort(int iSetPort)
             throws java.io.IOException
Sets the port that this JavaGateway connects to. This is only allowed when the JavaGateway is in a closed state.
Parameters:
iSetPort - Port (normally TCP/IP) to connect to
Throws:
java.io.IOException - If the JavaGateway is in an open state

getPort

public int getPort()
Returns the port that this JavaGateway is/will be connected to.
Returns:
Integer port

setProtocol

public void setProtocol(java.lang.String strSetProtocol)
                 throws java.io.IOException
Set the protocol that this JavaGateway connects via. This is only allowed when the JavaGateway is in a closed state.
Parameters:
strSetProtocol - Protocol used to connect via
Throws:
java.io.IOException - If the JavaGateway is in an open state

getProtocol

public java.lang.String getProtocol()
Returns the protocol that this JavaGateway is/will be connected via.
Returns:
String protocol

setURL

public void setURL(java.lang.String strSetURL)
            throws java.io.IOException
Sets the protocol, address and port of this JavaGateway by means of a single URL string. The URL takes the expected form of : protcol://address:port/

This is only allowed when the JavaGateway is in a closed state

Parameters:
strSetURL - URL that the JavaGateway will connect to
Throws:
java.io.IOException - If the JavaGateway is in an open state

getURL

public java.lang.String getURL()
Returns the URL that this JavaGateway is/will be connected via.
Returns:
String URL

isOpen

public boolean isOpen()
Checks both our expected state and the real state of any wrappered object
Returns:
Boolean state

setSecurity

public void setSecurity(java.lang.String strSetClientSecurity,
                        java.lang.String strSetServerSecurity)
                 throws java.io.IOException
Sets the security classes to be used on the client and server sides of this connection. The parameters specify the names of the classes to use. The client-side class must implement the ClientSecurity interface, and the server-side class the ServerSecurity interface. This is only allowed when the JavaGateway is in a closed state.
Parameters:
strSetClientSecurity - Name of class implementing ClientSecurity to use on this connection
strSetServerSecurity - Name of class implementing ServerSecurity to use on this connection
Throws:
java.io.IOException - If the JavaGateway is in an open state

setInitialFlow

public void setInitialFlow(boolean bSetInitialFlow)
                    throws java.io.IOException
When a JavaGateway connects to a remote Gateway host, an initial flow takes place. This flow includes information about security objects being used, along with other information such as the Locale that the Gateway is using.

If you are not using security objects and are not interested in any Locale information, you can choose to not incur the additional network traffic produced by the initial flow.

This method turns on/off the production of this initial flow.

Parameters:
bSetInitialFlow - Whether to produce initial flows or not
Throws:
java.io.IOException - If the JavaGateway is in an open state

isInitialFlow

public boolean isInitialFlow()
Checks whether an initial flow will be sent when this JavaGateway is opened
Returns:
Boolean state

getGatewayLocale

public java.util.Locale getGatewayLocale()
Returns the Locale of the remote Gateway if it is known. If it is unknown, then a null reference is returned.

The Gateway Locale may be unknown because you have yet to open the Gateway, or because you have disabled the initial flow which communicates this information.

Returns:
Remote Gateway Locale

getGatewayOs

public java.lang.String getGatewayOs()
Returns a string containing the JVM platform, architecture and version.

The Gateway JVM may be unknown because you have yet to open the Gateway, or because you have disabled the initial flow which communicates this information.

Returns:
Remote Gateway JVM details

© Copyright IBM Corp. 1994, 1999