Interface Message
- All Known Subinterfaces:
RelayableMessage
,RequestMessage
,ResponseMessage<R>
- All Known Implementing Classes:
ApplicationMessage
,ErrorMessage
,IdentityMessage
,JoinMessage
,PingMessage
,PongMessage
,QuitMessage
,SignedMessage
,SuccessMessage
,WelcomeMessage
,WhoisMessage
public interface Message
Describes messages that are sent by the
Server
or a client.-
Method Summary
Modifier and TypeMethodDescriptionshort
Returns this message's hop count.getId()
Returns the unique id of this message.int
Returns the network the sender belongs to.Returns this message sender's proof of work.Returns this message's recipient.Returns this message's sender.Returns the user agent of the sender's node.void
Increases the message's hop count.
-
Method Details
-
getId
MessageId getId()Returns the unique id of this message. Each message generates a random id when it is created.- Returns:
- the unique id of this message. Each message generates a random id when it is created.
-
getUserAgent
String getUserAgent()Returns the user agent of the sender's node.- Returns:
- the user agent of the sender's node.
-
getNetworkId
int getNetworkId()Returns the network the sender belongs to.- Returns:
- the network the sender belongs to
-
getSender
CompressedPublicKey getSender()Returns this message's sender.- Returns:
- this message's sender.
-
getProofOfWork
ProofOfWork getProofOfWork()Returns this message sender's proof of work.- Returns:
- this message sender's proof of work.
-
getRecipient
CompressedPublicKey getRecipient()Returns this message's recipient.- Returns:
- this message's recipient.
-
getHopCount
short getHopCount()Returns this message's hop count. Starts at 0 and is incremented every time it is sent. Once the message reaches the limit defined in configdrasyl.message.hop-limit
it will be dropped.- Returns:
- this message's hop count.
-
incrementHopCount
void incrementHopCount()Increases the message's hop count.
-