Interface FullReadMessage<T extends FullReadMessage<?>>
-
- All Superinterfaces:
RemoteMessage
- All Known Implementing Classes:
AcknowledgementMessage
,ApplicationMessage
,HelloMessage
,UniteMessage
public interface FullReadMessage<T extends FullReadMessage<?>> extends RemoteMessage
Describes a message whose content has been read completely. This is the case for unencrypted or decrypted messages.- See Also:
PartialReadMessage
-
-
Field Summary
-
Fields inherited from interface org.drasyl.handler.remote.protocol.RemoteMessage
MAGIC_NUMBER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ArmedProtocolMessage
arm(io.netty.buffer.ByteBuf byteBuf, Crypto cryptoInstance, SessionPair sessionPair)
Returns an armed version (ArmedProtocolMessage
) of this message for sending it through untrustworthy channels.DrasylAddress
getRecipient()
Returns theIdentityPublicKey
of the message recipient.T
incrementHopCount()
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 Detail
-
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.ByteBuf byteBuf, Crypto cryptoInstance, SessionPair sessionPair) throws InvalidMessageFormatException
Returns an armed version (ArmedProtocolMessage
) of this message for sending it through untrustworthy channels.- Parameters:
byteBuf
- theByteBuf
to write throughcryptoInstance
- 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
-
-