Class Oort.CloudListener

  • All Implemented Interfaces:
    java.util.EventListener, Bayeux.BayeuxListener, ConfigurableServerChannel.ServerChannelListener, ServerChannel.MessageListener
    Enclosing class:

    protected class Oort.CloudListener
    extends java.lang.Object
    implements ServerChannel.MessageListener

    This listener handles messages sent to /oort/cloud that contains the list of comets connected to the Oort that just joined the cloud.

    For example, if comets A and B are connected, and if comets C and D are connected, when connecting A and C, a message is sent from A to C on /oort/cloud containing the comets connected to A (in this case B). When C receives this message, it knows it has to connect to B also.

    • Constructor Detail

      • CloudListener

        protected CloudListener()
    • Method Detail

      • onMessage

        public boolean onMessage​(ServerSession from,
                                 ServerChannel channel,
                                 ServerMessage.Mutable message)
        Description copied from interface: ServerChannel.MessageListener

        Callback invoked when a message is being published.

        Implementers can decide to return false to signal that the message should not be published.

        Specified by:
        onMessage in interface ServerChannel.MessageListener
        from - the session that publishes the message
        channel - the channel the message is published to
        message - the message to be published
        whether the message should be published or not