com.ibm.ctg.epi

Class EPITerminal

  • java.lang.Object
    • com.ibm.ctg.epi.EPITerminal
  • All Implemented Interfaces:
    Session, TerminalSession, java.awt.event.ActionListener, java.io.Serializable, java.lang.Runnable, java.util.EventListener


    public class EPITerminal
    extends java.lang.Object
    implements Session, TerminalSession, java.lang.Runnable, java.awt.event.ActionListener, java.io.Serializable
    A Java bean that represents a connection to a CICS 3270 terminal.
    • Constructor Summary

      Constructors 
      Constructor and Description
      EPITerminal()
      Constructs an EPITerminal with a default URL of the current host and port 2006.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void actionPerformed(java.awt.event.ActionEvent evt)
      Reacts to an action event by starting a transaction - the action command associated with the event is assumed to be the transaction name.
      void addTerminalEventListener(TerminalEventListener h)
      Adds a TerminalEventListener to the list of screen handlers.
      EPISecurityAttrs changePassword(java.lang.String newPass)
      Allows modification of the password for a given userid and current password with the External Security Manager
      void connect()
      Connects to the CICS server.
      void connect(int installTimeout)
      Connects to the CICS server.
      void disconnect()
      Disconnects from the CICS server.
      java.lang.String getGatewayClientSecurity()
      Returns the name of the client security class that the CICS Transaction Gateway will use.
      java.lang.String getGatewayServerSecurity()
      Returns the name of the server security class that the CICS Transaction Gateway will use.
      java.lang.String getGatewayURL()
      Returns the URL of the CICS Transaction Gateway that the terminal will connect to.
      java.lang.String getPassword()
      Returns the password associated with the terminal, or null if the password is null or the terminal is a basic terminal.
      Screen getScreen()
      Returns the Screen object associated with this terminal.
      int getState()
      Returns the terminal state.
      int getSyncType()
      Returns the type of synchronization the terminal is using.
      java.lang.String getTermid()
      Returns the terminal id associated with the terminal.
      TerminalInterface getTerminal()
      Returns the terminal that will be used to connect to CICS..
      long getTimeout()
      Returns the terminal timeout.
      java.lang.String getTransaction()
      Returns the transaction that will be started if startTran is called.
      java.lang.String getTransactionData()
      Returns the parameters that will be passed when startTran is called.
      java.lang.String getUserid()
      Returns the userid associated with the terminal, or null if the userid is null or the terminal is a basic terminal.
      void handleException(TerminalInterface term, java.lang.Exception e)
      Handles an exception received from the Terminal class is in the right state.
      void handleReply(TerminalInterface term)
      Handles a reply from CICS by sending handleScreen events to all listeners if the terminal is in the right state.
      boolean isATI()
      Returns true if ATI is currently enabled for this terminal.
      boolean isConnected()
      Returns true if the terminal is connected to CICS.
      boolean queryATI()
      Determines whether ATI is currently enabled for this terminal.
      void removeTerminalEventListener(TerminalEventListener h)
      Removes a TerminalEventListener from the list of screen handlers.
      void send()
      Sends the current screen to CICS.
      void send(java.lang.String tran, java.lang.String data)
      Starts a new transaction.
      void setATI(boolean on)
      Sets the Terminal ATI state.
      void setGatewayClientSecurity(java.lang.String classname)
      Sets the client security class that the CICS Transaction Gateway will use (If the terminal is connected, this change does not affect it).
      void setGatewayServerSecurity(java.lang.String classname)
      Sets the server security class that the CICS Transaction Gateway will use (If the terminal is connected, this change has no effect).
      void setGatewayURL(java.lang.String url)
      Set the URL of the CICS Transaction Gateway to connect to (If already connected, this change has no effect).
      void setPassword(java.lang.String password)
      Sets the password associated with the terminal.
      void setTerminal(TerminalInterface t)
      Sets the terminal that will be used to connect to CICS (Disconnect and reconnect for this change to take effect).
      void setTimeout(long t)
      Sets the terminal timeout.
      void setTransaction(java.lang.String t)
      Sets the transaction to be started when startTran is called.
      void setTransactionData(java.lang.String d)
      Sets the parameters to pass when startTran is called.
      void setUserid(java.lang.String newUserid)
      Sets the userid associated with the terminal.
      void startTran()
      Starts a transaction on the terminal, using the current transaction ID and data.
      void terminate()
      Waits for the terminal to finish disconnecting and then closes the connection to the CICS Transaction Gateway.
      EPISecurityAttrs verifyPassword()
      Verifies the userid and password with the External Security Manager
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • EPITerminal

        public EPITerminal()
        Constructs an EPITerminal with a default URL of the current host and port 2006.
    • Method Detail

      • terminate

        public void terminate()
        Waits for the terminal to finish disconnecting and then closes the connection to the CICS Transaction Gateway.
      • connect

        public void connect()
        Connects to the CICS server.
        Specified by:
        connect in interface TerminalSession
      • connect

        public void connect(int installTimeout)
        Connects to the CICS server.
        Specified by:
        connect in interface TerminalSession
        Parameters:
        installTimeout - timeout for the connect request
      • disconnect

        public void disconnect()
        Disconnects from the CICS server.
        Specified by:
        disconnect in interface TerminalSession
      • setTransaction

        public void setTransaction(java.lang.String t)
        Sets the transaction to be started when startTran is called.
        Parameters:
        t - the transaction ID.
      • getTransaction

        public java.lang.String getTransaction()
        Returns the transaction that will be started if startTran is called.
        Returns:
        the transaction ID.
      • setTransactionData

        public void setTransactionData(java.lang.String d)
        Sets the parameters to pass when startTran is called.
        Parameters:
        d - the parameters
      • getTransactionData

        public java.lang.String getTransactionData()
        Returns the parameters that will be passed when startTran is called.
        Returns:
        the parameters
      • setTerminal

        public void setTerminal(TerminalInterface t)
        Sets the terminal that will be used to connect to CICS (Disconnect and reconnect for this change to take effect).
        Parameters:
        t - the terminal to use
      • getTerminal

        public TerminalInterface getTerminal()
        Returns the terminal that will be used to connect to CICS..
        Returns:
        the terminal object
      • setGatewayURL

        public void setGatewayURL(java.lang.String url)
        Set the URL of the CICS Transaction Gateway to connect to (If already connected, this change has no effect).
        Parameters:
        url - the URL of the gateway
      • getGatewayURL

        public java.lang.String getGatewayURL()
        Returns the URL of the CICS Transaction Gateway that the terminal will connect to.
        Returns:
        the URL of the gateway
      • setGatewayClientSecurity

        public void setGatewayClientSecurity(java.lang.String classname)
        Sets the client security class that the CICS Transaction Gateway will use (If the terminal is connected, this change does not affect it).
        Parameters:
        classname - the name of the security class
      • getGatewayClientSecurity

        public java.lang.String getGatewayClientSecurity()
        Returns the name of the client security class that the CICS Transaction Gateway will use.
        Returns:
        the name of the security class
      • setGatewayServerSecurity

        public void setGatewayServerSecurity(java.lang.String classname)
        Sets the server security class that the CICS Transaction Gateway will use (If the terminal is connected, this change has no effect).
        Parameters:
        classname - the name of the security class
      • getGatewayServerSecurity

        public java.lang.String getGatewayServerSecurity()
        Returns the name of the server security class that the CICS Transaction Gateway will use.
        Returns:
        the name of the security class
      • setTimeout

        public void setTimeout(long t)
        Sets the terminal timeout. If the terminal is idle for longer than this period, it will disconnect itself. A timeout of zero or a negative timeout is considered no timeout.
        Parameters:
        t - the timeout in milliseconds
      • getTimeout

        public long getTimeout()
        Returns the terminal timeout. If the terminal is idle for longer than this period, it will disconnect itself. A timeout of zero or a negative timeout is considered no timeout.
        Returns:
        the timeout in milliseconds
      • isConnected

        public boolean isConnected()
        Returns true if the terminal is connected to CICS.
        Returns:
        true if connected, false otherwise
      • startTran

        public void startTran()
        Starts a transaction on the terminal, using the current transaction ID and data.
      • getScreen

        public Screen getScreen()
        Returns the Screen object associated with this terminal.
        Specified by:
        getScreen in interface TerminalSession
        Returns:
        the screen, or null if not connected.
      • send

        public void send()
        Sends the current screen to CICS.
        Specified by:
        send in interface TerminalSession
      • send

        public void send(java.lang.String tran,
                java.lang.String data)
        Starts a new transaction.
        Specified by:
        send in interface TerminalSession
        Parameters:
        tran - a transaction ID
        data - parameters to pass to the transaction
      • queryATI

        public boolean queryATI()
        Determines whether ATI is currently enabled for this terminal.
        Specified by:
        queryATI in interface TerminalSession
        Returns:
        true if ATI is currently enabled
      • setATI

        public void setATI(boolean on)
        Sets the Terminal ATI state.
        Specified by:
        setATI in interface TerminalSession
        Parameters:
        on - true to set ATI enabled
      • isATI

        public boolean isATI()
        Returns true if ATI is currently enabled for this terminal.
        Returns:
        true if ATI is enabled
      • getTermid

        public java.lang.String getTermid()
        Returns the terminal id associated with the terminal.
        Specified by:
        getTermid in interface TerminalSession
        Returns:
        the terminal id
      • setUserid

        public void setUserid(java.lang.String newUserid)
        Sets the userid associated with the terminal. This will not take effect until another send is called or the terminal is connected.

        Invoking this method automatically flags the terminal as an extended type of terminal supporting the terminal features

        Specified by:
        setUserid in interface TerminalSession
        Parameters:
        newUserid - the userid.
      • setPassword

        public void setPassword(java.lang.String password)
        Sets the password associated with the terminal. This will not take effect until another send is called or the terminal is connected

        Invoking this method automatically flags the terminal as an extended type of terminal supporting the terminal features

        Specified by:
        setPassword in interface TerminalSession
        Parameters:
        password - the password.
      • getUserid

        public java.lang.String getUserid()
        Returns the userid associated with the terminal, or null if the userid is null or the terminal is a basic terminal.
        Specified by:
        getUserid in interface TerminalSession
        Returns:
        the userid.
      • getPassword

        public java.lang.String getPassword()
        Returns the password associated with the terminal, or null if the password is null or the terminal is a basic terminal.
        Specified by:
        getPassword in interface TerminalSession
        Returns:
        the password.
      • actionPerformed

        public void actionPerformed(java.awt.event.ActionEvent evt)
        Reacts to an action event by starting a transaction - the action command associated with the event is assumed to be the transaction name. This method may be used to make a button push or menu selection trigger the start of a transaction.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        evt - the action event
      • addTerminalEventListener

        public void addTerminalEventListener(TerminalEventListener h)
        Adds a TerminalEventListener to the list of screen handlers. When an event occurs, such as the arrival of a screen of data from CICS, all the event listeners are notified.
        Parameters:
        h - the event listener
      • removeTerminalEventListener

        public void removeTerminalEventListener(TerminalEventListener h)
        Removes a TerminalEventListener from the list of screen handlers.
        Parameters:
        h - the event listener
      • getSyncType

        public int getSyncType()
        Returns the type of synchronization the terminal is using.
        Specified by:
        getSyncType in interface Session
        Returns:
        the synchronization type
      • handleException

        public void handleException(TerminalInterface term,
                           java.lang.Exception e)
        Handles an exception received from the Terminal class is in the right state.
        Parameters:
        term - the terminal object where the state has changed
      • handleReply

        public void handleReply(TerminalInterface term)
        Handles a reply from CICS by sending handleScreen events to all listeners if the terminal is in the right state.
        Specified by:
        handleReply in interface Session
        Parameters:
        term - the terminal object where the state has changed
      • getState

        public int getState()
        Returns the terminal state.
        Specified by:
        getState in interface TerminalSession
        Returns:
        the terminal state, or discon if not connected
©Copyright IBM Corp. 1994, 2013
Legal