Interface OutboundMessageSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

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.

  • Method Details

    • getEndpointId

      Id getEndpointId()
      Gets the Endpoint Id associated with this session.
      Returns:
      the Endpoint Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getEndpoint

      Gets the Endpoint associated with this session.
      Returns:
      the Endpoint associated with this session
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getRequest

      Request getRequest()
      Gets a Request for use with sendRequest() . This is not a receive call.
      Returns:
      a request
      Compliance:
      mandatory - This method must be implemented.
    • makeRequest

      void makeRequest(Request request, Response response) throws OperationFailedException
      Sends a request to the remote transport endpoint and waits for a response.
      Parameters:
      request - the request
      response - callback for the response
      Throws:
      NullArgumentException - request or receiver is null
      OperationFailedException - unable to complete request
      UnsupportedException - request is not supported
      Compliance:
      mandatory - This method must be implemented.
    • sendRequest

      void sendRequest(Request request, MessageReceiver callback) throws OperationFailedException
      Sends data to the remote transport endpoint and sends the response to the callback.
      Parameters:
      request - the request
      callback - callback for the response
      Throws:
      NullArgumentException - request or callback is null
      OperationFailedException - unable to complete request
      UnsupportedException - request is not supported
      Compliance:
      mandatory - This method must be implemented.