Package org.drasyl.remote.handler
Class StaticRoutesHandler
- java.lang.Object
-
- org.drasyl.pipeline.skeleton.HandlerAdapter
-
- org.drasyl.pipeline.skeleton.AddressHandlerAdapter<A>
-
- org.drasyl.pipeline.skeleton.SimpleOutboundHandler<SerializedApplicationMessage,CompressedPublicKey>
-
- org.drasyl.remote.handler.StaticRoutesHandler
-
- All Implemented Interfaces:
Handler
public final class StaticRoutesHandler extends SimpleOutboundHandler<SerializedApplicationMessage,CompressedPublicKey>
This handler uses preconfigured static routes (DrasylConfig.getStaticRoutes(Config, String)
) to deliver messages.
-
-
Field Summary
Fields Modifier and Type Field Description static StaticRoutesHandler
INSTANCE
static String
STATIC_ROUTES_HANDLER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
eventTriggered(HandlerContext ctx, Event event, CompletableFuture<Void> future)
Gets called if aEvent
was emitted.protected void
matchedWrite(HandlerContext ctx, CompressedPublicKey recipient, SerializedApplicationMessage msg, CompletableFuture<Void> future)
Is called for each message of typeSimpleOutboundHandler
.-
Methods inherited from class org.drasyl.pipeline.skeleton.SimpleOutboundHandler
acceptOutbound, write
-
Methods inherited from class org.drasyl.pipeline.skeleton.AddressHandlerAdapter
acceptAddress
-
Methods inherited from class org.drasyl.pipeline.skeleton.HandlerAdapter
exceptionCaught, handlerAdded, handlerRemoved, read
-
-
-
-
Field Detail
-
INSTANCE
public static final StaticRoutesHandler INSTANCE
-
STATIC_ROUTES_HANDLER
public static final String STATIC_ROUTES_HANDLER
- See Also:
- Constant Field Values
-
-
Method Detail
-
eventTriggered
public void eventTriggered(HandlerContext ctx, Event event, CompletableFuture<Void> future)
Description copied from interface:Handler
Gets called if aEvent
was emitted.- Specified by:
eventTriggered
in interfaceHandler
- Overrides:
eventTriggered
in classHandlerAdapter
- Parameters:
ctx
- handler contextevent
- the eventfuture
- a future for the message
-
matchedWrite
protected void matchedWrite(HandlerContext ctx, CompressedPublicKey recipient, SerializedApplicationMessage msg, CompletableFuture<Void> future)
Description copied from class:SimpleOutboundHandler
Is called for each message of typeSimpleOutboundHandler
.- Specified by:
matchedWrite
in classSimpleOutboundHandler<SerializedApplicationMessage,CompressedPublicKey>
- Parameters:
ctx
- handler contextrecipient
- the recipient of the messagemsg
- the messagefuture
- a future for the message
-
-