Sun Adapter for CICS API

com.stc.eways.cics
Class CicsClientImpl

java.lang.Object
  extended by com.stc.eways.cics.CicsClientImpl
All Implemented Interfaces:
CicsClient, SBYNDCicsProxyConstants
Direct Known Subclasses:
CicsClientExtImpl

public class CicsClientImpl
extends java.lang.Object
implements CicsClient, SBYNDCicsProxyConstants

The CicsClient class represents an OTD through which a collaboration can invoke transaction programs on a CICS server; nodes and methods are exposed so that collaboration can conveniently prepare a request to a CICS program and invoke the program and get result from the program; in the current implementation, there are two underlying transport mechanism can be used to achieve the remote invoking of CICS programs: (1) CTG - IBM's CICS Transaction Gateway (2) SBYND CICS Listener - SeeBeyond CICS Listener - a light weighted propritary protocol based on TCP/IP; note that, the configuration parameters can be roughly categorized into : CTG specific; SBYND CICS Listener specific; Needed for both CTG and SBYND CICS Listener; Also, the exposed CicsClient methods are categorized as: CTG specific, such as getServerList(); SBYND CICS Listener specific, such as prepareAPCRecord(), returnCodeIs(), returnOK(), getResponse(...) etc.; Common to both CTG and SBYND CICS Listener, such as execute(), execute(....), and sendRequest(...);


Field Summary
protected  SBYNDCicsProxy _SBYNDCicsProxy
           
protected  SBYNDCicsProxyConfig _SBYNDCicsProxyConfig
           
protected  boolean eciExtend
           
protected  boolean eciSync
           
protected  com.stc.connector.logging.Logger logger
           
protected  boolean manualConnect
           
protected  com.stc.connector.framework.util.ConfigurationHelper mConfiguration
           
protected  java.lang.String password
           
protected  int port
           
protected  java.lang.String program
           
protected  java.lang.String server
           
protected  java.lang.String sslClass
           
protected  java.lang.String sslPassword
           
protected  int traceDumpOffset
           
protected  java.lang.String traceFilename
           
protected  int traceLevel
           
protected  boolean traceTiming
           
protected  int traceTruncationSize
           
protected  java.lang.String url
           
protected  java.lang.String userId
           
 
Fields inherited from interface com.stc.eways.cics.SBYNDCicsProxyConstants
CALL_ERROR, CALL_OK, CICSLSTNR_ASYNC_RSP_MSG_PROP_COMMLEN, CICSLSTNR_ASYNC_RSP_MSG_PROP_MSG, CICSLSTNR_ASYNC_RSP_MSG_PROP_PROGRAM, CICSLSTNR_ASYNC_RSP_MSG_PROP_RC, CICSLSTNR_ASYNC_RSP_MSG_PROP_RETURNTIME, CICSLSTNR_ASYNC_RSP_MSG_PROP_SC, CICSLSTNR_ASYNC_RSP_MSG_PROP_STARTTIME, CICSLSTNR_ASYNC_RSP_MSG_PROP_TOPIC, CICSLSTNR_C_ACR_OFFSET_APPL_TIMEOUT, CICSLSTNR_C_ACR_OFFSET_COMM_LEN, CICSLSTNR_C_ACR_OFFSET_HEADER, CICSLSTNR_C_ACR_OFFSET_PADCHAR, CICSLSTNR_C_ACR_OFFSET_PASSWORD, CICSLSTNR_C_ACR_OFFSET_PAYLOAD_LEN, CICSLSTNR_C_ACR_OFFSET_PROGNAME, CICSLSTNR_C_ACR_OFFSET_RC, CICSLSTNR_C_ACR_OFFSET_REQCODE, CICSLSTNR_C_ACR_OFFSET_RM, CICSLSTNR_C_ACR_OFFSET_USERID, CICSLSTNR_C_BUFFER_SIZE, CICSLSTNR_C_CONTROLRECORD_ENCODING, CICSLSTNR_C_IC_RECORD_DELIMITER, CICSLSTNR_C_IC_RECORD_SIZE, CICSLSTNR_C_ICR_OFFSET_APPL_TIMEOUT, CICSLSTNR_C_ICR_OFFSET_FILLER, CICSLSTNR_C_ICR_OFFSET_LISTENER_TIMEOUT, CICSLSTNR_C_ICR_OFFSET_PASSWD, CICSLSTNR_C_ICR_OFFSET_PAYLOAD_DELIMETER, CICSLSTNR_C_ICR_OFFSET_POLLING_RATE, CICSLSTNR_C_ICR_OFFSET_STARTUP_DELAY, CICSLSTNR_C_ICR_OFFSET_STARTUP_TYPE, CICSLSTNR_C_ICR_OFFSET_STARTUP_TYPE_DELIMETER, CICSLSTNR_C_ICR_OFFSET_TRANSID, CICSLSTNR_C_ICR_OFFSET_TRANSID_DELIMETER, CICSLSTNR_C_ICR_OFFSET_TRANSPORT_TIMEOUT, CICSLSTNR_C_ICR_OFFSET_USERID, CICSLSTNR_C_MIN_ACR_HEADER_SIZE, CICSLSTNR_C_SEEBEYOND_LISTENER, CICSLSTNR_C_SPACE, CICSLSTNR_C_TRANSACTION_GATEWAY, CICSLSTNR_E_ACR_INCONSISTENT, CICSLSTNR_E_ACR_LEN_SHORTER_THAN_MIN_ACR_LEN, CICSLSTNR_E_ASYNCCALL_LIST_NOT_AVAILABLE, CICSLSTNR_E_ASYNCCALL_NOT_AVAILABLE, CICSLSTNR_E_ASYNCCALLHANDLER_REQUIRED, CICSLSTNR_E_BYTESAVAILABLE, CICSLSTNR_E_CICS_SERVER_REQUIRED, CICSLSTNR_E_CLIENT_NOT_CONNECTED, CICSLSTNR_E_CLOSE_SOCKET, CICSLSTNR_E_CONFIG_CLONE_NOT_AVAILABLE_ASYNC_EXECUTE, CICSLSTNR_E_CONFIG_INVALID_PARAM, CICSLSTNR_E_CONNECT_BAD_RESPONSE, CICSLSTNR_E_CONNECT_FAILED_EMPTY_TRANSID, CICSLSTNR_E_CONNECT_FAILED_GEN_INITREC_ERROR, CICSLSTNR_E_CONNECT_FAILED_INVALID_TRANSID, CICSLSTNR_E_CONNECT_GET_NACK_FROM_LISTENER, CICSLSTNR_E_CONNECT_UNEXPECTED_RESPONSE, CICSLSTNR_E_CONNECTION, CICSLSTNR_E_CTG_GATEWAY_ERROR, CICSLSTNR_E_DISCONNECT_FAILED, CICSLSTNR_E_ETD_INSTANCE_NOT_AVAILABLE_WHEN_CHECK_CONN, CICSLSTNR_E_ETD_INSTANCE_NOT_AVAILABLE_WHEN_CLOSE_CONN, CICSLSTNR_E_ETD_INSTANCE_NOT_AVAILABLE_WHEN_OPEN_CONN, CICSLSTNR_E_EXCEPTION_REMOVING_ASYNCCALL, CICSLSTNR_E_EXECUTE_BAD_RESPONSE, CICSLSTNR_E_EXECUTE_BAD_RESULT, CICSLSTNR_E_EXECUTE_GET_RESULT, CICSLSTNR_E_EXECUTE_REQ_NACKED, CICSLSTNR_E_EXECUTE_TIMEOUT, CICSLSTNR_E_EXECUTE_UNEXPECTED_RESPONSE, CICSLSTNR_E_EXPECTING_LSTNR_RSP4SHUTDOWN, CICSLSTNR_E_FAILED_RECV_LSTNR_RSP4SHUTDOWN, CICSLSTNR_E_INVALID_ACR_LENGTH_HEADER, CICSLSTNR_E_INVALID_ACR_PAYLOADLEN, CICSLSTNR_E_INVALID_COMMAREA_LENGTH, CICSLSTNR_E_INVALID_CONNECTOR_TYPE, CICSLSTNR_E_INVALID_OPERATION, CICSLSTNR_E_INVALID_OPERATION_4_CTG, CICSLSTNR_E_INVALID_OPERATION_4_LISTENER, CICSLSTNR_E_INVALID_OPERATION_ON_INBOUND_RECORD, CICSLSTNR_E_INVALID_PADCHAR, CICSLSTNR_E_INVALID_REQUEST_CODE, CICSLSTNR_E_INVALID_RETURN_CODE, CICSLSTNR_E_INVALID_TIMEOUT, CICSLSTNR_E_ITERATOR_NOT_AVAILABLE_WHEN_INVOKE, CICSLSTNR_E_MISSING_PROGNAME_WHEN_PREPARE_ACR, CICSLSTNR_E_PROGRAM_REQUIRED, CICSLSTNR_E_RECEV_RESPONSE_SOCKETEXCEPTION, CICSLSTNR_E_RECEV_RESPONSE_TIMEOUT, CICSLSTNR_E_RECV, CICSLSTNR_E_REMOVE_ASYNCCALL_OUTSTANDING, CICSLSTNR_E_SEND, CICSLSTNR_E_SENDREQUEST_PAYLOAD_LENGTH_CHANGED, CICSLSTNR_E_UNEXPECTED_RECORD, CICSLSTNR_PARAM_CONN_TRANSPORT, CICSLSTNR_PARAM_HOST, CICSLSTNR_PARAM_KEEPALIVE, CICSLSTNR_PARAM_LISTENERTIMEOUT, CICSLSTNR_PARAM_NODELAY, CICSLSTNR_PARAM_PADCHAR, CICSLSTNR_PARAM_POLLINGRATE, CICSLSTNR_PARAM_PORT, CICSLSTNR_PARAM_RECVBUFSIZE, CICSLSTNR_PARAM_SBYNDLISTENER_TRANSID, CICSLSTNR_PARAM_SENDBUFSIZE, CICSLSTNR_PARAM_STARTDELAY, CICSLSTNR_PARAM_STARTTYPE, CICSLSTNR_PARAM_TPTIMEOUT, CICSLSTNR_PARAM_TRANSPORTTIMEOUT, CICSLSTNR_T_CHECK_CONNECTION, CICSLSTNR_T_CONNECT_ALREADY, CICSLSTNR_T_CONNECT_ATTEMPTED, CICSLSTNR_T_CONNECT_DONE, CICSLSTNR_T_CONNECTION_ESTABLISH_FAILED, CICSLSTNR_T_CONNECTION_REUSE, CICSLSTNR_T_EMPTY_ENCODING_DEF_ASSUMED, CICSLSTNR_T_EXECUTE_ASYNC_CALL_RESPONSED_WITH_OK, CICSLSTNR_T_RECV_MSG_EOF, CICSLSTNR_T_RECV_MSG_OK, CICSLSTNR_T_RECV_MSG_PARTIAL, CICSLSTNR_T_RECV_MSG_TIMEOUT, CICSLSTNR_T_REMOVED_ASYNCCALL, CICSLSTNR_T_REMOVING_ASYNCCALL, CICSLSTNR_T_SHUTDOWN_LISTNER_OK, CICSLSTNR_T_SHUTDOWN_LISTNER_RSP_WITH_ERROR, messages, SBYND_LISTENER_RC_AUTHENTICATION_FAILURE, SBYND_LISTENER_RC_BAD_COMMAREA, SBYND_LISTENER_RC_CANNOT_GET_INIT_PARAM, SBYND_LISTENER_RC_ERR_SET_NON_BLOCKING, SBYND_LISTENER_RC_INIT_ERR_STARTUP_TYPE_IC, SBYND_LISTENER_RC_INIT_ERR_STARTUP_TYPE_TD, SBYND_LISTENER_RC_INVALID_APPL_TIMEOUT, SBYND_LISTENER_RC_INVALID_CA_LENGTH, SBYND_LISTENER_RC_INVALID_LISTENER_TIMEOUT, SBYND_LISTENER_RC_INVALID_MSG_LENGTH, SBYND_LISTENER_RC_INVALID_PROGNAME, SBYND_LISTENER_RC_INVALID_REQCODE, SBYND_LISTENER_RC_INVALID_RSPCODE, SBYND_LISTENER_RC_INVALID_TRANSPORT_TIMEOUT, SBYND_LISTENER_RC_OK, SBYND_LISTENER_RC_PARTIAL_MSG, SBYND_LISTENER_RC_PASSWD_ENCRYPT_ERROR, SBYND_LISTENER_RC_PROG_LINK_ERROR, SBYND_LISTENER_RC_TRANS_START_ERROR, SBYND_LISTENER_REQCODE_DESC_LSTNR_RETURN4SYNC, SBYND_LISTENER_REQCODE_DESC_LSTNR_RSP4ASYNC, SBYND_LISTENER_REQCODE_DESC_LSTNR_RSP4ASYNCSTART, SBYND_LISTENER_REQCODE_DESC_LSTNR_RSP4INIT, SBYND_LISTENER_REQCODE_DESC_LSTNR_RSP4SHUTDOWN, SBYND_LISTENER_REQCODE_DESC_LSTNR_RSP4SYNC, SBYND_LISTENER_REQCODE_DESC_REQ_ASYNC, SBYND_LISTENER_REQCODE_DESC_REQ_SYNC, SBYND_LISTENER_REQCODE_DESC_REQ4SHUTDOWN, SBYND_LISTENER_REQCODE_DESC_REQISCONNECTED, SBYND_LISTENER_REQCODE_DESC_RSP4ASYNCLINKRSP, SBYND_LISTENER_REQCODE_DESC_RSP4RETURN, SBYND_LISTENER_REQCODE_LSTNR_RETURN4SYNC, SBYND_LISTENER_REQCODE_LSTNR_RSP4ASYNC, SBYND_LISTENER_REQCODE_LSTNR_RSP4ASYNCSTART, SBYND_LISTENER_REQCODE_LSTNR_RSP4INIT, SBYND_LISTENER_REQCODE_LSTNR_RSP4SHUTDOWN, SBYND_LISTENER_REQCODE_LSTNR_RSP4SYNC, SBYND_LISTENER_REQCODE_LSTNR_RSPISCONNECTED, SBYND_LISTENER_REQCODE_REQ_ASYNC, SBYND_LISTENER_REQCODE_REQ_SYNC, SBYND_LISTENER_REQCODE_REQ4SHUTDOWN, SBYND_LISTENER_REQCODE_REQISCONNECTED, SBYND_LISTENER_REQCODE_RSP4ASYNCLINKRSP, SBYND_LISTENER_REQCODE_RSP4RETURN
 
Constructor Summary
CicsClientImpl(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
          CicsClient constructor
 
Method Summary
 PackedDecimal commAreaToPackedDecimal(int offset, int intSize, int decSize)
          Build a packed decimal from the payload in CommArea section specified by (offset, intSize, decSize)
 java.lang.String commAreaZonedToString(int offset, int length)
          Convert the zoned decimal (COBOL PIC S9) byte array CommArea field to a String using current value of CicsClient Encoding as encoding;
 java.lang.String commAreaZonedToString(int offset, int length, java.lang.String enc)
          Convert the zoned decimal (COBOL PIC S9) byte array CommArea field to a String;
 void connect()
          Establish a connection to the CICS server and subsequently, the collaboration can flow request (CICS program calls) to the server across the connection;
protected  void copyParams()
           
 void disconnect()
          Disconnect the connection established through connect();
 void execute()
          For SBYND CICS Listner:
 void execute(boolean eciSynCall, java.lang.String cicsServerName, java.lang.String cicsUserId, java.lang.String cicsPassword, java.lang.String cicsProgram, java.lang.String cicsTransId, byte[] byteArray, int length, boolean eciExtendMode, int eciLUWToken, int msgQualifier, java.lang.Object asyncCallHandler)
          For compatibility if eciTPN is not in the parameter list, set it to false
 void execute(boolean eciSynCall, java.lang.String cicsServerName, java.lang.String cicsUserId, java.lang.String cicsPassword, java.lang.String cicsProgram, java.lang.String cicsTransId, byte[] byteArray, int length, boolean eciExtendMode, int eciLUWToken, int msgQualifier, java.lang.Object asyncCallHandler, boolean eciTPN)
          For SBYND CICS Listner: invoke the remote CICS program through the following steps (defined by a propritary protocol) (1) prepare a APC record (Application Control Record) with request code as SBYND_LISTENER_REQCODE_REQ_SYNC or SBYND_LISTENER_REQCODE_REQ_ASYNC depend on parameter eciSynCall with byteArray as the payload; the prepare APC record is in the outbound buffer in SBYNDCicsProxy (2) send the request to SBYND CICS Listener; (3) get response from SBYND CICS Listener; (4) further get returned data from the program if it is a sync call (5) ACK or NACK accordingly For CTG: prepare an ECIRequest object with the data given via the parameters, call method flow() to send the request and get result (sync) or proceed (async);
protected  java.lang.String getAsyncResponseTopic()
          Getter for CicsClient node AsyncResponseTopic; Return the current value in CicsClient node AsyncResponseTopic, the topic is used by async call handler to publish the program completion information such as CommArea returned from the called program, error code and error text if there is any; initial value is from the configuration parameter Async Response Topic in section "CICS Client";
protected  int getAsyncRspNotifPort()
          Getter for CicsClient AsyncRspNotifPort; Return the current value in CicsClient AsyncRspNotifPort, the port is used by async call handler to publish the program completion information such as CommArea returned from the called program, error code and error text if there is any; initial value is from the configuration parameter Async Call JMS Server Port in section "CICS Client";
protected  java.lang.String getAsyncRspNotifServer()
          Getter for CicsClient node AsyncRspNotifServer; Return the current value in CicsClient node AsyncRspNotifServer, the host name is used by async call handler to publish the program completion information such as CommArea returned from the called program, error code and error text if there is any; initial value is from the configuration parameter Async Call JMS Server Host in section "CICS Client";
 byte[] getCommArea()
          Getter for CicsClient CommArea; Return the CommArea - i.e.
 int getCommAreaLength()
          Getter for CicsClient CommAreaLength; Return the CommAreaLength - i.e.
 java.lang.String getCommAreaString()
          Construct a commarea String by converting the commarea array of bytes using the platform's default character encoding.
 java.lang.String getCommAreaString(int offset, int length)
          Construct a commarea String by converting the commarea array of bytes with offset and length using the platform's default character encoding.
 java.lang.String getCommAreaString(int offset, int length, java.lang.String enc)
          Construct a commarea String by converting the commarea array of bytes with offset and length using the platform's default character encoding.
 java.lang.String getCommAreaString(java.lang.String enc)
          Construct a commarea String by converting the commarea array of bytes using the character encoding specified as an argument.
protected  java.lang.Object getEciCallbackable()
          Setter for CicsClient EciCallbackable;
 ECIErrorCodes getECIERRORS()
          CTG specific; Return ECIErrorCodes object; this getter is for CicsClient ECIERRORS;
 boolean getEciExtend()
          Getter for CicsClient EciExtend; Return the EciExtend flag (refer to CTG doc for detailed description of the flag) - i.e.
 int getEciLuwToken()
          Getter for CicsClient EciLuwToken; Return the ECI Luw token; - i.e.
 boolean getEciSync()
          Getter for CicsClient EciSync; Return the ECI call type - i.e.
 boolean getEciTPN()
          Getter for CicsClient eciTPN; Return the ECI Transid type CTG Only;
 java.lang.String getEncodedCommAreaString()
          Construct a commarea String by converting the commarea array of bytes using the character encoding specified earlier for the CicsClientException.
 java.lang.String getEncodedCommAreaString(int offset, int length)
          Construct a commarea String by converting the commarea array of bytes with offset and length using the platform's default character encoding.
 java.lang.String getEncoding()
          Getter for CicsClient Encoding; Return the encoding which can be used to translate the data to and from the CICS program - i.e.
protected static java.lang.String getHexString(byte[] byteArray)
           
 java.lang.String getHost()
          Getter for CicsClient Host; Return Host pointing to the Listener to connect to - i.e.
 int getListenerTimeout()
          SBYND CICS Listener specific; Getter for Listener time out - CicsClient ListenerTimeout initial value is from configuration parameter Listener Timeout in section "SeeBeyond CICS Listener";
 int getMessageQualifier()
          Getter for CicsClient MessageQualifier; Return the MessageQualifier for ECI call - i.e.
 java.lang.String getPaddingCharacter()
          SBYND CICS Listener specific; Getter for padding character - CicsClient PaddingCharacter initial value is from configuration parameter COMMAREA Padding Character in section "SeeBeyond CICS Listener";
 java.lang.String getPassword()
          Getter for CicsClient Password; Return the CICS user password - i.e.
 int getPollingRate()
          SBYND CICS Listener specific; Getter for Listener Polling Rate - CicsClient PollingRate initial value is from configuration parameter Polling Rate in section "SeeBeyond CICS Listener";
 int getPort()
          Getter for CicsClient Port; Return the port of the host where CTG gateway is to be connected to - i.e.
 java.lang.String getProgram()
          Getter for CicsClient Program; Return the CICS program name to be invoked; - i.e.
 java.lang.String getProgramName()
          SBYND CICS Listener specific; Return the program name of the response assuming a response is in the current inbound buffer; should be called immediately after getResponse();
 int getRequestCode()
          SBYND CICS Listener specific; Return the request code of the response assuming a response is in the current inbound buffer; should be called immediately after getResponse();
 SBYNDAppControlRecordRequestCodes getREQUESTCODES()
          SBYND CICS Listener specific; Return SBYNDAppControlRecordRequestCodes object; this getter is for CicsClient REQUESTCODES;
 java.lang.String getRequestDesc()
          SBYND CICS Listener specific; Return description for the request code assuming a response is in the current inbound buffer; should be called immediately after getResponse();
 boolean getResponse()
          SBYND CICS Listener specific; Read from the SBYND CICS Listener in blocking mode until timed out or get a response;
 boolean getResponse(int timeout)
          SBYND CICS Listener specific; Read from the SBYND CICS Listener in blocking mode until timed out or get a response;
 int getReturnCode()
          SBYND CICS Listener specific; Return the error code of the current response assuming a response is in the current inbound buffer; should be called immediately after getResponse();
 SBYNDAppControlRecordReturnCodes getRETURNCODES()
          SBYND CICS Listener specific; Return SBYNDAppControlRecordReturnCodes object; this getter is for CicsClient RETURNCODES;
 java.lang.String getReturnMessage()
          SBYND CICS Listener specific; Return the error text of the current response assuming a response is in the current inbound buffer; should be called immediately after getResponse();
 SBYNDCicsProxyConfig getSBYNDCicsProxyConfig()
          SBYND CICS Listener specific; Return the SBYND CICS Listener specific configuration parameters;
 java.lang.String getSBYNDListenerTransID()
          SBYND CICS Listener specific; Getter for SBYND CICS Listener TransID - CicsClient SBYNDListenerTransID initial value is from configuration parameter SeeBeyond CICS Listener TransId in section "SeeBeyond CICS Listener";
 java.lang.String getServer()
          Getter for CicsClient Server; Return CICS server name where the request is sent to - i.e.
 java.lang.String[] getServerList(int maxNumSystems)
          Obtain a list of CICS servers defined: name-description pairs With SBYND Listener as the transport, only one server is returned, i.e.
 java.lang.String getSslClass()
          Getter for CicsClient SslClass; Return the SSL class for SSL authentication - i.e.
 java.lang.String getSslPassword()
          Getter for CicsClient SslPassword; Return the PASSWORD for the encrypted KeyRing class; - i.e.
 java.lang.String getStartDelay()
          SBYND CICS Listener specific; Getter for Startup delay - CicsClient StartDelay initial value is from configuration parameter Start Delay in section "SeeBeyond CICS Listener";
 java.lang.String getStartType()
          SBYND CICS Listener specific; Getter for Startup type - CicsClient StartType initial value is from configuration parameter Start Type in section "SeeBeyond CICS Listener";
 int getTPTimeout()
          SBYND CICS Listener specific; Getter for CICS program time out - CicsClient TPTimeout initial value is from configuration parameter TP Timeout in section "SeeBeyond CICS Listener";
 int getTraceDumpOffset()
          Getter for CicsClient TraceDumpOffset; Return the trace dump offset for CTG client log; - i.e.
 java.lang.String getTraceFilename()
          Getter for CicsClient TraceFilename; Return the trace file name for CTG client log; - i.e.
 int getTraceLevel()
          Getter for CicsClient TraceLevel; Return the trace level for CTG client log; - i.e.
 boolean getTraceTiming()
          Getter for CicsClient TraceTiming; Return the trace timing (time stamp) in CTG client log; - i.e.
 int getTraceTruncationSize()
          Getter for CicsClient TraceTruncationSize; Return the trace truncation size for CTG client log; - i.e.
 java.lang.String getTransId()
          Getter for CicsClient TransId; Return the CICS transId to be invoked; - i.e.
 java.lang.String getTransport()
          Gets the Transport type (Listener or Gateway)
 int getTransportTimeout()
          SBYND CICS Listener specific; Getter for TransportTimeout - CicsClient TransportTimeout initial value is from configuration parameter Transport Timeout in section "SeeBeyond CICS Listener";
 java.lang.String getUrl()
          Getter for CicsClient Url; Return URL pointing to the remote or local CICS transaction gateway to connect to - i.e.
 java.lang.String getUserId()
          Getter for CicsClient UserId; Return the CICS user id - i.e.
 void handleTrace()
           
 void initialize()
          Initializes the OTD.
protected  void initProxy(boolean useListener)
           
 boolean isConnected()
          Check if the connection is good;
 java.lang.String packedDecimalToString(PackedDecimal pd)
          Get the string from a packed decimal object;
 void prepareAPCRecord(java.lang.String progname, int appltimeout, int requestcode, int errorcode, java.lang.String errortext)
          SBYND CICS Listener specific; Prepare an APC Record in outbound buffer of SBYNDCicsProxy using the parameters and this can be send out by invoking sendRequest() subsequently;
 boolean reset()
          Resets the data content of an CicsClientException.
 boolean returnCodeIs(int code)
          SBYND CICS Listener specific; check if the error code in the APC record is the same as code;
 boolean returnOK()
          SBYND CICS Listener specific; check if the error code in the APC record is SBYND_LISTENER_RC_OK;
 void sendRequest(java.lang.Object requestObj)
          For SBYND CICS Listner: Send an ACR to the listener, assuming ACR is properly prepared and is in outbound buffer; sendRequest() only send ACR, if a response is expected, need to call getResponse() sebsequently;
protected  void setAsyncResponseTopic(java.lang.String topic)
          Setter for CicsClient node AsyncResponseTopic; once is set, the value will be used by the subsequent async call such as execute() until it is set again to another value.
protected  void setAsyncRspNotifPort(int port)
          Setter for CicsClient AsyncRspNotifPort; once is set, the value will be used by the subsequent async call such as execute() for publishing async call completion event until it is set again to another value.
protected  void setAsyncRspNotifServer(java.lang.String server)
          Setter for CicsClient AsyncRspNotifServer; once is set, the value will be used by the subsequent async call such as execute() for publishing to the server with topic as indicated by the value in AsyncResponseTopic until it is set again to another value.
 void setCommArea(byte[] byteArray)
          Setter for CicsClient CommArea; set the payload into CommArea usually used by the subsequent program invoking;
 void setCommAreaLength(int i)
          Setter for CicsClient CommAreaLength; length of the CommArea; initial value is from the configuration parameter: COMMAREA Length;
protected  void setEciCallbackable(java.lang.Object handler)
          Setter for CicsClient EciCallbackable;
 void setEciExtend(boolean b)
          Setter for CicsClient EciExtend; Have effect for CTG only; Ignored by SBYND Listener - not implemented;
 void setEciLuwToken(int i)
          Setter for CicsClient EciLuwToken; An integer identifying a LUW; initial value is from the configuration parameter: ECI LUW token in section "CICS Client"; CTG specific;
 void setEciSync(boolean b)
          Setter for CicsClient EciSync; indicate if the call will be sync or async;
 void setEciTPN(boolean b)
          Setter for ETD node eciTPN; indicate if the transid will be interpreted as ECI_TPN;
 void setEncoding(java.lang.String s)
          Setter for CicsClient Encoding;
 void setHost(java.lang.String s)
          Setter for CicsClient Host; Set Host pointing to the Listener to connect to; Listener specific;
 void setListenerTimeout(int timeout)
          SBYND CICS Listener specific; Setter for Listener Timeout - CicsClient ListenerTimeout
 void setMessageQualifier(int i)
          Setter for CicsClient MessageQualifier; Have effect for CTG only; Ignored by SBYND Listener - not implemented;
 void setPaddingCharacter(java.lang.String padcharhex)
          SBYND CICS Listener specific; Setter for padding character - CicsClient PaddingCharacter
 void setPassword(java.lang.String s)
          Setter for CicsClient Password; the CICS password needed to authenticate the user when calling the CICS program;
 void setPollingRate(int rate)
          SBYND CICS Listener specific; Setter for Polling Rate - CicsClient PollingRate
 void setPort(int i)
          Setter for CicsClient Port; Set port of the host where the CTG is running; CTG specific;
 void setProgram(java.lang.String s)
          Setter for CicsClient Program; the CICS program to be called;
 void setSBYNDListenerTransID(java.lang.String transid)
          SBYND CICS Listener specific; Setter for SBYND CICS Listener TransID - CicsClient SBYNDListenerTransID
 void setServer(java.lang.String s)
          Setter for CicsClient Server;
 void setSslClass(java.lang.String s)
          Setter for CicsClient SslClass; CTG specific;
 void setSslPassword(java.lang.String s)
          Setter for CicsClient SslPassword; the PASSWORD for the encrypted KeyRing class; CTG specific;
 void setStartDelay(java.lang.String startdelay)
          SBYND CICS Listener specific; Setter for Startup delay - CicsClient StartDelay
 void setStartType(java.lang.String starttype)
          SBYND CICS Listener specific; Setter for Startup delay - CicsClient StartType
 void setTPTimeout(int timeout)
          SBYND CICS Listener specific; Setter for TP Timeout - CicsClient TPTimeout
 void setTraceDumpOffset(int i)
          Setter for CicsClient TraceDumpOffset;
 void setTraceFilename(java.lang.String s)
          Setter for CicsClient TraceFilename;
 void setTraceLevel(int i)
          Setter for CicsClient TraceLevel;
 void setTraceTiming(boolean b)
          Setter for CicsClient TraceTiming; CTG only;
 void setTraceTruncationSize(int i)
          Setter for CicsClient TraceTruncationSize;
 void setTransId(java.lang.String s)
          Setter for CicsClient Program; the CICS program's trans ID to be called;
 void setTransportTimeout(int timeout)
          SBYND CICS Listener specific; Setter for Transport Timeout - CicsClient TransportTimeout
 void setUrl(java.lang.String s)
          Setter for CicsClient Url; Set URL pointing to the remote or local CICS transaction gateway to connect to; CTG specific;
 void setUserId(java.lang.String s)
          Setter for CicsClient UserId;
 void terminate()
          Terminates the CicsClientException.
 PackedDecimal toPackedDecimal(java.lang.String number, int intSize, int decSize)
          Build a packed decimal from a string number Convert the in String +-99999.99 in an packed decimal IBM data Flow -> Each digit is a 0..9 Numerical value last digit is the sign digit : A|C|E|F => + ; B|D => - ; the decimal point is virtual its position is defined in the second byte of dec_length
 byte[] toZoned(java.lang.String number)
          Convert a number in the form of a String to zoned decimal (COBOL PIC S9) byte array using the current value of CicsClient Encoding as the encoding;
 byte[] toZoned(java.lang.String number, java.lang.String enc)
          Convert a number in the form of a String to zoned decimal (COBOL PIC S9) byte array using the encoding specified by the parameter enc;
 java.lang.String zonedToString(byte[] zoned)
          Convert the zoned decimal (COBOL PIC S9) byte array specified by zoned to a String using current value of CicsClient Encoding as encoding;
 java.lang.String zonedToString(byte[] zoned, java.lang.String enc)
          Convert the zoned decimal (COBOL PIC S9) byte array specified by zoned to a String using the specified encoding enc;
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_SBYNDCicsProxy

protected SBYNDCicsProxy _SBYNDCicsProxy

_SBYNDCicsProxyConfig

protected SBYNDCicsProxyConfig _SBYNDCicsProxyConfig

server

protected java.lang.String server

url

protected java.lang.String url

port

protected int port

sslClass

protected java.lang.String sslClass

sslPassword

protected java.lang.String sslPassword

userId

protected java.lang.String userId

password

protected java.lang.String password

eciSync

protected boolean eciSync

program

protected java.lang.String program

eciExtend

protected boolean eciExtend

traceLevel

protected int traceLevel

traceFilename

protected java.lang.String traceFilename

traceTruncationSize

protected int traceTruncationSize

traceDumpOffset

protected int traceDumpOffset

traceTiming

protected boolean traceTiming

mConfiguration

protected com.stc.connector.framework.util.ConfigurationHelper mConfiguration

logger

protected com.stc.connector.logging.Logger logger

manualConnect

protected boolean manualConnect
Constructor Detail

CicsClientImpl

public CicsClientImpl(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
               throws CicsClientException
CicsClient constructor

Parameters:
config - Properties bundle containing CICS specific connection information
Throws:
CicsClientException - upon error
Method Detail

initialize

public void initialize()
                throws CicsClientException
Initializes the OTD.

Throws:
CicsClientException - upon error.

getTransport

public java.lang.String getTransport()
Gets the Transport type (Listener or Gateway)

Specified by:
getTransport in interface CicsClient

getAsyncResponseTopic

protected java.lang.String getAsyncResponseTopic()
Getter for CicsClient node AsyncResponseTopic; Return the current value in CicsClient node AsyncResponseTopic, the topic is used by async call handler to publish the program completion information such as CommArea returned from the called program, error code and error text if there is any; initial value is from the configuration parameter Async Response Topic in section "CICS Client";

An empty string or null means no intension to publish the completion event to any topic; CTG & SBYND Listener;

Returns:
the topic; ===> Made private to disable async

setAsyncResponseTopic

protected void setAsyncResponseTopic(java.lang.String topic)
Setter for CicsClient node AsyncResponseTopic; once is set, the value will be used by the subsequent async call such as execute() until it is set again to another value.

CTG & SBYND Listener;

Parameters:
topic - - the topic;

getAsyncRspNotifServer

protected java.lang.String getAsyncRspNotifServer()
Getter for CicsClient node AsyncRspNotifServer; Return the current value in CicsClient node AsyncRspNotifServer, the host name is used by async call handler to publish the program completion information such as CommArea returned from the called program, error code and error text if there is any; initial value is from the configuration parameter Async Call JMS Server Host in section "CICS Client";

CTG & SBYND Listener;

Returns:
the host name of the server; ===> Made private to disable async

setAsyncRspNotifServer

protected void setAsyncRspNotifServer(java.lang.String server)
Setter for CicsClient AsyncRspNotifServer; once is set, the value will be used by the subsequent async call such as execute() for publishing to the server with topic as indicated by the value in AsyncResponseTopic until it is set again to another value.

CTG & SBYND Listener;

Parameters:
server - - the host name for the server;

getAsyncRspNotifPort

protected int getAsyncRspNotifPort()
Getter for CicsClient AsyncRspNotifPort; Return the current value in CicsClient AsyncRspNotifPort, the port is used by async call handler to publish the program completion information such as CommArea returned from the called program, error code and error text if there is any; initial value is from the configuration parameter Async Call JMS Server Port in section "CICS Client";

CTG & SBYND Listener;

Returns:
the port; ===> Made private to disable async

setAsyncRspNotifPort

protected void setAsyncRspNotifPort(int port)
Setter for CicsClient AsyncRspNotifPort; once is set, the value will be used by the subsequent async call such as execute() for publishing async call completion event until it is set again to another value.

CTG & SBYND Listener;

Parameters:
port - - the port number for the server;

getUrl

public java.lang.String getUrl()
Getter for CicsClient Url; Return URL pointing to the remote or local CICS transaction gateway to connect to - i.e. the current value in CicsClient Url; initial value is from the configuration parameter URL in section "CICS Gateway"; CTG specific;

Specified by:
getUrl in interface CicsClient
Returns:
the URL;

setUrl

public void setUrl(java.lang.String s)
Setter for CicsClient Url; Set URL pointing to the remote or local CICS transaction gateway to connect to; CTG specific;

Specified by:
setUrl in interface CicsClient
Parameters:
s - - the url;

getHost

public java.lang.String getHost()
Getter for CicsClient Host; Return Host pointing to the Listener to connect to - i.e. the current value in CicsClient Host; initial value is from the configuration parameter URL in section "SeeBeyond CICS Listener"; Listener specific;

Specified by:
getHost in interface CicsClient
Returns:
the Host;

setHost

public void setHost(java.lang.String s)
Setter for CicsClient Host; Set Host pointing to the Listener to connect to; Listener specific;

Specified by:
setHost in interface CicsClient
Parameters:
s - - the Host;

getPort

public int getPort()
Getter for CicsClient Port; Return the port of the host where CTG gateway is to be connected to - i.e. the current value in CicsClientException node Port; initial value is from the configuration parameter Port in section "CICS Gateway"; CTG specific;

Specified by:
getPort in interface CicsClient
Returns:
the port number;

setPort

public void setPort(int i)
Setter for CicsClient Port; Set port of the host where the CTG is running; CTG specific;

Specified by:
setPort in interface CicsClient
Parameters:
i - - the port;

getSslClass

public java.lang.String getSslClass()
Getter for CicsClient SslClass; Return the SSL class for SSL authentication - i.e. the current value in CicsClientException node SslClass; initial value is from the configuration parameter SSL KeyRing Class in section "CICS Gateway"; CTG specific;

Specified by:
getSslClass in interface CicsClient
Returns:
the full classname of the SSL KeyRing class;

setSslClass

public void setSslClass(java.lang.String s)
Setter for CicsClient SslClass; CTG specific;

Specified by:
setSslClass in interface CicsClient
Parameters:
s - - the SSL class full name;

getSslPassword

public java.lang.String getSslPassword()
Getter for CicsClient SslPassword; Return the PASSWORD for the encrypted KeyRing class; - i.e. the current value in CicsClientException node SslPassword; initial value is from the configuration parameter SSL KeyRing Password in section "CICS Gateway"; CTG specific;

Specified by:
getSslPassword in interface CicsClient
Returns:
the SSL KeyRing Password;

setSslPassword

public void setSslPassword(java.lang.String s)
Setter for CicsClient SslPassword; the PASSWORD for the encrypted KeyRing class; CTG specific;

Specified by:
setSslPassword in interface CicsClient
Parameters:
s - - the pasword;

getEciSync

public boolean getEciSync()
Getter for CicsClient EciSync; Return the ECI call type - i.e. the current value in CicsClientException node EciSync; initial value is from the configuration parameter ECI call type in section "CICS Client"; CTG & SBYND Listener;

Specified by:
getEciSync in interface CicsClient
Returns:
true - the call is a synchronous one, false otherwise;

setEciSync

public void setEciSync(boolean b)
Setter for CicsClient EciSync; indicate if the call will be sync or async;

Specified by:
setEciSync in interface CicsClient
Parameters:
s - - the EciSync flag true the call will be a sync call false otherwise;

getUserId

public java.lang.String getUserId()
Getter for CicsClient UserId; Return the CICS user id - i.e. the current value in CicsClientException node UserId; initial value is from the configuration parameter CICS UserId in section "CICS Client"; CTG & SBYND Listener;

Specified by:
getUserId in interface CicsClient
Returns:
the CICS user id used when make a CICS call to a program on CICS server;

setUserId

public void setUserId(java.lang.String s)
Setter for CicsClient UserId;

Specified by:
setUserId in interface CicsClient
Parameters:
s - - user id;

getPassword

public java.lang.String getPassword()
Getter for CicsClient Password; Return the CICS user password - i.e. the current value in CicsClientException node Password; initial value is from the configuration parameter CICS Password in section "CICS Client"; CTG & SBYND Listener;

Specified by:
getPassword in interface CicsClient
Returns:
the CICS user password used when make a CICS call to a program on CICS server;

setPassword

public void setPassword(java.lang.String s)
Setter for CicsClient Password; the CICS password needed to authenticate the user when calling the CICS program;

Specified by:
setPassword in interface CicsClient
Parameters:
s - - the password;

getProgram

public java.lang.String getProgram()
Getter for CicsClient Program; Return the CICS program name to be invoked; - i.e. the current value in CicsClientException node Program; initial value is from the configuration parameter CICS Program in section "CICS Client"; CTG & SBYND Listener;

Specified by:
getProgram in interface CicsClient
Returns:
the CICS program to be invoked;

setProgram

public void setProgram(java.lang.String s)
Setter for CicsClient Program; the CICS program to be called;

Specified by:
setProgram in interface CicsClient
Parameters:
s - - the program name;

getTransId

public java.lang.String getTransId()
Getter for CicsClient TransId; Return the CICS transId to be invoked; - i.e. the current value in CicsClientException node TransId; initial value is from the configuration parameter CICS TransId in section "CICS Client"; CTG & SBYND Listener;

Specified by:
getTransId in interface CicsClient
Returns:
the CICS transId to be invoked;

setTransId

public void setTransId(java.lang.String s)
Setter for CicsClient Program; the CICS program's trans ID to be called;

Specified by:
setTransId in interface CicsClient
Parameters:
s - - the trans ID of the CICS program;

getEciTPN

public boolean getEciTPN()
Getter for CicsClient eciTPN; Return the ECI Transid type CTG Only;

Specified by:
getEciTPN in interface CicsClient
Returns:
true - the Transid field is an eci_tpn transid, false otherwise;

setEciTPN

public void setEciTPN(boolean b)
Setter for ETD node eciTPN; indicate if the transid will be interpreted as ECI_TPN;

Specified by:
setEciTPN in interface CicsClient
Parameters:
s - - the eciTPN flag true the TransID will be interpreted as ECI_TPN false otherwise;

getCommArea

public byte[] getCommArea()
Getter for CicsClient CommArea; Return the CommArea - i.e. the current value in CicsClientException node CommArea; CTG & SBYND Listener;

Specified by:
getCommArea in interface CicsClient
Returns:
the CommArea used when invoking CICS programs;

setCommArea

public void setCommArea(byte[] byteArray)
Setter for CicsClient CommArea; set the payload into CommArea usually used by the subsequent program invoking;

Specified by:
setCommArea in interface CicsClient
Parameters:
byteArray - - the payload used by the program to be invoked;

getCommAreaLength

public int getCommAreaLength()
Getter for CicsClient CommAreaLength; Return the CommAreaLength - i.e. the current value in CicsClientException node CommAreaLength; initial value is from the configuration parameter COMMAREA Length in section "CICS Client"; CTG & SBYND Listener;

Specified by:
getCommAreaLength in interface CicsClient
Returns:
the CommArea length used when invoking CICS programs (not necessarily the length of the byte array represented as CommArea);

setCommAreaLength

public void setCommAreaLength(int i)
Setter for CicsClient CommAreaLength; length of the CommArea; initial value is from the configuration parameter: COMMAREA Length;

Specified by:
setCommAreaLength in interface CicsClient
Parameters:
i - - the length;

getEciExtend

public boolean getEciExtend()
Getter for CicsClient EciExtend; Return the EciExtend flag (refer to CTG doc for detailed description of the flag) - i.e. the current value in CicsClientException node EciExtend; initial value is from the configuration parameter ECI extend mode in section "CICS Client";

Have effect for CTG only; Ignored by SBYND Listener - not implemented;

Specified by:
getEciExtend in interface CicsClient
Returns:
true the current call is and extension of a LUW, false otherwise;

setEciExtend

public void setEciExtend(boolean b)
Setter for CicsClient EciExtend; Have effect for CTG only; Ignored by SBYND Listener - not implemented;

Specified by:
setEciExtend in interface CicsClient
Parameters:
true - the current call is and extension of a LUW, false otherwise;

getEciLuwToken

public int getEciLuwToken()
Getter for CicsClient EciLuwToken; Return the ECI Luw token; - i.e. the current value in CicsClientException node EciLuwToken; initial value is from the configuration parameter ECI LUW token in section "CICS Client";

Have effect for CTG only ignored by SBYND Listener - not implemented;

Specified by:
getEciLuwToken in interface CicsClient
Returns:
current value of ECI Luw token;

setEciLuwToken

public void setEciLuwToken(int i)
Setter for CicsClient EciLuwToken; An integer identifying a LUW; initial value is from the configuration parameter: ECI LUW token in section "CICS Client"; CTG specific;

Specified by:
setEciLuwToken in interface CicsClient
Parameters:
i - - the unit;

getMessageQualifier

public int getMessageQualifier()
Getter for CicsClient MessageQualifier; Return the MessageQualifier for ECI call - i.e. the current value in CicsClientException node MessageQualifier; initial value is from the configuration parameter Message qualifier in section "CICS Client";

Have effect for CTG only ignored by SBYND Listener - not implemented;

Specified by:
getMessageQualifier in interface CicsClient
Returns:
Message qualifier;

setMessageQualifier

public void setMessageQualifier(int i)
Setter for CicsClient MessageQualifier; Have effect for CTG only; Ignored by SBYND Listener - not implemented;

Specified by:
setMessageQualifier in interface CicsClient
Parameters:
i - the message qualifier;

getEncoding

public java.lang.String getEncoding()
Getter for CicsClient Encoding; Return the encoding which can be used to translate the data to and from the CICS program - i.e. the current value in CicsClientException node Encoding; initial value is from the configuration parameter Encoding in section "CICS Client";

CTG & SBYND Listener;

Specified by:
getEncoding in interface CicsClient
Returns:
the encoding;

setEncoding

public void setEncoding(java.lang.String s)
Setter for CicsClient Encoding;

Specified by:
setEncoding in interface CicsClient
Parameters:
s - the encoding used for payload translation;

getTraceLevel

public int getTraceLevel()
Getter for CicsClient TraceLevel; Return the trace level for CTG client log; - i.e. the current value in CicsClientException node TraceLevel; initial value is from the configuration parameter Level in section "Tracing";

CTG only;

Specified by:
getTraceLevel in interface CicsClient
Returns:
the trace level for CTG client;

setTraceLevel

public void setTraceLevel(int i)
Setter for CicsClient TraceLevel;

Specified by:
setTraceLevel in interface CicsClient
Parameters:
i - the CTG client tracing level;

getTraceFilename

public java.lang.String getTraceFilename()
Getter for CicsClient TraceFilename; Return the trace file name for CTG client log; - i.e. the current value in CicsClientException node TraceFilename; initial value is from the configuration parameter Filename in section "Tracing";

CTG only;

Specified by:
getTraceFilename in interface CicsClient
Returns:
the trace file name for CTG client;

setTraceFilename

public void setTraceFilename(java.lang.String s)
Setter for CicsClient TraceFilename;

Specified by:
setTraceFilename in interface CicsClient
Parameters:
s - the CTG client tracing file name;

getTraceTruncationSize

public int getTraceTruncationSize()
Getter for CicsClient TraceTruncationSize; Return the trace truncation size for CTG client log; - i.e. the current value in CicsClientException node TraceTruncationSize; initial value is from the configuration parameter Truncation Size in section "Tracing";

CTG only;

Specified by:
getTraceTruncationSize in interface CicsClient
Returns:
the truncation size for CTG client logging;

setTraceTruncationSize

public void setTraceTruncationSize(int i)
Setter for CicsClient TraceTruncationSize;

Specified by:
setTraceTruncationSize in interface CicsClient
Parameters:
i - the CTG client tracing truncation size;

getTraceDumpOffset

public int getTraceDumpOffset()
Getter for CicsClient TraceDumpOffset; Return the trace dump offset for CTG client log; - i.e. the current value in CicsClientException node TraceDumpOffset; initial value is from the configuration parameter Dump Offset in section "Tracing";

CTG only;

Specified by:
getTraceDumpOffset in interface CicsClient
Returns:
the trace dump offset for CTG client logging;

setTraceDumpOffset

public void setTraceDumpOffset(int i)
Setter for CicsClient TraceDumpOffset;

Specified by:
setTraceDumpOffset in interface CicsClient
Parameters:
i - the CTG client tracing dump offset;

getTraceTiming

public boolean getTraceTiming()
Getter for CicsClient TraceTiming; Return the trace timing (time stamp) in CTG client log; - i.e. the current value in CicsClientException node TraceTiming; initial value is from the configuration parameter Timing in section "Tracing";

CTG only;

Specified by:
getTraceTiming in interface CicsClient
Returns:
trueinclude time stamp in CTG client tracing false otherwise;

setTraceTiming

public void setTraceTiming(boolean b)
Setter for CicsClient TraceTiming; CTG only;

Specified by:
setTraceTiming in interface CicsClient
Parameters:
b - true include time stamp in CTG client tracing, false otherwise;

getServer

public java.lang.String getServer()
Getter for CicsClient Server; Return CICS server name where the request is sent to - i.e. the current value in CicsClientException node Server;

With CTG, the value can be set by the collaboration or if getServerList() is called, the side effect is to set the first server in the server list obtained to the CicsClient Server; With SBYND Listener, the value is not used; instead a configuration parameter Host in configuration section "SeeBeyond CICS Listener" is used;

Specified by:
getServer in interface CicsClient
Returns:
the CICS server name;

setServer

public void setServer(java.lang.String s)
Setter for CicsClient Server;

Specified by:
setServer in interface CicsClient
Parameters:
s - CICS Server name;

getEciCallbackable

protected java.lang.Object getEciCallbackable()
Setter for CicsClient EciCallbackable;

Parameters:
s - CICS Server name;
Returns:
void; ===> Made private to disable async

setEciCallbackable

protected void setEciCallbackable(java.lang.Object handler)
Setter for CicsClient EciCallbackable;

Parameters:
handler - Async call handler - the valid instance should be either com.stc.eways.cics.CTGReplyHandler or com.stc.eways.cics.SBYNDListenerReplyHandler;

initProxy

protected void initProxy(boolean useListener)
                  throws CicsClientException
Throws:
CicsClientException

handleTrace

public void handleTrace()
                 throws CicsClientException
Throws:
CicsClientException

terminate

public void terminate()
               throws CicsClientException
Terminates the CicsClientException.

Throws:
CicsClientException - upon an external connection problem

reset

public boolean reset()
Resets the data content of an CicsClientException.

Specified by:
reset in interface CicsClient
Returns:
false if the CicsClientException doesn't have a meaningful implementation of reset(); so do a new of the CicsClientException instead. Otherwise, return true if the reset will clear the data content of the CicsClientException.

connect

public void connect()
             throws CicsClientException
Establish a connection to the CICS server and subsequently, the collaboration can flow request (CICS program calls) to the server across the connection;

The underlying transport used can be CTG or SBYND Listener but it is transparent to the collaboration as far as the connect() is concerned;

Specified by:
connect in interface CicsClient
Throws:
CicsClientException - upon an external connection problem

disconnect

public void disconnect()
                throws CicsClientException
Disconnect the connection established through connect();

The underlying transport used can be CTG or SBYND Listener but it is transparent to the collaboration as far as the disconnect() is concerned;

Specified by:
disconnect in interface CicsClient
Throws:
CicsClientException - upon an external connection problem

isConnected

public boolean isConnected()
                    throws CicsClientException
Check if the connection is good;

Specified by:
isConnected in interface CicsClient
Returns:
true - is active, false otherwise;
Throws:
CicsClientException - upon error.

getServerList

public java.lang.String[] getServerList(int maxNumSystems)
                                 throws CicsClientException
Obtain a list of CICS servers defined: name-description pairs With SBYND Listener as the transport, only one server is returned, i.e. the SBYND Listener host (should be the same host as the CICS server)

Specified by:
getServerList in interface CicsClient
Returns:
An array of servers - list of available CICS servers to which CICS call can be issued
Throws:
CicsClientException - upon an external connection problem

getHexString

protected static java.lang.String getHexString(byte[] byteArray)

execute

public void execute()
             throws CicsClientException,
                    SBYNDCicsProxyTimeoutException
For SBYND CICS Listner:

use SBYND CICS Listener host as the server name and delegate to execute(eciSync, server, userId, password, program, transId,commArea, commAreaLength, eciExtend, eciLuwToken, messageQualifier, asyncCallHandler) with irrelevant parameters set to 0 or null. only the following parameters are still used by SBYND CICS Listener: (1) eciSync (2) userId (3) password (4) program (5) transId (6) commArea

For CTG:

delegate to execute(eciSync, server, userId, password, program, transId,commArea, commAreaLength, eciExtend, eciLuwToken, messageQualifier, asyncCallHandler)

Specified by:
execute in interface CicsClient
Throws:
CicsClientException - upon error
SBYNDCicsProxyTimeoutException

execute

public void execute(boolean eciSynCall,
                    java.lang.String cicsServerName,
                    java.lang.String cicsUserId,
                    java.lang.String cicsPassword,
                    java.lang.String cicsProgram,
                    java.lang.String cicsTransId,
                    byte[] byteArray,
                    int length,
                    boolean eciExtendMode,
                    int eciLUWToken,
                    int msgQualifier,
                    java.lang.Object asyncCallHandler)
             throws CicsClientException,
                    SBYNDCicsProxyTimeoutException
For compatibility if eciTPN is not in the parameter list, set it to false

Specified by:
execute in interface CicsClient
Throws:
CicsClientException
SBYNDCicsProxyTimeoutException

execute

public void execute(boolean eciSynCall,
                    java.lang.String cicsServerName,
                    java.lang.String cicsUserId,
                    java.lang.String cicsPassword,
                    java.lang.String cicsProgram,
                    java.lang.String cicsTransId,
                    byte[] byteArray,
                    int length,
                    boolean eciExtendMode,
                    int eciLUWToken,
                    int msgQualifier,
                    java.lang.Object asyncCallHandler,
                    boolean eciTPN)
             throws CicsClientException,
                    SBYNDCicsProxyTimeoutException
For SBYND CICS Listner: invoke the remote CICS program through the following steps (defined by a propritary protocol) (1) prepare a APC record (Application Control Record) with request code as SBYND_LISTENER_REQCODE_REQ_SYNC or SBYND_LISTENER_REQCODE_REQ_ASYNC depend on parameter eciSynCall with byteArray as the payload; the prepare APC record is in the outbound buffer in SBYNDCicsProxy (2) send the request to SBYND CICS Listener; (3) get response from SBYND CICS Listener; (4) further get returned data from the program if it is a sync call (5) ACK or NACK accordingly For CTG: prepare an ECIRequest object with the data given via the parameters, call method flow() to send the request and get result (sync) or proceed (async);

Specified by:
execute in interface CicsClient
Parameters:
eciSynCall - - true invoke the program synchronously, false invoke the program asynchronously;
cicsServerName - - CICS server name - CTG only;
cicsUserId - - CICS user id;
cicsPassword - - CICS password;
cicsProgram - - CICS program;
cicsTransId - - CICS transaction id;
byteArray - - payload area (INOUT & OUTPUT)
length - - length of the payload - CTG only;
eciExtendMode - - ECI extend mode - CTG only;
eciLUWToken - - ECI LUW token - CTG only;
msgQualifier - - CTG only;
asyncCallHandler - - Handler for async call reply;
Throws:
CicsClientException - upon error
SBYNDCicsProxyTimeoutException

getCommAreaString

public java.lang.String getCommAreaString()
Construct a commarea String by converting the commarea array of bytes using the platform's default character encoding.

Specified by:
getCommAreaString in interface CicsClient
Returns:
the CommArea in String form;

getEncodedCommAreaString

public java.lang.String getEncodedCommAreaString()
                                          throws java.io.UnsupportedEncodingException
Construct a commarea String by converting the commarea array of bytes using the character encoding specified earlier for the CicsClientException.

Specified by:
getEncodedCommAreaString in interface CicsClient
Returns:
the CommArea in String form using Encoding to do the translation;
Throws:
java.io.UnsupportedEncodingException

getCommAreaString

public java.lang.String getCommAreaString(java.lang.String enc)
                                   throws java.io.UnsupportedEncodingException
Construct a commarea String by converting the commarea array of bytes using the character encoding specified as an argument.

Specified by:
getCommAreaString in interface CicsClient
Parameters:
enc - the encoding used when translating the CommArea byte array into a String;
Returns:
the CommArea as a String;
Throws:
java.io.UnsupportedEncodingException

getCommAreaString

public java.lang.String getCommAreaString(int offset,
                                          int length)
Construct a commarea String by converting the commarea array of bytes with offset and length using the platform's default character encoding.

Specified by:
getCommAreaString in interface CicsClient
Parameters:
offset -
length -
Returns:
the String instanciated from CommArea section specified by (offset, length) using system default encoding;

getEncodedCommAreaString

public java.lang.String getEncodedCommAreaString(int offset,
                                                 int length)
                                          throws java.io.UnsupportedEncodingException
Construct a commarea String by converting the commarea array of bytes with offset and length using the platform's default character encoding.

Specified by:
getEncodedCommAreaString in interface CicsClient
Parameters:
offset -
length -
Returns:
the String instanciated from CommArea section specified by (offset, length) using encoding indicated by current value of CicsClient Encoding;
Throws:
java.io.UnsupportedEncodingException

getCommAreaString

public java.lang.String getCommAreaString(int offset,
                                          int length,
                                          java.lang.String enc)
                                   throws java.io.UnsupportedEncodingException
Construct a commarea String by converting the commarea array of bytes with offset and length using the platform's default character encoding.

Specified by:
getCommAreaString in interface CicsClient
Parameters:
offset -
length -
enc -
Returns:
the String instanciated from CommArea section specified by (offset, length) using encoding specified by parameter enc;
Throws:
java.io.UnsupportedEncodingException

sendRequest

public void sendRequest(java.lang.Object requestObj)
                 throws CicsClientException
For SBYND CICS Listner: Send an ACR to the listener, assuming ACR is properly prepared and is in outbound buffer; sendRequest() only send ACR, if a response is expected, need to call getResponse() sebsequently;

For CTG: The sendRequest method flows data contained in the ECIRequest object to the Gateway and determines whether send has been successful by checking the return code. If an error has occurred, an CollabConnException is thrown.

Specified by:
sendRequest in interface CicsClient
Parameters:
request - - ECIRequest object contains all the data needed to invoke a CICS program through CTG, for SBYND CICS Listener this parameter is ignored;
Throws:
CicsClientException - upon error

toPackedDecimal

public PackedDecimal toPackedDecimal(java.lang.String number,
                                     int intSize,
                                     int decSize)
                              throws java.lang.NumberFormatException
Build a packed decimal from a string number Convert the in String +-99999.99 in an packed decimal IBM data Flow -> Each digit is a 0..9 Numerical value last digit is the sign digit : A|C|E|F => + ; B|D => - ; the decimal point is virtual its position is defined in the second byte of dec_length

Specified by:
toPackedDecimal in interface CicsClient
Parameters:
Number - decimal String representation to be converted
Returns:
the packed decimal object;
Throws:
java.lang.NumberFormatException

commAreaToPackedDecimal

public PackedDecimal commAreaToPackedDecimal(int offset,
                                             int intSize,
                                             int decSize)
Build a packed decimal from the payload in CommArea section specified by (offset, intSize, decSize)

Specified by:
commAreaToPackedDecimal in interface CicsClient
Parameters:
offset -
intSize -
decSize -
Returns:
the packed decimal object;

packedDecimalToString

public java.lang.String packedDecimalToString(PackedDecimal pd)
Get the string from a packed decimal object;

Specified by:
packedDecimalToString in interface CicsClient
Parameters:
pd -
Returns:
the String from applying toString() against the packed decimal object;

commAreaZonedToString

public java.lang.String commAreaZonedToString(int offset,
                                              int length,
                                              java.lang.String enc)
Convert the zoned decimal (COBOL PIC S9) byte array CommArea field to a String;

Specified by:
commAreaZonedToString in interface CicsClient
Parameters:
offset - - start of the zone;
length - - length of the zone;
enc - - encoding used for conversion;
Returns:
the resulted String;

commAreaZonedToString

public java.lang.String commAreaZonedToString(int offset,
                                              int length)
Convert the zoned decimal (COBOL PIC S9) byte array CommArea field to a String using current value of CicsClient Encoding as encoding;

Specified by:
commAreaZonedToString in interface CicsClient
Parameters:
offset - - start of the zone;
length - - length of the zone;
Returns:
the resulted String;

zonedToString

public java.lang.String zonedToString(byte[] zoned)
                               throws java.lang.NumberFormatException
Convert the zoned decimal (COBOL PIC S9) byte array specified by zoned to a String using current value of CicsClient Encoding as encoding;

Specified by:
zonedToString in interface CicsClient
Parameters:
zoned - - the byte array contains zoned decimal;
Returns:
the resulted String;
Throws:
java.lang.NumberFormatException

zonedToString

public java.lang.String zonedToString(byte[] zoned,
                                      java.lang.String enc)
                               throws java.lang.NumberFormatException
Convert the zoned decimal (COBOL PIC S9) byte array specified by zoned to a String using the specified encoding enc;

Specified by:
zonedToString in interface CicsClient
Parameters:
zoned - - the byte array contains zoned decimal;
enc - - the encoding used for conversion;
Returns:
the resulted String;
Throws:
java.lang.NumberFormatException

toZoned

public byte[] toZoned(java.lang.String number)
Convert a number in the form of a String to zoned decimal (COBOL PIC S9) byte array using the current value of CicsClient Encoding as the encoding;

Specified by:
toZoned in interface CicsClient
Parameters:
number - - the number String;
Returns:
the resulted byte array;

toZoned

public byte[] toZoned(java.lang.String number,
                      java.lang.String enc)
Convert a number in the form of a String to zoned decimal (COBOL PIC S9) byte array using the encoding specified by the parameter enc;

Specified by:
toZoned in interface CicsClient
Parameters:
number - - the number String;
enc - - the encoding;
Returns:
the resulted byte array;

getReturnCode

public int getReturnCode()
                  throws CicsClientException
SBYND CICS Listener specific; Return the error code of the current response assuming a response is in the current inbound buffer; should be called immediately after getResponse();

Specified by:
getReturnCode in interface CicsClient
Returns:
the error code;
Throws:
CicsClientException

getReturnMessage

public java.lang.String getReturnMessage()
                                  throws CicsClientException
SBYND CICS Listener specific; Return the error text of the current response assuming a response is in the current inbound buffer; should be called immediately after getResponse();

Specified by:
getReturnMessage in interface CicsClient
Returns:
the error text;
Throws:
CicsClientException

getProgramName

public java.lang.String getProgramName()
                                throws CicsClientException
SBYND CICS Listener specific; Return the program name of the response assuming a response is in the current inbound buffer; should be called immediately after getResponse();

Specified by:
getProgramName in interface CicsClient
Returns:
the program name;
Throws:
CicsClientException

getRequestCode

public int getRequestCode()
                   throws CicsClientException
SBYND CICS Listener specific; Return the request code of the response assuming a response is in the current inbound buffer; should be called immediately after getResponse();

Specified by:
getRequestCode in interface CicsClient
Returns:
the request code;
Throws:
CicsClientException

getRequestDesc

public java.lang.String getRequestDesc()
                                throws CicsClientException
SBYND CICS Listener specific; Return description for the request code assuming a response is in the current inbound buffer; should be called immediately after getResponse();

Specified by:
getRequestDesc in interface CicsClient
Returns:
the descritpion;
Throws:
CicsClientException

prepareAPCRecord

public void prepareAPCRecord(java.lang.String progname,
                             int appltimeout,
                             int requestcode,
                             int errorcode,
                             java.lang.String errortext)
                      throws CicsClientException
SBYND CICS Listener specific; Prepare an APC Record in outbound buffer of SBYNDCicsProxy using the parameters and this can be send out by invoking sendRequest() subsequently;

Specified by:
prepareAPCRecord in interface CicsClient
Parameters:
progname - - the transaction program name;
appltimeout - - application timeout not used (reserved);
requestcode - - request code of the ACR;
errorcode - - error code of the ACR;
errortext - - error message (usually used when the ACR is an NACK);
Throws:
CicsClientException - if error in data;

returnCodeIs

public boolean returnCodeIs(int code)
                     throws CicsClientException
SBYND CICS Listener specific; check if the error code in the APC record is the same as code;

Specified by:
returnCodeIs in interface CicsClient
Returns:
true error code is the same as code, otherwise, false;
Throws:
CicsClientException

returnOK

public boolean returnOK()
                 throws CicsClientException
SBYND CICS Listener specific; check if the error code in the APC record is SBYND_LISTENER_RC_OK;

Specified by:
returnOK in interface CicsClient
Returns:
true error code is SBYND_LISTENER_RC_OK, otherwise, false;
Throws:
CicsClientException

getResponse

public boolean getResponse()
                    throws CicsClientException,
                           SBYNDCicsProxyTimeoutException
SBYND CICS Listener specific; Read from the SBYND CICS Listener in blocking mode until timed out or get a response;

Specified by:
getResponse in interface CicsClient
Returns:
true if get a good ACR otherwise, false; use the SBYND CICS Listener parameter: Transport Timeout as the timeout;
Throws:
CicsClientException
SBYNDCicsProxyTimeoutException

getResponse

public boolean getResponse(int timeout)
                    throws CicsClientException,
                           SBYNDCicsProxyTimeoutException
SBYND CICS Listener specific; Read from the SBYND CICS Listener in blocking mode until timed out or get a response;

Specified by:
getResponse in interface CicsClient
Parameters:
timeout - - timeout for getting response;
Returns:
true if get a good ACR otherwise, false;
Throws:
CicsClientException
SBYNDCicsProxyTimeoutException

getECIERRORS

public ECIErrorCodes getECIERRORS()
                           throws CicsClientException
CTG specific; Return ECIErrorCodes object; this getter is for CicsClient ECIERRORS;

Specified by:
getECIERRORS in interface CicsClient
Returns:
ECIErrorCodes;
Throws:
CicsClientException

getRETURNCODES

public SBYNDAppControlRecordReturnCodes getRETURNCODES()
                                                throws CicsClientException
SBYND CICS Listener specific; Return SBYNDAppControlRecordReturnCodes object; this getter is for CicsClient RETURNCODES;

Specified by:
getRETURNCODES in interface CicsClient
Returns:
SBYNDAppControlRecordReturnCodes;
Throws:
CicsClientException

getREQUESTCODES

public SBYNDAppControlRecordRequestCodes getREQUESTCODES()
                                                  throws CicsClientException
SBYND CICS Listener specific; Return SBYNDAppControlRecordRequestCodes object; this getter is for CicsClient REQUESTCODES;

Specified by:
getREQUESTCODES in interface CicsClient
Returns:
SBYNDAppControlRecordRequestCodes;
Throws:
CicsClientException

getSBYNDCicsProxyConfig

public SBYNDCicsProxyConfig getSBYNDCicsProxyConfig()
SBYND CICS Listener specific; Return the SBYND CICS Listener specific configuration parameters;

Returns:
SBYNDCicsProxyConfig;

getSBYNDListenerTransID

public java.lang.String getSBYNDListenerTransID()
                                         throws CicsClientException
SBYND CICS Listener specific; Getter for SBYND CICS Listener TransID - CicsClient SBYNDListenerTransID initial value is from configuration parameter SeeBeyond CICS Listener TransId in section "SeeBeyond CICS Listener";

Specified by:
getSBYNDListenerTransID in interface CicsClient
Returns:
the listener trans ID - the default value is "STCL";
Throws:
CicsClientException

setSBYNDListenerTransID

public void setSBYNDListenerTransID(java.lang.String transid)
                             throws CicsClientException
SBYND CICS Listener specific; Setter for SBYND CICS Listener TransID - CicsClient SBYNDListenerTransID

Specified by:
setSBYNDListenerTransID in interface CicsClient
Parameters:
transid - - the transaction ID of the SBYND CICS Listener - STCL;
Throws:
CicsClientException

getTPTimeout

public int getTPTimeout()
                 throws CicsClientException
SBYND CICS Listener specific; Getter for CICS program time out - CicsClient TPTimeout initial value is from configuration parameter TP Timeout in section "SeeBeyond CICS Listener";

Specified by:
getTPTimeout in interface CicsClient
Returns:
the timeout value in milli-seconds; usually this is set to the max estimated time takes the CICS program to finish and come back to the inoker;
Throws:
CicsClientException

setTPTimeout

public void setTPTimeout(int timeout)
                  throws CicsClientException
SBYND CICS Listener specific; Setter for TP Timeout - CicsClient TPTimeout

Specified by:
setTPTimeout in interface CicsClient
Parameters:
timeout - - the timeout value in milli-seconds; usually this is set to the max estimated time takes the CICS program to finish and come back to the inoker;
Throws:
CicsClientException

getListenerTimeout

public int getListenerTimeout()
                       throws CicsClientException
SBYND CICS Listener specific; Getter for Listener time out - CicsClient ListenerTimeout initial value is from configuration parameter Listener Timeout in section "SeeBeyond CICS Listener";

Specified by:
getListenerTimeout in interface CicsClient
Returns:
the timeout value in milli-seconds; usually this is set to the time that the SBYND listener will wait for program invoking request from the eway before it close the connection;
Throws:
CicsClientException

setListenerTimeout

public void setListenerTimeout(int timeout)
                        throws CicsClientException
SBYND CICS Listener specific; Setter for Listener Timeout - CicsClient ListenerTimeout

Specified by:
setListenerTimeout in interface CicsClient
Parameters:
timeout - - the time that the SBYND listener will wait for program invoking request from the eway before it close the connection;
Throws:
CicsClientException

getPollingRate

public int getPollingRate()
                   throws CicsClientException
SBYND CICS Listener specific; Getter for Listener Polling Rate - CicsClient PollingRate initial value is from configuration parameter Polling Rate in section "SeeBeyond CICS Listener";

Specified by:
getPollingRate in interface CicsClient
Returns:
a 1-255 value used by listener internally;
Throws:
CicsClientException

setPollingRate

public void setPollingRate(int rate)
                    throws CicsClientException
SBYND CICS Listener specific; Setter for Polling Rate - CicsClient PollingRate

Specified by:
setPollingRate in interface CicsClient
Parameters:
rate - - a 1-255 value used by listener internally;
Throws:
CicsClientException

getTransportTimeout

public int getTransportTimeout()
                        throws CicsClientException
SBYND CICS Listener specific; Getter for TransportTimeout - CicsClient TransportTimeout initial value is from configuration parameter Transport Timeout in section "SeeBeyond CICS Listener";

Specified by:
getTransportTimeout in interface CicsClient
Returns:
time in milli-seconds used to timeout a blocking read on a socket between the eway and the listener;
Throws:
CicsClientException

setTransportTimeout

public void setTransportTimeout(int timeout)
                         throws CicsClientException
SBYND CICS Listener specific; Setter for Transport Timeout - CicsClient TransportTimeout

Specified by:
setTransportTimeout in interface CicsClient
Parameters:
timeout - - time in milli-seconds used to timeout a blocking read on a socket between the eway and the listener;
Throws:
CicsClientException

getStartType

public java.lang.String getStartType()
                              throws CicsClientException
SBYND CICS Listener specific; Getter for Startup type - CicsClient StartType initial value is from configuration parameter Start Type in section "SeeBeyond CICS Listener";

Specified by:
getStartType in interface CicsClient
Returns:
startup type for IBM CICS Listener - possible values "IC" or "TD";
Throws:
CicsClientException

setStartType

public void setStartType(java.lang.String starttype)
                  throws CicsClientException
SBYND CICS Listener specific; Setter for Startup delay - CicsClient StartType

Specified by:
setStartType in interface CicsClient
Parameters:
starttype - - the Startup type value either "IC" or "TD" used by IBM CICS Listener to decide how the SBYND Listener will be waked up;
Throws:
CicsClientException

getStartDelay

public java.lang.String getStartDelay()
                               throws CicsClientException
SBYND CICS Listener specific; Getter for Startup delay - CicsClient StartDelay initial value is from configuration parameter Start Delay in section "SeeBeyond CICS Listener";

Specified by:
getStartDelay in interface CicsClient
Returns:
IBM CICS Listener needed parameter Startup delay a string in the format of HHMMSS - indicating the time elapsed before the STCL (SBYND CICS Listener be waked up);
Throws:
CicsClientException

setStartDelay

public void setStartDelay(java.lang.String startdelay)
                   throws CicsClientException
SBYND CICS Listener specific; Setter for Startup delay - CicsClient StartDelay

Specified by:
setStartDelay in interface CicsClient
Parameters:
startdelay - - the delay value in the format of HHMMSS used by IBM CICS Listener to delay the wake up of SBYND listener, the default value is "000000";
Throws:
CicsClientException

getPaddingCharacter

public java.lang.String getPaddingCharacter()
                                     throws CicsClientException
SBYND CICS Listener specific; Getter for padding character - CicsClient PaddingCharacter initial value is from configuration parameter COMMAREA Padding Character in section "SeeBeyond CICS Listener";

Specified by:
getPaddingCharacter in interface CicsClient
Returns:
the EBCDIC code for the character used by the SBYND listener to pad the COMMAREA at the CICS server when the actual length of the payload in the COMMAREA is shorter than the length given by CommAreaLength; the default is hexdecimal 40 - EBCDIC space;
Throws:
CicsClientException

setPaddingCharacter

public void setPaddingCharacter(java.lang.String padcharhex)
                         throws CicsClientException
SBYND CICS Listener specific; Setter for padding character - CicsClient PaddingCharacter

Specified by:
setPaddingCharacter in interface CicsClient
Parameters:
padcharhex - the EBCDIC code for the character used by the SBYND listener to pad the COMMAREA at the CICS server when the actual length of the payload in the COMMAREA is shorter than the length given by CommAreaLength; the default is hexdecimal 40 - EBCDIC space;
Throws:
CicsClientException

copyParams

protected void copyParams()

Sun Adapter for CICS API