Interface ServerSession.Extension
- All Known Implementing Classes:
AcknowledgedMessagesSessionExtension
,ActivityExtension.SessionExtension
,BinarySessionExtension
- 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.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
incoming
(ServerSession session, ServerMessage.Mutable message, Promise<Boolean> promise) Callback method invoked every time a message is incoming.default void
outgoing
(ServerSession sender, 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 ofincoming(ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.default boolean
rcvMeta
(ServerSession session, ServerMessage.Mutable message) Blocking version ofincoming(ServerSession, ServerMessage.Mutable, Promise)
for meta messages.default ServerMessage
send
(ServerSession sender, ServerSession session, ServerMessage message) Blocking version ofoutgoing(ServerSession, ServerSession, ServerMessage.Mutable, Promise)
for non-meta messages.default boolean
sendMeta
(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, 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, 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
-