Package org.drasyl.remote.handler
Class ChunkingHandler
- 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<? extends com.google.protobuf.MessageLite>,AddressedIntermediateEnvelope<? extends com.google.protobuf.MessageLite>,Address>
-
- org.drasyl.remote.handler.ChunkingHandler
-
- All Implemented Interfaces:
Handler
public class ChunkingHandler extends SimpleDuplexHandler<AddressedIntermediateEnvelope<? extends com.google.protobuf.MessageLite>,AddressedIntermediateEnvelope<? extends com.google.protobuf.MessageLite>,Address>
This handler is responsible for merging incoming message chunks into a single message as well as splitting outgoing too large messages into chunks.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CHUNKING_HANDLER
-
Constructor Summary
Constructors Constructor Description ChunkingHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
matchedRead(HandlerContext ctx, Address sender, AddressedIntermediateEnvelope<? extends com.google.protobuf.MessageLite> msg, CompletableFuture<Void> future)
Is called for each message of typeSimpleInboundEventAwareHandler
.protected void
matchedWrite(HandlerContext ctx, Address recipient, AddressedIntermediateEnvelope<? extends 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
-
CHUNKING_HANDLER
public static final String CHUNKING_HANDLER
- See Also:
- Constant Field Values
-
-
Method Detail
-
matchedRead
protected void matchedRead(HandlerContext ctx, Address sender, AddressedIntermediateEnvelope<? extends 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<? extends 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<? extends 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<? extends com.google.protobuf.MessageLite>,Event,AddressedIntermediateEnvelope<? extends com.google.protobuf.MessageLite>,Address>
- Parameters:
ctx
- handler contextrecipient
- the recipient of the messagemsg
- the messagefuture
- a future for the message
-
-