public interface OutboundMessageSession extends OsidSession
This session provides access to a request/response protocol provider.
The data and format of the requests and responses are identified through
their respective Types.
While this session is used for
structured conversations, it doesn't preclude the use of byte streams as
part of a Request
or Response.
A Request
is retrieved via
getRequest()
and data is supplied to its corresponding record. The
Request
is then sent using sendRequest()
along with an interface to be called when the Response
arrives. The FSM of the protocol is indicated through the available
Request
Types
that may change from one transaction
to another.
While multiple requests may be submitted before receiving a response, the requests may or may not be queued.
Modifier and Type | Method and Description |
---|---|
Endpoint |
getEndpoint()
Gets the
Endpoint associated with this session. |
Id |
getEndpointId()
Gets the
Endpoint Id associated with
this session. |
Request |
getRequest()
Gets a
Request for use with sendRequest(). |
void |
makeRequest(Request request,
Response response)
Sends a request to the remote transport endpoint and waits for a
response.
|
void |
sendRequest(Request request,
MessageReceiver callback)
Sends data to the remote transport endpoint and sends the response to
the callback.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id getEndpointId()
Endpoint
Id
associated with
this session. Endpoint
Id
associated with
this sessionmandatory
- This method must be implemented. Endpoint getEndpoint() throws OperationFailedException, PermissionDeniedException
Endpoint
associated with this session. Endpoint
associated with this sessionOperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. Request getRequest()
Request
for use with sendRequest().
This is not a receive call.mandatory
- This method must be implemented. void makeRequest(Request request, Response response) throws OperationFailedException
request
- the requestresponse
- callback for the responseNullArgumentException
- request
or
receiver
is nullOperationFailedException
- unable to complete requestUnsupportedException
- request
is not
supportedmandatory
- This method must be implemented. void sendRequest(Request request, MessageReceiver callback) throws OperationFailedException
request
- the requestcallback
- callback for the responseNullArgumentException
- request
or
callback
is nullOperationFailedException
- unable to complete requestUnsupportedException
- request
is not
supportedmandatory
- This method must be implemented.