|
Sun Adapter for CICS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.eways.cics.CicsClientImpl
com.stc.eways.cics.CicsClientExtImpl
com.stc.eways.cics.CTGCicsClientImpl
public class CTGCicsClientImpl
The CTGCicsClientImpl
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 |
---|
Fields inherited from class com.stc.eways.cics.CicsClientImpl |
---|
_SBYNDCicsProxy, _SBYNDCicsProxyConfig, eciExtend, eciSync, logger, manualConnect, mConfiguration, password, port, program, server, sslClass, sslPassword, traceDumpOffset, traceFilename, traceLevel, traceTiming, traceTruncationSize, url, userId |
Constructor Summary | |
---|---|
CTGCicsClientImpl(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
CTGCicsClientImpl constructor |
Method Summary | |
---|---|
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; |
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); |
ECIErrorCodes |
getECIERRORS()
CTG specific; Return ECIErrorCodes object;
this getter is for CicsClient ECIERRORS ; |
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"; |
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"; |
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"; |
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(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(); |
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[] |
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 |
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 |
getTransportTimeout()
SBYND CICS Listener specific; Getter for TransportTimeout - CicsClient TransportTimeout
initial value is from configuration parameter
Transport Timeout
in section "SeeBeyond CICS Listener"; |
void |
handleTrace()
|
protected void |
initProxy(boolean useListener)
|
boolean |
isConnected()
Check if the connection is good; |
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; |
void |
setListenerTimeout(int timeout)
SBYND CICS Listener specific; Setter for Listener Timeout - CicsClient ListenerTimeout |
void |
setPaddingCharacter(java.lang.String padcharhex)
SBYND CICS Listener specific; Setter for padding character - CicsClient PaddingCharacter |
void |
setPollingRate(int rate)
SBYND CICS Listener specific; Setter for Polling Rate - CicsClient PollingRate |
void |
setSBYNDListenerTransID(java.lang.String transid)
SBYND CICS Listener specific; Setter for SBYND CICS Listener TransID - CicsClient SBYNDListenerTransID |
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 |
setTransportTimeout(int timeout)
SBYND CICS Listener specific; Setter for Transport Timeout - CicsClient TransportTimeout |
Methods inherited from class com.stc.eways.cics.CicsClientExtImpl |
---|
connectionMatch |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CTGCicsClientImpl(com.stc.connector.framework.util.ConfigurationHelper aConfiguration) throws CicsClientException
config
- Properties bundle containing CICS specific connection information
CicsClientException
- upon errorMethod Detail |
---|
protected void initProxy(boolean useListener) throws CicsClientException
initProxy
in class CicsClientImpl
CicsClientException
public void handleTrace()
handleTrace
in class CicsClientImpl
public boolean reset()
reset
in interface CicsClient
reset
in class CicsClientImpl
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.public void connect() throws CicsClientException
The underlying transport used can be CTG or SBYND Listener but it is transparent to the collaboration as far as the connect() is concerned;
connect
in interface CicsClient
connect
in class CicsClientImpl
CicsClientException
- upon an external connection problempublic void disconnect() throws CicsClientException
The underlying transport used can be CTG or SBYND Listener but it is transparent to the collaboration as far as the disconnect() is concerned;
disconnect
in interface CicsClient
disconnect
in class CicsClientImpl
CicsClientException
- upon an external connection problempublic boolean isConnected() throws CicsClientException
isConnected
in interface CicsClient
isConnected
in class CicsClientImpl
true
- is active, false
otherwise;
CicsClientException
- upon error.public java.lang.String[] getServerList(int maxNumSystems) throws CicsClientException
getServerList
in interface CicsClient
getServerList
in class CicsClientImpl
CicsClientException
- upon an external connection problempublic void execute() throws CicsClientException, SBYNDCicsProxyTimeoutException
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)
execute
in interface CicsClient
execute
in class CicsClientImpl
CicsClientException
- upon error
SBYNDCicsProxyTimeoutException
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
execute
in interface CicsClient
execute
in class CicsClientImpl
CicsClientException
SBYNDCicsProxyTimeoutException
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
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);
execute
in interface CicsClient
execute
in class CicsClientImpl
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;
CicsClientException
- upon error
SBYNDCicsProxyTimeoutException
public void sendRequest(java.lang.Object requestObj) throws CicsClientException
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.
sendRequest
in interface CicsClient
sendRequest
in class CicsClientImpl
request
- - ECIRequest object contains all the data
needed to invoke a CICS program through CTG, for SBYND CICS Listener
this parameter is ignored;
CicsClientException
- upon errorpublic int getReturnCode() throws CicsClientException
getReturnCode
in interface CicsClient
getReturnCode
in class CicsClientImpl
CicsClientException
public java.lang.String getReturnMessage() throws CicsClientException
getReturnMessage
in interface CicsClient
getReturnMessage
in class CicsClientImpl
CicsClientException
public java.lang.String getProgramName() throws CicsClientException
getProgramName
in interface CicsClient
getProgramName
in class CicsClientImpl
CicsClientException
public int getRequestCode() throws CicsClientException
getRequestCode
in interface CicsClient
getRequestCode
in class CicsClientImpl
CicsClientException
public java.lang.String getRequestDesc() throws CicsClientException
getRequestDesc
in interface CicsClient
getRequestDesc
in class CicsClientImpl
CicsClientException
public void prepareAPCRecord(java.lang.String progname, int appltimeout, int requestcode, int errorcode, java.lang.String errortext) throws CicsClientException
prepareAPCRecord
in interface CicsClient
prepareAPCRecord
in class CicsClientImpl
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);
CicsClientException
- if error in data;public boolean returnCodeIs(int code) throws CicsClientException
code
;
returnCodeIs
in interface CicsClient
returnCodeIs
in class CicsClientImpl
true
error code is the same as code
,
otherwise, false;
CicsClientException
public boolean returnOK() throws CicsClientException
SBYND_LISTENER_RC_OK
;
returnOK
in interface CicsClient
returnOK
in class CicsClientImpl
true
error code is SBYND_LISTENER_RC_OK
,
otherwise, false;
CicsClientException
public boolean getResponse(int timeout) throws CicsClientException, SBYNDCicsProxyTimeoutException
getResponse
in interface CicsClient
getResponse
in class CicsClientImpl
timeout
- - timeout for getting
response;
true
if get a good ACR
otherwise, false
;
CicsClientException
SBYNDCicsProxyTimeoutException
public ECIErrorCodes getECIERRORS() throws CicsClientException
ECIErrorCodes
object;
this getter is for CicsClient ECIERRORS
;
getECIERRORS
in interface CicsClient
getECIERRORS
in class CicsClientImpl
ECIErrorCodes
;
CicsClientException
public SBYNDAppControlRecordReturnCodes getRETURNCODES() throws CicsClientException
SBYNDAppControlRecordReturnCodes
object;
this getter is for CicsClient RETURNCODES
;
getRETURNCODES
in interface CicsClient
getRETURNCODES
in class CicsClientImpl
SBYNDAppControlRecordReturnCodes
;
CicsClientException
public SBYNDAppControlRecordRequestCodes getREQUESTCODES() throws CicsClientException
SBYNDAppControlRecordRequestCodes
object;
this getter is for CicsClient REQUESTCODES
;
getREQUESTCODES
in interface CicsClient
getREQUESTCODES
in class CicsClientImpl
SBYNDAppControlRecordRequestCodes
;
CicsClientException
public java.lang.String getSBYNDListenerTransID() throws CicsClientException
SBYNDListenerTransID
initial value is from configuration parameter
SeeBeyond CICS Listener TransId
in section "SeeBeyond CICS Listener";
getSBYNDListenerTransID
in interface CicsClient
getSBYNDListenerTransID
in class CicsClientImpl
CicsClientException
public void setSBYNDListenerTransID(java.lang.String transid) throws CicsClientException
SBYNDListenerTransID
setSBYNDListenerTransID
in interface CicsClient
setSBYNDListenerTransID
in class CicsClientImpl
transid
- - the transaction ID
of the SBYND CICS Listener - STCL;
CicsClientException
public int getTPTimeout() throws CicsClientException
TPTimeout
initial value is from configuration parameter
TP Timeout
in section "SeeBeyond CICS Listener";
getTPTimeout
in interface CicsClient
getTPTimeout
in class CicsClientImpl
CicsClientException
public void setTPTimeout(int timeout) throws CicsClientException
TPTimeout
setTPTimeout
in interface CicsClient
setTPTimeout
in class CicsClientImpl
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;
CicsClientException
public int getListenerTimeout() throws CicsClientException
ListenerTimeout
initial value is from configuration parameter
Listener Timeout
in section "SeeBeyond CICS Listener";
getListenerTimeout
in interface CicsClient
getListenerTimeout
in class CicsClientImpl
CicsClientException
public void setListenerTimeout(int timeout) throws CicsClientException
ListenerTimeout
setListenerTimeout
in interface CicsClient
setListenerTimeout
in class CicsClientImpl
timeout
- - the time that
the SBYND listener will wait for program invoking
request from the eway before it close the connection;
CicsClientException
public int getPollingRate() throws CicsClientException
PollingRate
initial value is from configuration parameter
Polling Rate
in section "SeeBeyond CICS Listener";
getPollingRate
in interface CicsClient
getPollingRate
in class CicsClientImpl
CicsClientException
public void setPollingRate(int rate) throws CicsClientException
PollingRate
setPollingRate
in interface CicsClient
setPollingRate
in class CicsClientImpl
rate
- - a 1-255 value used by listener internally;
CicsClientException
public int getTransportTimeout() throws CicsClientException
TransportTimeout
initial value is from configuration parameter
Transport Timeout
in section "SeeBeyond CICS Listener";
getTransportTimeout
in interface CicsClient
getTransportTimeout
in class CicsClientImpl
CicsClientException
public void setTransportTimeout(int timeout) throws CicsClientException
TransportTimeout
setTransportTimeout
in interface CicsClient
setTransportTimeout
in class CicsClientImpl
timeout
- - time in milli-seconds used to timeout a blocking read
on a socket between the eway and the listener;
CicsClientException
public java.lang.String getStartType() throws CicsClientException
StartType
initial value is from configuration parameter
Start Type
in section "SeeBeyond CICS Listener";
getStartType
in interface CicsClient
getStartType
in class CicsClientImpl
CicsClientException
public void setStartType(java.lang.String starttype) throws CicsClientException
StartType
setStartType
in interface CicsClient
setStartType
in class CicsClientImpl
starttype
- - the Startup type value
either "IC" or "TD" used by IBM CICS Listener
to decide how the SBYND Listener will be waked up;
CicsClientException
public java.lang.String getStartDelay() throws CicsClientException
StartDelay
initial value is from configuration parameter
Start Delay
in section "SeeBeyond CICS Listener";
getStartDelay
in interface CicsClient
getStartDelay
in class CicsClientImpl
CicsClientException
public void setStartDelay(java.lang.String startdelay) throws CicsClientException
StartDelay
setStartDelay
in interface CicsClient
setStartDelay
in class CicsClientImpl
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";
CicsClientException
public java.lang.String getPaddingCharacter() throws CicsClientException
PaddingCharacter
initial value is from configuration parameter
COMMAREA Padding Character
in section "SeeBeyond CICS Listener";
getPaddingCharacter
in interface CicsClient
getPaddingCharacter
in class CicsClientImpl
CommAreaLength
;
the default is hexdecimal 40 - EBCDIC space;
CicsClientException
public void setPaddingCharacter(java.lang.String padcharhex) throws CicsClientException
PaddingCharacter
setPaddingCharacter
in interface CicsClient
setPaddingCharacter
in class CicsClientImpl
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;
CicsClientException
|
Sun Adapter for CICS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |