com.ibm.ctg.epi

Class 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.
    • 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, 2013
Legal