|
JavaTM SCTP API DRAFT ea-b10 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.sun.nio.sctp.MessageInfo
public abstract class MessageInfo
The MessageInfo class provides additional ancillary information about
messages.
Received SCTP messages, returned by
SctpChannel.receive and SctpMultiChannel.receive,
return a MessageInfo instance that can be queried to determine
ancillary information about the received message. Messages being sent should
use one of the createOutGoing methods to provide ancillary data for the message being
sent, and may use the appropriate setter methods to override the default
values provided for unordered, timeToLive, complete and payloadProtocolID, before sending the message.
For out going messages the
timeToLive parameter is a time period
that the sending side SCTP stack may expire the message if it has not been
sent. This time period is an indication to the stack that the message is no
longer required to be sent after the time period expires. It is not a hard
timeout and may be influenced by whether the association supports the partial
reliability extension, RFC 3758
| Constructor Summary | |
|---|---|
protected |
MessageInfo()
Initializes a new instance of this class. |
| Method Summary | |
|---|---|
abstract SocketAddress |
address()
Returns the source socket address if the message has been received, otherwise the preferred destination of the message to be sent. |
abstract Association |
association()
Returns the association that the message was received on, if the message has been received, otherwise the association that the message is to be sent on. |
abstract int |
bytes()
Returns the number of bytes read for the received message. |
abstract MessageInfo |
complete(boolean complete)
Sets whether or not the message is complete. |
static MessageInfo |
createOutGoing(Association association,
SocketAddress address,
int streamNumber)
Creates a MessageInfo instance suitable for use when
sending a message to a given association. |
static MessageInfo |
createOutGoing(SocketAddress address,
int streamNumber)
Creates a MessageInfo instance suitable for use when
sending a message. |
abstract boolean |
isComplete()
Tells whether or not the message is complete. |
abstract boolean |
isUnordered()
Tells whether or not the message is unordered. |
abstract int |
payloadProtocolID()
Returns the payload protocol Identifier. |
abstract MessageInfo |
payloadProtocolID(int ppid)
Sets the payload protocol Identifier. |
abstract int |
streamNumber()
Returns the stream number that the message was received on, if the message has been received, otherwise the stream number that the message is to be sent on. |
abstract MessageInfo |
streamNumber(int streamNumber)
Sets the stream number that the message is to be sent on. |
abstract long |
timeToLive()
The time period that the sending side may expire the message if it has not been sent, or 0 to indicate that no timeout should occur. |
abstract MessageInfo |
timeToLive(long millis)
Sets the time period that the sending side may expire the message if it has not been sent. |
abstract MessageInfo |
unordered(boolean unordered)
Sets whether or not the message is unordered. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected MessageInfo()
| Method Detail |
|---|
public static MessageInfo createOutGoing(SocketAddress address,
int streamNumber)
MessageInfo instance suitable for use when
sending a message.
The returned instance will have its unordered
value set to false, its timeToLive value
set to 0, its complete value set
to true, and its payloadProtocolID
value set to 0. These values, if required, can be set through
the appropriate setter method before sending the message.
address - For a connected SctpChannel the address is the
preferred peer address of the association to send the message
to, or null to use the peer primary address. For an
SctpMultiChannel the address used to determine
the association, or if no association exists with a peer of that
address then one is setup.streamNumber - The stream number that the message will be sent on
IllegalArgumentException - If the streamNumber is negative or greater than 65536
public static MessageInfo createOutGoing(Association association,
SocketAddress address,
int streamNumber)
MessageInfo instance suitable for use when
sending a message to a given association. Typically used for
SctpMultiChannel when an association has already been setup.
The returned instance will have its unordered
value set to false, its timeToLive value
set to 0, its complete value set
to true, and its payloadProtocolID
value set to 0. These values, if required, can be set through
the appropriate setter method before sending the message.
association - The association to send the message onaddress - The preferred peer address of the association to send the message
to, or null to use the peer primary addressstreamNumber - The stream number that the message will be sent on.
IllegalArgumentException - If association is null, or the streamNumber is
negative or greater than 65536public abstract SocketAddress address()
null if this instance is to be
used for sending a message and has been construced without
specifying a preferred destination addresspublic abstract Association association()
null if this instance is to be
used for sending a message and has been construced using the
the createOutGoing(SocketAddress,int) static factory methodpublic abstract int bytes()
This method is only appicable for received messages, it has no meaning for messages being sent.
-1 if the channel is an SctpChannel that has reached end-of-stream, otherwise
0public abstract boolean isComplete()
For received messages true indicates that the message was
completely received. For messages being sent true indicates that
the message is complete, false indicates that the message is not
complete. How the send channel interprets this value depends on the value
of its SCTP_EXPLICIT_COMPLETE socket option.
true if, and only if, the message is completepublic abstract MessageInfo complete(boolean complete)
For messages being sent true indicates that
the message is complete, false indicates that the message is not
complete. How the send channel interprets this value depends on the value
of its SCTP_EXPLICIT_COMPLETE socket option.
complete - true if, and only if, the message is complete
isComplete()public abstract boolean isUnordered()
true indicates that the message was sent non-ordered. For
messages begin sent true requests the un-ordered delivery of the
message, false indicates that the message is ordered.
true if the message is unordered, otherwise
falsepublic abstract MessageInfo unordered(boolean unordered)
unordered - true requests the un-ordered delivery of the message,
false indicates that the message is ordered.
isUnordered()public abstract int payloadProtocolID()
A value indicating the type of payload protocol data being
transmitted/received. This value is passed as opaque data by SCTP.
0 indicates an unspecified payload protocol identifier.
public abstract MessageInfo payloadProtocolID(int ppid)
A value indicating the type of payload protocol data being transmitted. This value is passed as opaque data by SCTP.
ppid - The Payload Protocol Identifier, or 0 indicate an
unspecified payload protocol identifier.
payloadProtocolID()public abstract int streamNumber()
public abstract MessageInfo streamNumber(int streamNumber)
streamNumber - The stream number
IllegalArgumentException - If the streamNumber is negative or greater than 65536public abstract long timeToLive()
0 to indicate that no timeout should occur. This
value is only applicable for messages being sent, it has no meaning for
received messages.
0public abstract MessageInfo timeToLive(long millis)
millis - The time period in milliseconds, or 0 to indicate that no
timeout should occur
timeToLive()
|
JavaTM SCTP API DRAFT ea-b10 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||