Interface FullReadMessage<T extends FullReadMessage<?>>
- All Superinterfaces:
RemoteMessage
- All Known Implementing Classes:
AcknowledgementMessage
,ApplicationMessage
,HelloMessage
,UniteMessage
Describes a message whose content has been read completely. This is the case for unencrypted or
decrypted messages.
- See Also:
-
Field Summary
Fields inherited from interface org.drasyl.handler.remote.protocol.RemoteMessage
MAGIC_NUMBER
-
Method Summary
Modifier and TypeMethodDescriptionarm
(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) Returns an armed version (ArmedProtocolMessage
) of this message for sending it through untrustworthy channels.Returns theIdentityPublicKey
of the message recipient.Returns this message with incremented hop count.Methods inherited from interface org.drasyl.handler.remote.protocol.RemoteMessage
getArmed, getHopCount, getNetworkId, getNonce, getProofOfWork, getSender, writeTo
-
Method Details
-
getRecipient
DrasylAddress getRecipient()Returns theIdentityPublicKey
of the message recipient.- Specified by:
getRecipient
in interfaceRemoteMessage
- Returns:
- the
IdentityPublicKey
of the message recipient
-
incrementHopCount
T incrementHopCount()Returns this message with incremented hop count.- Specified by:
incrementHopCount
in interfaceRemoteMessage
- Returns:
- this message with incremented hop count.
- Throws:
IllegalStateException
- if hop count overflows
-
arm
ArmedProtocolMessage arm(io.netty.buffer.ByteBufAllocator alloc, Crypto cryptoInstance, SessionPair sessionPair) throws InvalidMessageFormatException Returns an armed version (ArmedProtocolMessage
) of this message for sending it through untrustworthy channels.- Parameters:
alloc
-cryptoInstance
- the crypto instance that should be usedsessionPair
- will be used for encryption- Returns:
- the armed version of this message
- Throws:
InvalidMessageFormatException
- if arming was not possible
-