Package org.drasyl.remote.handler
Class ArmHandler
- java.lang.Object
-
- org.drasyl.pipeline.skeleton.HandlerAdapter
-
- org.drasyl.pipeline.skeleton.AddressHandlerAdapter<A>
-
- org.drasyl.pipeline.skeleton.SimpleInboundEventAwareHandler<I,E,A>
-
- org.drasyl.pipeline.skeleton.SimpleDuplexEventAwareHandler<I,Event,O,A>
-
- org.drasyl.pipeline.skeleton.SimpleDuplexHandler<AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,Address>
-
- org.drasyl.remote.handler.ArmHandler
-
- All Implemented Interfaces:
Handler
public final class ArmHandler extends SimpleDuplexHandler<AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,Address>
Arms (sign/encrypt) outbound and disarms (verify/decrypt) inbound messages. Considers only messages that are addressed from or to us. Messages that could not be (dis)armed) are dropped.
-
-
Field Summary
Fields Modifier and Type Field Description static String
ARM_HANDLER
static ArmHandler
INSTANCE
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
matchedRead(HandlerContext ctx, Address sender, AddressedIntermediateEnvelope<com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
Is called for each message of typeSimpleInboundEventAwareHandler
.protected void
matchedWrite(HandlerContext ctx, Address recipient, AddressedIntermediateEnvelope<com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
Is called for each message of typeSimpleDuplexEventAwareHandler
.-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleDuplexHandler
eventTriggered, matchedEventTriggered
-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleDuplexEventAwareHandler
acceptOutbound, write
-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleInboundEventAwareHandler
acceptEvent, acceptInbound, read
-
Methods inherited from class org.drasyl.pipeline.skeleton.AddressHandlerAdapter
acceptAddress
-
Methods inherited from class org.drasyl.pipeline.skeleton.HandlerAdapter
exceptionCaught, handlerAdded, handlerRemoved
-
-
-
-
Field Detail
-
INSTANCE
public static final ArmHandler INSTANCE
-
ARM_HANDLER
public static final String ARM_HANDLER
- See Also:
- Constant Field Values
-
-
Method Detail
-
matchedRead
protected void matchedRead(HandlerContext ctx, Address sender, AddressedIntermediateEnvelope<com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
Description copied from class:SimpleInboundEventAwareHandler
Is called for each message of typeSimpleInboundEventAwareHandler
.- Specified by:
matchedRead
in classSimpleInboundEventAwareHandler<AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,Event,Address>
- Parameters:
ctx
- handler contextsender
- the sender of the messagemsg
- the messagefuture
- the future of the message
-
matchedWrite
protected void matchedWrite(HandlerContext ctx, Address recipient, AddressedIntermediateEnvelope<com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
Description copied from class:SimpleDuplexEventAwareHandler
Is called for each message of typeSimpleDuplexEventAwareHandler
.- Specified by:
matchedWrite
in classSimpleDuplexEventAwareHandler<AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,Event,AddressedIntermediateEnvelope<com.google.protobuf.MessageLite>,Address>
- Parameters:
ctx
- handler contextrecipient
- the recipient of the messagemsg
- the messagefuture
- a future for the message
-
-