public class Session extends Object implements ISession
Request with incoming Confirmations or errors. Catches errors and
responds with error messages.| Constructor and Description |
|---|
Session(Communicator communicator,
Queue queue,
PromiseFulfiller fulfiller,
IFeatureRepository featureRepository)
Handles required injections.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(SessionEvents eventHandler) |
void |
close()
Close down the connection.
|
boolean |
equals(Object o) |
UUID |
getSessionId()
Get a unique session
UUID identifier. |
int |
hashCode() |
void |
open(String uri,
SessionEvents eventHandler)
Connect to a specific uri, provided a call back handler for connection related events.
|
void |
sendConfirmation(String uniqueId,
String action,
Confirmation confirmation)
Send a
Confirmation to a Request |
void |
sendRequest(String action,
Request payload,
String uuid)
Send a
Request. |
String |
storeRequest(Request payload)
Store a
Request and get the unique id. |
String |
toString() |
public Session(Communicator communicator, Queue queue, PromiseFulfiller fulfiller, IFeatureRepository featureRepository)
communicator - send and receive messages.queue - store and restore requests based on unique ids.public UUID getSessionId()
UUID identifier.getSessionId in interface ISessionUUID identifierpublic void sendRequest(String action, Request payload, String uuid)
Request.sendRequest in interface ISessionaction - action name to identify the feature.payload - the Request payload to senduuid - unique identification to identify the requestpublic String storeRequest(Request payload)
Request and get the unique id.storeRequest in interface ISessionpayload - the Request payload to sendpublic void sendConfirmation(String uniqueId, String action, Confirmation confirmation)
Confirmation to a RequestuniqueId - the unique identification the receiver expects.confirmation - the Confirmation payload to send.public void open(String uri, SessionEvents eventHandler)
public void accept(SessionEvents eventHandler)
Copyright © 2022. All rights reserved.