|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ados.hestia.sdk.session.Session
public abstract class Session
Represent session to exchange with partner.
Field Summary | |
---|---|
protected Date |
m_createDate
|
protected String |
m_error
|
protected List<Container> |
m_history
|
protected Date |
m_lastActivityDate
|
protected List<SessionListener> |
m_listeners
|
protected PayloadContainer |
m_localMessage
|
protected PayloadContainer |
m_partnerMessage
|
protected String |
m_rejectReason
|
protected String |
m_sessionID
|
protected int |
m_state
|
protected WaitedContainerDescription |
m_waitedDescription
|
static int |
NOTIFY_MESSAGE_RECEIVE
|
static int |
NOTIFY_MESSAGE_SENT
|
static int |
NOTIFY_STATE_CHANGES
|
static int |
NOTIFY_STATUS_RECEIVE
|
static int |
NOTIFY_STATUS_SENT
|
static int |
SESSION_TYPE_INITIATION
|
static int |
SESSION_TYPE_RESPOND
|
static int |
STATE_CREATED
|
static int |
STATE_ERROR
|
static int |
STATE_FINISHED
|
static int |
STATE_IDLE
|
static int |
STATE_READY_TO_SEND_MESSAGE
|
static int |
STATE_READY_TO_SEND_STATUS
|
static int |
STATE_WAIT_ACCEPTANCE
|
static int |
STATE_WAIT_MESSAGE
|
static int |
STATE_WAIT_PREPARE_RESPOND
|
static int |
STATE_WAIT_STATUS
|
Constructor Summary | |
---|---|
protected |
Session(String sessionID)
|
Method Summary | |
---|---|
abstract void |
acceptPartnerMessage()
Accept message from partner. |
void |
addListener(SessionListener listener)
Add session listener. |
String |
getEIS()
Returns id of eis for current session or null if not set. |
String |
getError()
Returns description of error when state of session is STATE_ERROR. |
Container[] |
getHistory()
Returns history of this session. |
protected PayloadContainer |
getInitiatedContainer()
Returns container wich was first for session. |
Date |
getLastActivityDate()
Returns last activity date for session. |
PayloadContainer |
getLocalMessage()
Returns local message. |
abstract PayloadContainer |
getMessageToSend()
Called by external dispatcher when session prepared message for delivering to partner. |
String |
getPartner()
Returns id of partner for current session or null if not set. |
PayloadContainer |
getPartnerMessage()
Returns message from partner. |
String |
getPIPID()
Returns associated with session pipid. |
String |
getPipInstanceID()
Returns associated with session pipinstance id. |
Date |
getStartDate()
Returns start date for this session. |
int |
getState()
Returns current state of session. |
abstract StatusContainer |
getStatusToSend()
Called by external dispatcher when session prepared status for delivering to partner. |
abstract int |
getType()
Returns type of session. |
String |
getVersion()
Returns associated with session pip version. |
abstract WaitedContainerDescription |
getWaitedContainerDesc()
Returns description about which pip, pip instance id and partner are accepted. |
boolean |
isActive()
Return true if Session is still active (not finished and not has error). |
boolean |
isError()
Return true if Session is finished with error status. |
boolean |
isFinished()
Return true if Session is successfully finished. |
protected void |
notifyEvent(int id,
Object object)
Internal method. |
abstract void |
pushMessage(PayloadContainer message)
Called by external dispatcher. |
abstract void |
pushStatus(StatusContainer status)
Called by external dispatcher. |
abstract void |
rejectPartnerMessage(String reason)
Rejcect partner message whit specific reason. |
void |
removeListener(SessionListener listener)
Remove session listener. |
void |
restore(InputStream instream)
Restore state of session from external storage. |
void |
serialize(OutputStream outstream)
Serialize current state of session to external storage. |
abstract void |
setLocalMessage(PayloadContainer message)
Set local message for partner. |
void |
stop()
Stop current session. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int STATE_CREATED
public static final int STATE_READY_TO_SEND_MESSAGE
public static final int STATE_READY_TO_SEND_STATUS
public static final int STATE_WAIT_STATUS
public static final int STATE_WAIT_MESSAGE
public static final int STATE_WAIT_ACCEPTANCE
public static final int STATE_WAIT_PREPARE_RESPOND
public static final int STATE_IDLE
public static final int STATE_FINISHED
public static final int STATE_ERROR
public static final int NOTIFY_STATE_CHANGES
public static final int NOTIFY_MESSAGE_SENT
public static final int NOTIFY_MESSAGE_RECEIVE
public static final int NOTIFY_STATUS_SENT
public static final int NOTIFY_STATUS_RECEIVE
public static final int SESSION_TYPE_INITIATION
public static final int SESSION_TYPE_RESPOND
protected int m_state
protected PayloadContainer m_partnerMessage
protected PayloadContainer m_localMessage
protected WaitedContainerDescription m_waitedDescription
protected String m_rejectReason
protected List<Container> m_history
protected String m_sessionID
protected String m_error
protected List<SessionListener> m_listeners
protected Date m_createDate
protected Date m_lastActivityDate
Constructor Detail |
---|
protected Session(String sessionID)
Method Detail |
---|
public Date getStartDate()
public Date getLastActivityDate()
public void addListener(SessionListener listener)
listener
- listener to addpublic void removeListener(SessionListener listener)
listener
- listener to removeprotected void notifyEvent(int id, Object object)
id
- id of event. See NOTIFY_*
object
- object of event. Specific from idpublic int getState()
STATE_*
constants.
STATE_*
constantspublic PayloadContainer getPartnerMessage()
public PayloadContainer getLocalMessage()
public abstract void setLocalMessage(PayloadContainer message)
public String getError()
public abstract void acceptPartnerMessage()
public abstract void rejectPartnerMessage(String reason)
reason
- reason to reject partner messagepublic void stop()
public boolean isActive()
public boolean isFinished()
public boolean isError()
public Container[] getHistory()
public void serialize(OutputStream outstream) throws IOException
outstream
- external storage
IOException
- if store will failpublic void restore(InputStream instream) throws IOException
instream
- exernal storage
IOException
- if session can not be restoredpublic abstract PayloadContainer getMessageToSend()
public abstract StatusContainer getStatusToSend()
public abstract WaitedContainerDescription getWaitedContainerDesc()
public abstract void pushMessage(PayloadContainer message)
message
- message to pushpublic abstract void pushStatus(StatusContainer status)
status
- status to pushpublic abstract int getType()
SESSION_TYPE_*
SESSION_TYPE_*
protected PayloadContainer getInitiatedContainer()
public String getPartner()
public String getEIS()
public String getPipInstanceID()
public String getPIPID()
public String getVersion()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |