Interface OutboundStreamSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface OutboundStreamSession extends OsidSession

The outbound stream session is used to send and receive arbitrary data to and from a remote end point. The methods accept and return a data stream. Some protocols may send or receive all data within a single stream while others may use the streams as channels or frames of data.

A stream may be available for reading before all the data as arrived and as such multiple streams may be processed simultaneously.

  • 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.
    • sendData

      Sends data to the remote transport endpoint.
      Returns:
      the output stream in which to send data
      Throws:
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.
    • hasDataAvailable

      boolean hasDataAvailable()
      Tests to see if an input stream is available for retrieval.
      Returns:
      true if a stream is available for reading, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • receiveData

      Receives data from the remote transport endpoint.
      Returns:
      the input stream containing the received data
      Throws:
      IllegalStateException - hasDataAvailable() is false
      OperationFailedException - unable to complete request
      Compliance:
      mandatory - This method must be implemented.