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.
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.
session
- the session that sent the messagemessage
- the incoming messagedefault boolean rcvMeta(ServerSession session, ServerMessage.Mutable message)
Blocking version of incoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
session
- the session that sent the messagemessage
- the incoming messagedefault void outgoing(ServerSession sender, ServerSession session, ServerMessage.Mutable message, Promise<ServerMessage.Mutable> promise)
Callback method invoked every time a message is outgoing.
sender
- the session that sent the message or nullsession
- 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 sender, ServerSession session, ServerMessage message)
Blocking version of outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.
sender
- the session that sent the message or nullsession
- the session receiving the messagemessage
- the outgoing messagedefault boolean sendMeta(ServerSession sender, ServerSession session, ServerMessage.Mutable message)
Blocking version of outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for meta messages.
sender
- the session that sent the message or nullsession
- the session receiving the messagemessage
- the outgoing messageCopyright © 2008–2024 The CometD Project. All rights reserved.