Package net.i2p.router
Class ClientMessage
java.lang.Object
net.i2p.router.ClientMessage
Wrap a message either destined for a local client or received from one.
Note that an outbound message may get routed as an inbound message
for local-local communication.
- Author:
- jrandom
-
Constructor Summary
ConstructorDescriptionClientMessage
(Destination toDest, Payload payload, SessionConfig config, Destination fromDest, MessageId msgID, long messageNonce, long expiration, int flags) For outbound (locally originated)ClientMessage
(Hash toDestHash, Payload payload) For inbound (from remote dest) -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the destination to which this message is directed.Retrieve the destination to which this message is directed.long
Expiration requested by the client that sent the message.int
getFlags()
Flags requested by the client that sent the message.Valid for outbound; null for inbound.Valid for outbound; null for inbound.long
Valid for outbound; 0 for inbound.Retrieve the payload of the message.Retrieve the session config of the client that sent the message.
-
Constructor Details
-
ClientMessage
public ClientMessage(Destination toDest, Payload payload, SessionConfig config, Destination fromDest, MessageId msgID, long messageNonce, long expiration, int flags) For outbound (locally originated)- Parameters:
msgID
- the router's ID for this messagemessageNonce
- the client's ID for this message- Since:
- 0.9.9
-
ClientMessage
For inbound (from remote dest)- Since:
- 0.9.9
-
-
Method Details
-
getPayload
Retrieve the payload of the message. All ClientMessage objects should have a payload -
getDestination
Retrieve the destination to which this message is directed. Valid for outbound; null for inbound. If null, use getDestinationHash() -
getFromDestination
Valid for outbound; null for inbound. -
getDestinationHash
Retrieve the destination to which this message is directed. Valid for inbound; null for outbound. If null, use getDestination() -
getMessageId
Valid for outbound; null for inbound. -
getMessageNonce
public long getMessageNonce()Valid for outbound; 0 for inbound.- Since:
- 0.9.14
-
getSenderConfig
Retrieve the session config of the client that sent the message. This will only be available if the client was local -
getExpiration
public long getExpiration()Expiration requested by the client that sent the message. This will only be available for locally originated messages. -
getFlags
public int getFlags()Flags requested by the client that sent the message. This will only be available for locally originated messages.- Since:
- 0.8.4
-