public class ClientSession extends java.lang.Thread implements IDataNotificationListener, IExceptionReceiver, IConnectionListener
| Constructor and Description |
|---|
ClientSession()
Initializes a new instance of the ClientSession class.
|
ClientSession(IProcessHandler objIProcessHandler,
java.net.Socket socket)
Instantiates ClientSession with specified ProcessHandler and Socket object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
acceptConnection(boolean acceptConnection)
Accept connection.
|
void |
addClientStatusListener(IClientStatusListener objIClientStatusListener)
Adds the client status listener.
|
boolean |
close()
Close.
|
void |
closeConnection()
This function is automatically invoked when connection is closed by remote end.
|
IHL7BatchFile |
getBatchFile()
Retrieves HL7BatchFile from ClientSession
|
java.net.InetSocketAddress |
getClientAddress()
Retrieves the client address of ClientSession.
|
EnumErrorCode |
getErrorCode()
Retrieves Error Code after receiving Message Coming from Remote end
|
ISubscriptionListener |
getISubscriptionListener()
Retrieves ISubscriptionListener from ClientSession.
|
Message |
getMessage()
Retrieves Message from ClientSession
|
MessageFactory |
getMessageFactory()
Retrieves MessageFactory from ClientSession.
|
java.lang.String |
getMessageStructure()
Retrieves Enumeration of specified Message Structure.
|
IPublishAgent |
getPublishAgent()
Retrieves IPublishAgent from ClientSession.
|
ISequenceAgent |
getSequenceAgent()
Retrieves ISequenceAgent from ClientSession.
|
IServerInteractiveContinuation |
getServerSideQICAgent()
Retrieves IServerInteractiveContinuation from ClientSession.
|
java.lang.String |
getTiggerEvent()
Retrieves Enumeration of specified Trigger Event.
|
void |
initComm()
Initializes the communication and registers with all Agents and Listeners.
|
boolean |
isConnectionAccepted()
Checks if is connection accepted.
|
void |
notifyData(IHL7BatchFile objHL7BatchFile)
Invoked when HL7BatchFile is received from Remote end.
|
void |
notifyData(Message objMessage,
EnumErrorCode enumErrorCode)
Invoked when Message is received from Remote end.
|
void |
onException(java.lang.Exception ex,
byte[] buffer)
Invoked when exception occurs.
|
void |
onException(java.lang.Exception ex,
ISegmentSet objISegmentSet)
Invoked when exception is fetched while processing Message.
|
void |
run()
Executes client session thread.
|
boolean |
sendBatch(IHL7BatchFile objHL7BatchFile)
Sends specified Batch to Network Agent.
|
boolean |
sendMessage(Message objHL7Message)
Sends specified Message to Network Agent.
|
void |
setBatchProcessor(IBatchProcessor objIBatchProcessor)
Sets the Batch Processor
|
void |
setClientAddress(java.net.InetSocketAddress objClientAddress)
Sets the client address of ClientSession.
|
void |
setFragmentProcessor(IFragmentProcessor objIFragmentProcessor)
Sets the Fragment Processor
|
void |
setICanceledQueryReceiver(ICanceledQueryReceiver objCanceledQueryReceiver)
This will set the ICanceledQueryReceiver on Client session.
|
void |
setInteractiveQueryReciever(IInteractiveQueryReciever objInteractiveQueryReciever)
This will set the Interactive Query Receiver.
|
void |
setISubscriptionListener(ISubscriptionListener objISubscriptionListener)
Sets instance of ISubscriptionListener on ClientSession.
|
void |
setMessageFactory(MessageFactory objMessageFactory)
Sets MessageFactory on ClientSession.
|
void |
setMLLPProcessor(IMLLP objIMLLP)
Sets the MLLP Processor.
|
void |
setPublishAgent(IPublishAgent objPublishAgent)
Sets instance of PublishAgent on ClientSession.
|
void |
setReadWriteLength(int iReadLength,
int iWriteLength)
Sets max length limit of reading and writing.
|
void |
setSequenceAgent(ISequenceAgent objSequenceAgent)
Sets the Sequence Agent.
|
void |
setServerSideQCNAgent(IServerQueryCancellation objServerSideQCNAgent)
This will set the Query Cancellation agent on ClientSideMessageAgent
|
void |
setServerSideQICAgent(IServerInteractiveContinuation objServerSideQICAgent)
Sets the Interactive Continuation Agent.
|
void |
setServerSideTransactionHandler(ITransactionHandler objServerSideTransactionHandler)
This will set the ITransactionHandler on Client session.
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic ClientSession()
public ClientSession(IProcessHandler objIProcessHandler, java.net.Socket socket) throws java.io.IOException
objIProcessHandler - specified Process Handlersocket - given socket objectjava.io.IOExceptionpublic ISubscriptionListener getISubscriptionListener()
public void setISubscriptionListener(ISubscriptionListener objISubscriptionListener)
ISubscriptionListener - - instance of ISubscriptionListenerpublic IPublishAgent getPublishAgent()
public IServerInteractiveContinuation getServerSideQICAgent()
public ISequenceAgent getSequenceAgent()
public void setServerSideQICAgent(IServerInteractiveContinuation objServerSideQICAgent)
objServerSideQICAgent - the ServerSideQICAgent to set.public void setPublishAgent(IPublishAgent objPublishAgent)
objPublishAgent - - instance of PublishAgent.public void setInteractiveQueryReciever(IInteractiveQueryReciever objInteractiveQueryReciever)
objInteractiveQueryReciever - - implementor of IInteractiveQueryReciever.public void setICanceledQueryReceiver(ICanceledQueryReceiver objCanceledQueryReceiver)
objCanceledQueryReceiver - - implementor of ICanceledQueryReceiverpublic void setServerSideTransactionHandler(ITransactionHandler objServerSideTransactionHandler)
objServerSideTransactionHandler - - implementor of ITransactionHandlerpublic void setFragmentProcessor(IFragmentProcessor objIFragmentProcessor)
objIFragmentProcessor - the objIFragmentProcessor to setpublic void setMLLPProcessor(IMLLP objIMLLP)
objIMLLP - the MLLP processor to set.public void setSequenceAgent(ISequenceAgent objSequenceAgent)
objSequenceAgent - instance of Sequence Agent.public void setBatchProcessor(IBatchProcessor objIBatchProcessor)
objIBatchProcessor - the objIBatchProcessor to setpublic EnumErrorCode getErrorCode()
public Message getMessage()
public IHL7BatchFile getBatchFile()
public void setMessageFactory(MessageFactory objMessageFactory)
objMessageFactory - Specifies object of Message Factory.public MessageFactory getMessageFactory()
public void addClientStatusListener(IClientStatusListener objIClientStatusListener)
objIClientStatusListener - Specifies Object of Client Status Listener.public java.net.InetSocketAddress getClientAddress()
public void setClientAddress(java.net.InetSocketAddress objClientAddress)
objClientAddress - The new client addresspublic boolean isConnectionAccepted()
public void acceptConnection(boolean acceptConnection)
acceptConnection - The accept connectionpublic java.lang.String getMessageStructure()
public java.lang.String getTiggerEvent()
public void setReadWriteLength(int iReadLength,
int iWriteLength)
iReadLength - value of Reading max length.iWriteLength - value of Writing max length.public void onException(java.lang.Exception ex,
byte[] buffer)
onException in interface IExceptionReceiverex - Exception occurredbyte[] - buffer-buffer byte array containing data for which exception is thrown.public void onException(java.lang.Exception ex,
ISegmentSet objISegmentSet)
onException in interface IExceptionReceiverex - Exception fetched.buffer - data for which error is fetched.public void initComm()
public boolean sendMessage(Message objHL7Message) throws java.io.IOException
objHL7Message - Specified message to be sent.java.io.IOExceptionpublic boolean sendBatch(IHL7BatchFile objHL7BatchFile) throws java.io.IOException
objHL7Batch - Received Batch .java.io.IOException - Thrown when Message Validation fails.public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void notifyData(Message objMessage, EnumErrorCode enumErrorCode) throws java.io.IOException
notifyData in interface IDataNotificationListenerobjMessage - Received MessageenumErrorCode - Received error codejava.io.IOException - Thrown when IO operation fails.SerializeException - Thrown when serialization of Message fails.public void notifyData(IHL7BatchFile objHL7BatchFile)
notifyData in interface IDataNotificationListenerobjHL7BatchFile - Received HL7BatchFilepublic void closeConnection()
closeConnection in interface IConnectionListenerpublic boolean close()
throws java.io.IOException
java.io.IOExceptionpublic void setServerSideQCNAgent(IServerQueryCancellation objServerSideQCNAgent)
objQCNAgent - Specifies Object of Server Side Query Cancellation agent.