Package org.drasyl.remote.handler.crypto
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<I,O,A>
-
- org.drasyl.pipeline.skeleton.SimpleDuplexRemoteEnvelopeSkipLoopbackHandler<RemoteEnvelope<? extends com.google.protobuf.MessageLite>,RemoteEnvelope<? extends com.google.protobuf.MessageLite>,Address>
-
- org.drasyl.remote.handler.crypto.ArmHandler
-
- All Implemented Interfaces:
Handler
public class ArmHandler extends SimpleDuplexRemoteEnvelopeSkipLoopbackHandler<RemoteEnvelope<? extends com.google.protobuf.MessageLite>,RemoteEnvelope<? extends com.google.protobuf.MessageLite>,Address>
Arms (encrypt) outbound and disarms (decrypt) inbound messages. Considers only messages that are addressed from or to us. Messages that could not be (dis-)armed are dropped.
-
-
Constructor Summary
Constructors Modifier Constructor Description ArmHandler(int maxSessionsCount, int maxAgreements, Duration expireAfter, Duration retryInterval)
protected
ArmHandler(Map<IdentityPublicKey,Session> sessions, Crypto crypto, int maxAgreements, Duration expireAfter, Duration retryInterval)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
filteredInbound(HandlerContext ctx, Address sender, RemoteEnvelope<? extends com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
This method gets called when the messages is not address to a loopback (from us to us).protected void
filteredOutbound(HandlerContext ctx, Address recipient, RemoteEnvelope<? extends com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
This method gets called when the messages is not address to a loopback (from us to us).-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleDuplexRemoteEnvelopeSkipLoopbackHandler
matchedInbound, matchedOutbound
-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleDuplexHandler
matchedEvent, onEvent
-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleDuplexEventAwareHandler
acceptOutbound, onOutbound
-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleInboundEventAwareHandler
acceptEvent, acceptInbound, onInbound
-
Methods inherited from class org.drasyl.pipeline.skeleton.AddressHandlerAdapter
acceptAddress
-
Methods inherited from class org.drasyl.pipeline.skeleton.HandlerAdapter
onAdded, onException, onRemoved
-
-
-
-
Method Detail
-
filteredOutbound
protected void filteredOutbound(HandlerContext ctx, Address recipient, RemoteEnvelope<? extends com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future) throws Exception
Description copied from class:SimpleDuplexRemoteEnvelopeSkipLoopbackHandler
This method gets called when the messages is not address to a loopback (from us to us).- Specified by:
filteredOutbound
in classSimpleDuplexRemoteEnvelopeSkipLoopbackHandler<RemoteEnvelope<? extends com.google.protobuf.MessageLite>,RemoteEnvelope<? extends com.google.protobuf.MessageLite>,Address>
- Parameters:
ctx
- the handler contextrecipient
- the recipient of the messagemsg
- the messagefuture
- the future to complete- Throws:
Exception
- if any error occurs
-
filteredInbound
protected void filteredInbound(HandlerContext ctx, Address sender, RemoteEnvelope<? extends com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future) throws Exception
Description copied from class:SimpleDuplexRemoteEnvelopeSkipLoopbackHandler
This method gets called when the messages is not address to a loopback (from us to us).- Specified by:
filteredInbound
in classSimpleDuplexRemoteEnvelopeSkipLoopbackHandler<RemoteEnvelope<? extends com.google.protobuf.MessageLite>,RemoteEnvelope<? extends com.google.protobuf.MessageLite>,Address>
- Parameters:
ctx
- the handler contextsender
- the sender of the messagemsg
- the messagefuture
- the future to complete- Throws:
Exception
- if any error occurs
-
-