Adding an terminal

There are two ways to construct an extended terminal:
Default terminal constructor

To create a terminal using the default constructor, first instantiate a terminal, and then use the appropriate set methods on that object. As with the basic terminal, only the setGateway method is mandatory. The setDeviceType, setNetName, setSession and setServer methods are optional as are the methods that set the extended terminal properties. The following setters define the properties for the extended terminal. Using any of these setters implies that you are creating an extended terminal:

  • setSignonCapability (Default = sign-on capable, but see Specifying terminal Sign-on Capability)
  • setUserid (Default = null)
  • setPassword (Default = null)
  • setReadTimeout (Default = 0)
  • setEncoding (Default = null)
  • setInstallTimeout (Default = 0)
try {
    EPIGateway eGate = new EPIGateway("tcp://MyGateway",2006);
    Terminal term = new Terminal();
    term.setGateway(eGate);
    term.setServerName("CICS1");
    term.setSignonCapability(Terminal.EPI_SIGNON_INCAPABLE);
    term.setUserid(userid);
    term.setPassword(password);
    term.connect();
}
catch (IOException ioEx) {
    ioEx.printStackTrace();
}
catch (EPIException epiEx) {
    epiEx.printStackTrace();
}

After you have defined your terminal, you can use the connect method to install it on CICS® (see Installing a terminal on CICS).

Extended terminal constructor

The extended terminal constructor sets all required properties at construction time:

try {
    EPIGateway eGate = new EPIGateway("tcp://MyGateway",2006);
    Terminal term = new Terminal(eGate, "CICS1", null, null,
                                 Terminal.EPI_SIGNON_INCAPABLE, userid, 
                                 password,0, null);
    term.connect();
}
catch (IOException ioEx) {
    ioEx.printStackTrace();
}
catch (EPIException epiEx) {
    epiEx.printStackTrace();
}

Unlike the basic terminal constructor the extended terminal constructor does not automatically install the terminal on CICS. This must be done explicitly using one of the connect methods described below.