CICS® Transaction Gateway Programming Reference v1.1.0.0

com.ibm.ctg.epi
Class EPIGateway

java.lang.Object
  extended by com.ibm.ctg.client.JavaGateway
      extended by com.ibm.ctg.epi.EPIGateway

public class EPIGateway
extends JavaGateway

This class extends JavaGateway to provide some EPI specific behaviour. In particular, you can use this class to find out what servers are available.

The methods serverCount, serverName and serverDesc do not query the CICS Transaction Gateway each time they are called. The first use of one of these methods will obtain the list of available servers from the gateway, and subsequent calls will use the same information.

This class can be used wherever a JavaGateway is required.

Example

  import com.ibm.ctg.epi.*;   // EPI classes
   ...
  // Connect to the CICS Transaction Gateway
  EPIGateway epi = new EPIGateway("myserver.company.com", 2006 );

  // List all available CICS servers
  for ( int i=1; i<= epi.serverCount(); i++ )
      System.out.println( epi.serverName(i) + " " +
                         epi.serverDesc(i) );
 
Notice that in the code above the index begins at 1.


Field Summary
 
Fields inherited from class com.ibm.ctg.client.JavaGateway
LOCAL_PROP_APPLID, LOCAL_PROP_APPLID_QUALIFIER, MCF_TOKEN, SSL_PROP_CIPHER_SUITES, SSL_PROP_KEYRING_CLASS, SSL_PROP_KEYRING_PW
 
Constructor Summary
EPIGateway()
          Constructs an EPIGateway.
EPIGateway(java.lang.String address, int port)
          Constructs an EPIGateway to a CICS Transaction Gateway at the specified address and port and opens the gateway.
 
Method Summary
 void open()
          Opens the Gateway.
 int serverCount()
          Returns the number of servers available for use.
 java.lang.String serverDesc(int i)
          Returns the description of the server at the specified index in the list of available servers.
 java.lang.String serverName(int i)
          Returns the name of the server at the specified index in the list of available servers.
 
Methods inherited from class com.ibm.ctg.client.JavaGateway
close, flow, getAddress, getGatewayLocale, getGatewayOs, getPort, getProtocol, getProtocolProperties, getRequestExits, getSocketConnectTimeout, getURL, isInitialFlow, isLocal, isOpen, setAddress, setInitialFlow, setPort, setProtocol, setProtocolProperties, setRequestExits, setSecurity, setSocketConnectTimeout, setURL
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPIGateway

public EPIGateway()
Constructs an EPIGateway.


EPIGateway

public EPIGateway(java.lang.String address,
                  int port)
           throws java.io.IOException
Constructs an EPIGateway to a CICS Transaction Gateway at the specified address and port and opens the gateway.

Parameters:
address - the address of the Gateway
port - the port number being used by the Gateway
Throws:
java.io.IOException - if an error occurs while connecting to the gateway
Method Detail

open

public void open()
          throws java.io.IOException
Opens the Gateway.

Overrides:
open in class JavaGateway
Throws:
java.io.IOException - if an error occurs while connecting to the gateway

serverCount

public int serverCount()
                throws java.io.IOException,
                       EPIException
Returns the number of servers available for use.

Returns:
the number of servers
Throws:
java.io.IOException - if an error occurs while connecting to the gateway
EPIException - if the request fails

serverName

public java.lang.String serverName(int i)
                            throws java.io.IOException,
                                   EPIException
Returns the name of the server at the specified index in the list of available servers. The servers are numbered from 1.

Parameters:
i - the index of the server. Note that the index begins at 1.
Returns:
the name of the server
Throws:
java.io.IOException - if an error occurs while connecting to the gateway
EPIException - if the request fails

serverDesc

public java.lang.String serverDesc(int i)
                            throws java.io.IOException,
                                   EPIException
Returns the description of the server at the specified index in the list of available servers. The servers are numbered from 1.

Parameters:
i - the index of the server. Note that the index begins at 1.
Returns:
the description of the server
Throws:
java.io.IOException - if an error occurs while connecting to the gateway
EPIException - if the request fails

©Copyright IBM Corp. 1994, 2014
Legal