Class LocalSessionImpl

    • Constructor Detail

      • LocalSessionImpl

        public LocalSessionImpl​(BayeuxServerImpl bayeux,
                                java.lang.String idHint)
    • Method Detail

      • handshake

        public void handshake​(java.util.Map<java.lang.String,​java.lang.Object> template,
                              ClientSession.MessageListener callback)
        Description copied from interface: ClientSession

        Initiates the bayeux protocol handshake with the server(s).

        The handshake initiated by this method is asynchronous and does not wait for the handshake response.

        Specified by:
        handshake in interface ClientSession
        Parameters:
        template - additional fields to add to the handshake message.
        callback - the message listener to notify of the handshake result
      • disconnect

        public void disconnect​(ClientSession.MessageListener callback)
        Description copied from interface: ClientSession

        Disconnects this session, ending the link between the client and the server peers.

        Specified by:
        disconnect in interface ClientSession
        Parameters:
        callback - the message listener to notify of the disconnect result
      • getId

        public java.lang.String getId()
        Description copied from interface: Session

        The clientId of the session.

        This would more correctly be called a "sessionId", but for backwards compatibility with the Bayeux protocol, it is a field called "clientId" that identifies a session.

        Specified by:
        getId in interface Session
        Returns:
        the id of this session
      • isConnected

        public boolean isConnected()
        Description copied from interface: Session

        A connected session is a session where the link between the client and the server has been established.

        Specified by:
        isConnected in interface Session
        Returns:
        whether the session is connected
        See Also:
        Session.disconnect()
      • isHandshook

        public boolean isHandshook()
        Description copied from interface: Session

        A handshook session is a session where the handshake has successfully completed

        Specified by:
        isHandshook in interface Session
        Returns:
        whether the session is handshook
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • send

        protected void send​(ServerSessionImpl session,
                            ServerMessage.Mutable message)

        Enqueues or sends a message to the server.

        This method will either enqueue the message, if this session is batching, or perform the send immediately.

        Parameters:
        session - The ServerSession to send as. This normally the current server session, but during handshake it is a proposed server session.
        message - The message to send.