|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.dse.base.DSENotifier | +--com.ibm.dse.base.Service | +--com.ibm.dse.services.cics.CICSConnection
This class maps a CICS connection using an ECI requests.
Field Summary | |
protected DataReceivedListener |
aDataReceivedListener
|
protected ErrorReceivedListener |
aErrorReceivedListener
|
protected SessionClosedListener |
aSessionClosedListener
|
protected SessionEstablishedListener |
aSessionEstablishedListener
|
static java.lang.String |
COMPID
|
protected java.lang.Thread |
restablishConn
|
protected static java.lang.String |
SPACE
|
protected static java.lang.String |
STR
|
Fields inherited from class com.ibm.dse.base.Service |
externalizer |
Fields inherited from class com.ibm.dse.base.DSENotifier |
handlersList,
name |
Fields inherited from interface com.ibm.dse.services.comms.CommonCommunicationsService |
CLOSED,
DATA,
DATASENT,
ERROR,
OPENED,
RECEIVERC,
TIMEOUT |
Constructor Summary | |
CICSConnection()
This constructor creates a CICSConnection object. |
|
CICSConnection(java.lang.String aName)
This constructor creates a CICSConnection object named aName. |
Method Summary | |
void |
addDataReceivedListener(DataReceivedListener newListener)
Adds a new DataReceivedListener. |
void |
addErrorReceivedListener(ErrorReceivedListener newListener)
Adds a new ErrorReceivedListener. |
void |
addSessionClosedListener(SessionClosedListener newListener)
Adds a new SessionClosedListener. |
void |
addSessionEstablishedListener(SessionEstablishedListener newListener)
Adds a new SessionEstablishedListener. |
void |
ccClose()
Closes the CICS connection. |
void |
ccOpen()
Opens a CICS connection. |
CCMessage |
ccReceiveData(long aTimeout)
Reads the data that has been received. |
void |
ccSendData(java.lang.String aString)
Sends aString through the communications channel. |
CCMessage |
ccSendReceive(java.lang.String aString,
long aTimeout)
Sends a string and waits until the data is received or the timeout is reached. |
void |
closeConnection()
Closes the CICS connection. |
Handler |
dispatchEvent(DSEEventObject anEvent)
Generates the event anEvent. |
void |
establishConnection()
Establishes a CICS connection. |
protected void |
fireHandleEvent(DataReceivedEvent event)
Fires a signal when a data is received. |
protected void |
fireHandleEvent(ErrorReceivedEvent event)
Fires a signal when an error is received. |
protected void |
fireHandleEvent(SessionClosedEvent event)
Fires a signal when the session is closed. |
protected void |
fireHandleEvent(SessionEstablishedEvent event)
Fires a signal when the session is established. |
boolean |
getAutomaticConnectionEstablishment()
Returns the value of the automaticConnectionestablishment attribute. |
java.lang.String |
getCcClosedEventName()
Returns the name of the closed event |
java.lang.String |
getCcDataReceivedEventName()
Returns the name of the data received event |
java.lang.String |
getCcErrorReceivedEventName()
Returns the name of the error received event |
java.lang.String |
getCcOpenedEventName()
Returns the name of the opened event |
java.lang.String |
getCodePage()
Returns the value of the cdPage attribute. |
java.lang.String |
getData()
Returns the response. |
int |
getEstablishSessionCounter()
Returns the value of the establishSessionCounter attribute. |
int |
getEstablishSessionRetries()
Returns the value of the establishSessionRetries attribute. |
java.lang.String |
getGatewayName()
Returns the value of the gatewayName attribute. |
int |
getGatewayPort()
Returns the value of the getewayPort attribute. |
java.lang.String |
getProgramName()
Returns the value of the programName attribute. |
int |
getRc()
Returns the value of the rc attribute. |
java.lang.String |
getServerName()
Returns the value of the serverName attribute. |
java.lang.String |
getStatus()
Returns the value of the status attribute. |
boolean |
getSynchronousMode()
Returns the value of the synchronousTx attribute |
int |
getTimeBetweenRetries()
Returns the value of the timeBetweenRetries attribute. |
java.lang.String |
getTransactionId()
Returns the value of the transactionId attribute. |
java.lang.String |
getUserId()
Returns the value of the userId attribute. |
void |
handleEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
Context aContext)
Calls the EventManager class that registers the handler to the local notifier if it is defined or adds it to its own list of handlers if the notifier is remote. |
void |
handleEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
Context aContext,
java.lang.String aTID)
Calls the EventManager class that registers the handler to the local notifier if it is defined or adds it to its own list of handlers if the notifier is remote. |
void |
initCommArea(int size)
Initializes the communications area and sets its size. |
java.lang.Object |
initializeFrom(Tag aTag)
Initializes a CICSConnection object with the aTag attributes. |
protected void |
initInstance()
Tries to establish a session with the CICS partner. |
boolean |
isFree()
Returns true if this CICS connection is ready to be used. |
boolean |
isOffline()
Returns true if the host session is down. |
void |
removeDataReceivedListener(DataReceivedListener aListener)
Removes the aListener. |
void |
removeErrorReceivedListener(ErrorReceivedListener aListener)
Removes the aListener. |
void |
removeSessionClosedListener(SessionClosedListener aListener)
Removes the aListener. |
void |
removeSessionEstablishedListener(SessionEstablishedListener aListener)
Removes the aListener. |
void |
resetCommArea()
Clears the communications area.. |
protected void |
restablishConnection()
Tries to establish the session. |
void |
run()
Run method. |
void |
setAutomaticConnectionEstablishment(boolean automatic)
Sets the value of the automaticConnection property. |
void |
setCodePage(java.lang.String cP)
Sets the value of the cdPage property. |
void |
setEstablishSessionCounter(int value)
Sets the value of the establishSessionCounter property. |
void |
setEstablishSessionRetries(int retries)
Sets the value of the establishSessionRetried property. |
void |
setGatewayName(java.lang.String aName)
Sets the value of the gatewayName property. |
void |
setGatewayPort(int aPort)
Sets the value of the gatewayPort property. |
void |
setInUse(boolean inUse)
Sets the value of the used property. |
void |
setPassword(java.lang.String aPassword)
Sets the value of the password property. |
void |
setProgramName(java.lang.String aProgram)
Sets the value of the programName property. |
void |
setResults(com.ibm.ctg.client.GatewayRequest req)
Is invoked when the answer of an asynchronous ECIRequest has been received. |
void |
setServerName(java.lang.String aName)
Sets the value of the serverName property. |
void |
setSynchronousMode(boolean b)
Sets the value of the synchronousTx property. |
void |
setTimeBetweenRetries(int time)
Sets the value of the timeBetweenRetries property. |
void |
setTransactionId(java.lang.String aId)
Sets the value of the transactionId property. |
void |
setUserId(java.lang.String aUser)
Sets the value of the userId property. |
void |
stopHandlingEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
Context aContext)
Allows the Handler to stop receiving a specific event for which it was registered previously. |
void |
stopHandlingEvent(java.lang.String anEventName,
java.lang.String aNotifierName,
Context aContext,
java.lang.String aTID)
Allows the Handler to stop receiving a specific event for which it was registered previously. |
void |
terminate()
Closes the connection and frees all the resources used by the service. |
java.lang.String |
toString()
Returns a visual representation of this object. |
Methods inherited from class com.ibm.dse.base.Service |
externalizer,
getExternalizer,
getTagName,
readExternal,
readExternal,
readObject,
removeExternal,
setExternalizer,
toStrings,
toTags,
writeExternal,
writeExternal |
Methods inherited from class com.ibm.dse.base.DSENotifier |
addHandler,
getHandlersList,
getName,
removeHandler,
setName,
signalEvent,
signalEvent,
signalEvent |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected transient DataReceivedListener aDataReceivedListener
protected transient ErrorReceivedListener aErrorReceivedListener
protected transient SessionClosedListener aSessionClosedListener
protected transient SessionEstablishedListener aSessionEstablishedListener
protected java.lang.Thread restablishConn
protected static java.lang.String STR
protected static java.lang.String SPACE
public static final java.lang.String COMPID
Constructor Detail |
public CICSConnection()
public CICSConnection(java.lang.String aName) throws java.io.IOException
aName
- java.lang.StringMethod Detail |
public void addDataReceivedListener(DataReceivedListener newListener)
newListener
- com.ibm.dse.services.cics.DataReceivedListenerpublic void addErrorReceivedListener(ErrorReceivedListener newListener)
newListener
- com.ibm.dse.services.cics.ErrorReceivedListenerpublic void addSessionClosedListener(SessionClosedListener newListener)
newListener
- com.ibm.dse.services.cics.DataReceivedListenerpublic void addSessionEstablishedListener(SessionEstablishedListener newListener)
newListener
- com.ibm.dse.services.cics.DataReceivedListenerpublic void ccClose() throws DSECCException
public void ccOpen() throws DSECCException
public CCMessage ccReceiveData(long aTimeout) throws DSECCException
aTimeout
- longpublic void ccSendData(java.lang.String aString) throws DSECCException
aString
- java.lang.Stringpublic CCMessage ccSendReceive(java.lang.String aString, long aTimeout) throws DSECCException
aString
- java.lang.StringaTimeout
- longpublic void closeConnection() throws java.io.IOException
public Handler dispatchEvent(DSEEventObject anEvent)
anEvent contains relevant data to be used by the event handler held in a Hashtable, the source of the event and the event name. Any handler is responsible for implementing this method, to check if it is interested in the event and/or pass it to the next interested handler in the chain that is waiting for it.
If the method returns this, the notifier passes the event to the following handler in the chain waiting for it. If the method returns null, the event is not propagated.
The default event processing is to pass the event to the following handler.
anEvent
- DSEEventObjectpublic void establishConnection()
protected void fireHandleEvent(DataReceivedEvent event)
event
- com.ibm.dse.services.cics.DataReceivedEventprotected void fireHandleEvent(ErrorReceivedEvent event)
event
- com.ibm.dse.services.cics.ErrorReceivedEventprotected void fireHandleEvent(SessionClosedEvent event)
event
- com.ibm.dse.services.cics.SessionClosedEventprotected void fireHandleEvent(SessionEstablishedEvent event)
event
- com.ibm.dse.services.cics.SessionEstablishedEventpublic boolean getAutomaticConnectionEstablishment()
public java.lang.String getCcClosedEventName()
public java.lang.String getCcDataReceivedEventName()
public java.lang.String getCcErrorReceivedEventName()
public java.lang.String getCcOpenedEventName()
public java.lang.String getCodePage()
public java.lang.String getData()
public int getEstablishSessionCounter()
public int getEstablishSessionRetries()
public java.lang.String getGatewayName()
public int getGatewayPort()
public java.lang.String getProgramName()
public int getRc()
public java.lang.String getServerName()
public java.lang.String getStatus()
public boolean getSynchronousMode()
public int getTimeBetweenRetries()
public java.lang.String getTransactionId()
public java.lang.String getUserId()
public void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext) throws DSEInvalidArgumentException
anEventName
- String The event name.aNotifierName
- String The notifier name.aContext
- Context The context instance.public void handleEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID) throws DSEInvalidArgumentException
anEventName
- String The event name.aNotifierName
- String The notifier name.aContext
- Context The context instance.aTID
- String The terminal identification.public void initCommArea(int size)
size
- intpublic java.lang.Object initializeFrom(Tag aTag) throws java.io.IOException, DSEException
aTag
- com.ibm.dse.base.Tag Contains the name and attributes of the object to be created.protected void initInstance() throws DSEInvalidArgumentException, DSECCException
public boolean isFree()
public boolean isOffline()
public void removeDataReceivedListener(DataReceivedListener aListener)
aListener
- com.ibm.dse.services.cics.DataReceivedListenerpublic void removeErrorReceivedListener(ErrorReceivedListener aListener)
aListener
- com.ibm.dse.services.cics.DataReceivedListenerpublic void removeSessionClosedListener(SessionClosedListener aListener)
aListener
- com.ibm.dse.services.cics.SessionClosedListenerpublic void removeSessionEstablishedListener(SessionEstablishedListener aListener)
aListener
- com.ibm.dse.services.cics.SessionEstablishedListenerpublic void resetCommArea()
protected void restablishConnection()
public void run()
public void setAutomaticConnectionEstablishment(boolean automatic)
automatic
- boolean The new value of the property.public void setCodePage(java.lang.String cP)
cP
- String The new value of the property.public void setEstablishSessionCounter(int value)
value
- int The new value of the property.public void setEstablishSessionRetries(int retries)
retries
- int The new value of the property.public void setGatewayName(java.lang.String aName)
aName
- String The new value of the property.public void setGatewayPort(int aPort)
aPort
- int The new value of the property.public void setInUse(boolean inUse)
inUsed
- boolean The new value of the property.public void setPassword(java.lang.String aPassword)
aPassword
- String The new value of the property.public void setProgramName(java.lang.String aProgram)
aProgram
- String The new value of the property.public void setResults(com.ibm.ctg.client.GatewayRequest req)
req
- com.ibm.ctg.client.GatewayRequestpublic void setServerName(java.lang.String aName)
aName
- String The new value of the property.public void setSynchronousMode(boolean b)
synchronousMode
- boolean The new value of the property.public void setTimeBetweenRetries(int time)
time
- int The new value of the property.public void setTransactionId(java.lang.String aId)
aTxId
- String The new value of the property.public void setUserId(java.lang.String aUser)
aUser
- String The new value of the property.public void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
anEventName
- String The event name.aNotifierName
- String The notifier name.aContext
- Context The context instance.public void stopHandlingEvent(java.lang.String anEventName, java.lang.String aNotifierName, Context aContext, java.lang.String aTID) throws DSEInvalidArgumentException, DSEHandlerNotFoundException
anEventName
- String The event name.aNotifierName
- String The notifier name.aContext
- Context The context instance.aTID
- String The terminal identification.public void terminate()
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |