ServerSession.Extension.Adapter
public static interface ServerSession.Extension
Extension API for ServerSession
.
Implementations of this interface allow to modify incoming and outgoing messages
for a particular session, before any other processing performed by the implementation
but after BayeuxServer.Extension
processing.
Multiple extensions can be registered; the extension receive methods are invoked in registration order, while the extension send methods are invoked in registration reverse order.
Modifier and Type | Interface | Description |
---|---|---|
static class |
ServerSession.Extension.Adapter |
Deprecated.
|
Modifier and Type | Method | Description |
---|---|---|
default void |
incoming(ServerSession session,
ServerMessage.Mutable message,
Promise<Boolean> promise) |
Callback method invoked every time a message is incoming.
|
default void |
outgoing(ServerSession session,
ServerMessage.Mutable message,
Promise<ServerMessage.Mutable> promise) |
Callback method invoked every time a message is outgoing.
|
default boolean |
rcv(ServerSession session,
ServerMessage.Mutable message) |
Blocking version of
incoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages. |
default boolean |
rcvMeta(ServerSession session,
ServerMessage.Mutable message) |
Blocking version of
incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages. |
default ServerMessage |
send(ServerSession session,
ServerMessage message) |
Blocking version of
outgoing(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages. |
default boolean |
sendMeta(ServerSession session,
ServerMessage.Mutable message) |
Blocking version of
outgoing(ServerSession, ServerMessage.Mutable, Promise)
for meta messages. |
default void incoming(ServerSession session, ServerMessage.Mutable message, Promise<Boolean> promise)
Callback method invoked every time a message is incoming.
session
- the session that sent the messagemessage
- the incoming messagepromise
- the promise to notify whether message processing should continuedefault boolean rcv(ServerSession session, ServerMessage.Mutable message)
Blocking version of incoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
default boolean rcvMeta(ServerSession session, ServerMessage.Mutable message)
Blocking version of incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
default void outgoing(ServerSession session, ServerMessage.Mutable message, Promise<ServerMessage.Mutable> promise)
Callback method invoked every time a message is outgoing.
session
- the session receiving the messagemessage
- the outgoing messagepromise
- the promise to notify with the message to send or null to not send the messagedefault ServerMessage send(ServerSession session, ServerMessage message)
Blocking version of outgoing(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
default boolean sendMeta(ServerSession session, ServerMessage.Mutable message)
Blocking version of outgoing(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
Copyright © 2008–2017 The CometD Project. All rights reserved.