Interface ServerSession.Extension
- Enclosing interface:
ServerSession
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.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidincoming(ServerSession session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<Boolean> promise) Callback method invoked every time a message is incoming.default voidoutgoing(ServerSession sender, ServerSession session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise) Callback method invoked every time a message is outgoing.default booleanrcv(ServerSession session, ServerMessage.Mutable message) Blocking version ofincoming(ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.default booleanrcvMeta(ServerSession session, ServerMessage.Mutable message) Blocking version ofincoming(ServerSession, ServerMessage.Mutable, Promise)for meta messages.default ServerMessagesend(ServerSession sender, ServerSession session, ServerMessage message) Blocking version ofoutgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.default booleansendMeta(ServerSession sender, ServerSession session, ServerMessage.Mutable message) Blocking version ofoutgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for meta messages.
-
Method Details
-
incoming
default void incoming(ServerSession session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<Boolean> promise) Callback method invoked every time a message is incoming.
- Parameters:
session- the session that sent the messagemessage- the incoming messagepromise- the promise to notify whether message processing should continue
-
rcv
Blocking version of
incoming(ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.- Parameters:
session- the session that sent the messagemessage- the incoming message- Returns:
- whether message processing should continue
-
rcvMeta
Blocking version of
incoming(ServerSession, ServerMessage.Mutable, Promise)for meta messages.- Parameters:
session- the session that sent the messagemessage- the incoming message- Returns:
- whether message processing should continue
-
outgoing
default void outgoing(ServerSession sender, ServerSession session, ServerMessage.Mutable message, org.cometd.bayeux.Promise<ServerMessage.Mutable> promise) Callback method invoked every time a message is outgoing.
- Parameters:
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 message
-
send
Blocking version of
outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for non-meta messages.- Parameters:
sender- the session that sent the message or nullsession- the session receiving the messagemessage- the outgoing message- Returns:
- the message to send or null to not send the message
-
sendMeta
default boolean sendMeta(ServerSession sender, ServerSession session, ServerMessage.Mutable message) Blocking version of
outgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)for meta messages.- Parameters:
sender- the session that sent the message or nullsession- the session receiving the messagemessage- the outgoing message- Returns:
- whether message processing should continue
-