|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ados.hestia.sdk.session.SessionManager
public class SessionManager
Manage Sessions. Usage. SessionManager smanager = new SessionManager(exchanger); smanager.start(); ................ smanager.stop();
Nested Class Summary | |
---|---|
protected class |
SessionManager.SessionManagerThread
|
Field Summary | |
---|---|
protected MessageExchanger |
m_exchanger
|
protected SessionProcessor |
m_processor
|
protected SessionManager.SessionManagerThread |
m_thread
|
Constructor Summary | |
---|---|
SessionManager(MessageExchanger exchanger)
Default constructor. |
|
SessionManager(MessageExchanger exchanger,
SessionProcessor processor)
Create manager over specific processor. |
Method Summary | |
---|---|
void |
accept(SessionKey session)
Accept specific session. |
SessionKey |
create(String partner,
String eis,
ServiceContent content,
Attachment[] attachments)
Allocate new initiation session. |
void |
deleteSession(SessionKey sessionKey)
Delete one specific session |
void |
deleteSessions(SessionKey[] sessionKeies)
Delete array of Sessions. |
SessionKey[] |
getActive()
Return array of Session descriptions which are not finished. |
SessionKey[] |
getError()
Return array of Session descriptions which are at error state. |
SessionKey[] |
getFinished()
Return array of Session descriptions which are finished. |
SessionKey[] |
getForAccept(String pipId,
String partner)
Return array of Session descriptions which are awaiting accepting or rejection. |
SessionKey[] |
getForResponse(String pipId,
String partner)
Return array of Session descriptions which are awaiting response. |
Session |
getSession(SessionKey sessionKey)
Extract Session which is specified by key. |
protected void |
hit()
Periodically called by supporting thread. |
protected void |
onError(Object error)
Handle error situation. |
protected void |
processArrived()
Process arrived messaged. |
protected void |
processArrived(Container container)
Process specific arrived message. |
protected void |
processArrived(int maxToReceive)
|
protected void |
processReadyToSendContainer(boolean payload)
Process ready to send to partner Containers of specific type. |
protected void |
processReadyToSendMessage()
Process ready to send to partner PayloadContainers. |
protected void |
processReadyToSendStatus()
Process ready to send to partner StatusContainers. |
void |
reject(SessionKey session,
String reason)
Reject specific session. |
void |
response(SessionKey session,
ServiceContent content,
Attachment[] attachments)
Make response for specific session. |
void |
start()
Start manager. |
void |
stop()
Stop manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected MessageExchanger m_exchanger
protected SessionProcessor m_processor
protected SessionManager.SessionManagerThread m_thread
Constructor Detail |
---|
public SessionManager(MessageExchanger exchanger)
exchanger
- - specify exchanger to communicate with Hestia Server.public SessionManager(MessageExchanger exchanger, SessionProcessor processor)
processor
- specify DB to store sessions entry.exchanger
- specify exchanger to communicate with Hestia Server.Method Detail |
---|
public void start()
public void stop()
public Session getSession(SessionKey sessionKey) throws CollectorException
sessionKey
- specify which Session to extract.
CollectorException
- if db operation cannot be peformed.public SessionKey create(String partner, String eis, ServiceContent content, Attachment[] attachments) throws CollectorException
partner
- specify remote partner identifier.eis
- specify eis identifier.content
- content of initiation message.attachments
- optional parameter if initiating message has attachments.
CollectorException
- if db operation cannot be peformed.public SessionKey[] getForAccept(String pipId, String partner) throws CollectorException
pipId
- optional parameter to filter only specific pips. For example 0C1.partner
- optional parameter to filter Sessions only from specific partner.
CollectorException
- if db operation cannot be peformed.public void accept(SessionKey session) throws CollectorException
session
- specify session for accepting.
CollectorException
- if db operation cannot be peformed.public void reject(SessionKey session, String reason) throws CollectorException
session
- specify session for reject.reason
- specify reason why session is not accepted.
CollectorException
- if db operation cannot be peformed.public SessionKey[] getForResponse(String pipId, String partner) throws CollectorException
pipId
- optional parameter to filter only specific pips. For example 0C1.partner
- optional parameter to filter Sessions only from specific partner.
CollectorException
- if db operation cannot be peformed.public void response(SessionKey session, ServiceContent content, Attachment[] attachments) throws CollectorException
session
- specify session for response.content
- response content.attachments
- optional parameter if repsonse has attachments.
CollectorException
- if db operation cannot be peformed.public SessionKey[] getActive() throws CollectorException
CollectorException
- if db operation cannot be peformed.public SessionKey[] getFinished() throws CollectorException
CollectorException
- if db operation cannot be peformed.public SessionKey[] getError() throws CollectorException
CollectorException
- if db operation cannot be peformed.public void deleteSession(SessionKey sessionKey) throws CollectorException
sessionKey
- session description of session to delete
CollectorException
- if db operation cannot be peformed.public void deleteSessions(SessionKey[] sessionKeies) throws CollectorException
sessionKeies
- specify which sessions should be deleted.
CollectorException
- if db operation cannot be peformed.protected void hit()
protected void processReadyToSendMessage()
protected void processReadyToSendStatus()
protected void processReadyToSendContainer(boolean payload)
payload
- true if PayloadContainers should be processed.protected void processArrived() throws IOException, MessageException, TransactionException
MessageException
IOException
TransactionException
protected void processArrived(int maxToReceive) throws IOException, MessageException, TransactionException
IOException
MessageException
TransactionException
protected void processArrived(Container container) throws Throwable
container
- specify message to process.
Throwable
- if logical error occured.protected void onError(Object error)
error
- error description.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |