Interface OutboundStreamSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, 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 Summary
Modifier and TypeMethodDescriptionGets theEndpointassociated with this session.Gets theEndpointIdassociated with this session.booleanTests to see if an input stream is available for retrieval.Receives data from the remote transport endpoint.sendData()Sends data to the remote transport endpoint.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getEndpointId
Id getEndpointId()Gets theEndpointIdassociated with this session.- Returns:
- the
EndpointIdassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getEndpoint
Gets theEndpointassociated with this session.- Returns:
- the
Endpointassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- 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:
trueif a stream is available for reading,falseotherwise- 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()isfalseOperationFailedException- unable to complete request- Compliance:
mandatory- This method must be implemented.
-