com.ibm.ctg.epi
Class EPIGateway
java.lang.Object
|
+--com.ibm.ctg.client.JavaGateway
|
+--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("buster.hursley.ibm.com", 2006 );
// List all available CICS servers
for ( int i=1; i<= epi.serverCount(); i++ )
System.out.println( epi.serverName(i) + " " +
epi.serverDesc(i) );
Field Summary |
(package private) EPIRequest |
request
EPIRequest used to query the available servers |
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. |
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,
getURL,
isInitialFlow,
isOpen,
setAddress,
setInitialFlow,
setPort,
setProtocol,
setSecurity,
setURL |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
request
EPIRequest request
- EPIRequest used to query the available servers
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.
- Parameters:
address
- the address of the Gatewayport
- the port number being used by the Gateway- Throws:
- java.io.IOException - if an error occurs while connecting to the gateway
open
public void open()
throws java.io.IOException
- Opens the Gateway.
- Throws:
- java.io.IOException - if an error occurs while connecting to the gateway
- Overrides:
- open in class JavaGateway
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- 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- Returns:
- the description of the server
- Throws:
- java.io.IOException - if an error occurs while connecting to the gateway
- EPIException - if the request fails