|
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.SBYNDCicsProxy
public class SBYNDCicsProxy
The SBYNDCicsProxy
class represents
a connection to the SBYND CICS Listener;
methods are implemented and exposed to
enable the caller to invoke CICS transaction programs on the host
(via SBYND CICS Listener), passing data to and get result from it;
Field Summary |
---|
Constructor Summary | |
---|---|
SBYNDCicsProxy(SBYNDCicsProxyConfig config)
|
Method Summary | |
---|---|
void |
appendSendBuffer(byte[] buffer)
append the Outbound buffer. |
int |
bytesAvailable()
return the bytes available for read; |
boolean |
checkConnection()
Check the connection; |
void |
connect()
Establish connection with the CICS host, a multi-step procedure: (1) connect to host and port with TCP/IP socket (connect to IBM CICS listener); (2) send Initialization Control Record
over to SBYND CICS Listener;
(3) get ACK from SBYND CICS Listener; |
void |
disconnect()
Disconnect with the CICS host, a multi-step procedure: (1) send shut down request - an Application Control Record with shutdown request code to SBYND CICS Listener; (2) get ACK from SBYND CICS Listener indicating shutdown OK; (3) close the socket; According to the protocol, if error occurred during the course of sending shutdown request or receiving ACK for the shutdown request, the control will proceed and the socket will be closed anyway, so next time the connection is established both client and the SBYND CICS Listener can be in sync; |
byte[] |
getCommArea()
|
int |
getCommAreaLength()
|
java.lang.String |
getPassword()
|
int |
getPayloadLength()
|
java.lang.String |
getProgram()
|
java.lang.String |
getProgramName()
|
byte[] |
getReceiveBuffer()
return the Inbound buffer. |
int |
getRequestCode()
Return the request code from the response (from SBYND CICS Listener) assuming the response is in the inbound buffer; |
java.lang.String |
getRequestDesc()
|
boolean |
getResponse(int timeout)
Get an ACR from the listener, assuming ACR is properly received, put it in the inbound buffer; how the incoming ACR are parsed depends on the request code, if it is SBYND_LISTENER_REQCODE_LSTNR_RETURN4SYNC, receive payload into CommArea, otherwise, all the meta data are in the _InboundBuffer; for request code SBYND_LISTENER_REQCODE_LSTNR_RETURN4SYNC, need to use a different timeout, TP timeout, since TP can be running like 2 hr, so when getResponse() is used to receive a result from a sync TP, a TP timeout will be used instead of the TRANSPORT_TIMEOUT; |
int |
getReturnCode()
|
java.lang.String |
getReturnMessage()
|
byte[] |
getSendBuffer()
return the Outbound Buffer. |
java.lang.String |
getUserId()
|
void |
prepareAPCRecord(java.lang.String progname,
int appltimeout,
int requestcode,
int errorcode,
java.lang.String errortext)
Form an APC record in the outbound buffer whenever the payload - i.e. |
void |
prepareICRecord()
Form an IC record in the outbound buffer and this will be sent out via subsequent sendRequest() call; |
int |
receive()
Read bytes into the _InboundBuffer start at 0 up to number of bytes available; Grow _InboundBuffer if necessary; Will adjust _InboundContentLen accordingly; |
int |
receive(byte[] buffer)
This is supposed to be used with programmer provided buffer only; Should not be used with the _InboundBuffer; Read bytes until the buffer's length or EOF reached or timed out; |
int |
receive(byte[] buffer,
int offset,
int length)
This is supposed to be used with programmer provided buffer only; Should not be used with the _InboundBuffer; Read bytes until the length or EOF reached or timed out; |
int |
receive(int offset,
int length)
Read bytes into the _InboundBuffer start at offset up to offset + length, the read will block until length read or EOF reached or timed out; _InboundBuffer will grow accordingly; Will adjust _InboundContentLen accordingly; |
int |
receiveRecord(int timeout)
Read a message from the listener, the message is in inbound buffer. |
void |
reconnect()
|
void |
send()
send the Outbound buffer's actual content. |
void |
send(byte[] buffer)
send the specified buffer. |
void |
send(byte[] buffer,
int offset,
int length)
send the specified buffer. |
void |
send(int offset,
int length)
send the Outbound buffer. |
void |
sendRequest()
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 |
setCommArea(byte[] byteArray)
|
void |
setCommAreaLength(int i)
|
void |
setPassword(java.lang.String s)
|
void |
setProgram(java.lang.String s)
|
void |
setReceiveBuffer(byte[] buffer)
set the Inbound buffer. |
void |
setSendBuffer(byte[] buffer)
set the Outbound buffer. |
void |
setUserId(java.lang.String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SBYNDCicsProxy(SBYNDCicsProxyConfig config)
Method Detail |
---|
public java.lang.String getPassword()
public void setPassword(java.lang.String s)
public java.lang.String getProgram()
public void setProgram(java.lang.String s)
public java.lang.String getUserId()
public void setUserId(java.lang.String s)
public byte[] getCommArea()
public void setCommArea(byte[] byteArray)
public int getCommAreaLength()
public void setCommAreaLength(int i)
public byte[] getSendBuffer()
public byte[] getReceiveBuffer()
public void setSendBuffer(byte[] buffer)
byte[]
- buffer;public void appendSendBuffer(byte[] buffer)
byte[]
- buffer;public void setReceiveBuffer(byte[] buffer)
byte[]
- buffer;public void send() throws CicsClientException
CollabConnException
- if there is an error in the underlying socket,
CollabDataException
- if there is an error in the _OutboundBuffer,
CicsClientException
public void send(byte[] buffer) throws CicsClientException
buffer
- - send the content of the buffer;
CollabConnException
- if there is an error in the underlying socket,
CollabDataException
- if there is an error in the _OutboundBuffer,
CicsClientException
public void send(int offset, int length) throws CicsClientException
offset
- - offset for the Outbound buffer;length
- - number of bytes to be sent starting from offset;
CollabConnException
- if there is an error in the underlying socket,
CollabDataException
- if there is an error in the _OutboundBuffer,
CicsClientException
public void send(byte[] buffer, int offset, int length) throws CicsClientException
buffer
- - the buffer to be sent;offset
- - the offset for the buffer starting from where
the content will be sent;length
- - number of bytes to sent starting from offset;
CollabConnException
- if there is an error in the underlying socket,
CollabDataException
- if there is an error in the _OutboundBuffer,
CicsClientException
public int receive() throws CicsClientException, SBYNDCicsProxyTimeoutException
-1
for EOF
;
CollabConnException
- if there is an error in the underlying socket;
CollabDataException
- if there is an error in the
receive operation;
CicsClientException
SBYNDCicsProxyTimeoutException
public int receive(int offset, int length) throws CicsClientException, SBYNDCicsProxyTimeoutException
offset
- - starting position in Inbound buffer for
incoming bytes;length
- - bytes to be read;
-1
for EOF
;
CollabConnException
- if there is an error in the underlying socket;
CollabDataException
- if there is an error in the
receive operation;
SBYNDCicsProxyTimeoutException
- if socket read is timed out;
CicsClientException
public int receive(byte[] buffer) throws CicsClientException, SBYNDCicsProxyTimeoutException
buffer
- - the buffer for incoming bytes - will read
until the buffer filled up;
-1
if EOF
reached;
CollabConnException
- if there is an error in the underlying socket;
CollabDataException
- if there is an error in the
receive operation;
SBYNDCicsProxyTimeoutException
- if socket read is timed out;
CicsClientException
public int receive(byte[] buffer, int offset, int length) throws CicsClientException, SBYNDCicsProxyTimeoutException
buffer
- - buffer for incoming bytes;offset
- - starting point where incoming data is
received;length
- - number of bytes to read;
CollabConnException
- if there is an error in the underlying socket;
CollabDataException
- if there is an error in the
receive operation;
SBYNDCicsProxyTimeoutException
- if socket read is timed out;
CicsClientException
public void connect() throws CicsClientException
Initialization Control Record
over to SBYND CICS Listener;
(3) get ACK from SBYND CICS Listener;
CollabConnException
- if there is an error in the underlying socket;
CollabDataException
- if there is an error other than
connection problem;
CicsClientException
public void sendRequest() throws CicsClientException
CollabConnException
- if error for the connection;
CollabDataException
- if error in data;
CicsClientException
public boolean getResponse(int timeout) throws CicsClientException, SBYNDCicsProxyTimeoutException
timeout
- - timeout for the blocking read;
true
- a ACR received properly and is in
Inbound buffer.
CollabConnException
- if error for the connection;
CollabDataException
- if error in data;
SBYNDCicsProxyTimeoutException
- if timeout while
expecting a response from the listener;
CicsClientException
public int receiveRecord(int timeout) throws CicsClientException
timeout
- - the timeout for
SOCKET_OPTION TIMEOUT - affect socket read;
-1
- EOF
w/o a complete message;
-2
- Timeout w/o complete message;
-3
- Partial Message received;
-4
- Invalid ACR
0
- a complete message read in the buffer;
CollabConnException
- if error for the connection;
CollabDataException
- if error in data;
CicsClientException
public void prepareICRecord() throws CicsClientException
CollabDataException
- if error in data;
CicsClientException
public void prepareAPCRecord(java.lang.String progname, int appltimeout, int requestcode, int errorcode, java.lang.String errortext) throws CicsClientException
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);
CollabDataException
- if error in data;
CicsClientException
public int getReturnCode() throws CicsClientException
CicsClientException
public java.lang.String getReturnMessage() throws CicsClientException
CicsClientException
public int getRequestCode() throws CicsClientException
CicsClientException
public int getPayloadLength() throws CicsClientException
CicsClientException
public java.lang.String getProgramName() throws CicsClientException
CicsClientException
public java.lang.String getRequestDesc() throws CicsClientException
CicsClientException
public void reconnect() throws CicsClientException
CicsClientException
public void disconnect() throws CicsClientException
CollabConnException
- if there is an error in the underlying socket;
CollabDataException
- if there is an error other than
connection problem;
CicsClientException
public boolean checkConnection()
true
- the connection is good as of last
socket IO, false
otherwise;
CicsClientException
- upon errorpublic int bytesAvailable() throws CicsClientException
CicsClientException
|
Sun Adapter for CICS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |