Class WebSocketContext

    • Constructor Detail

      • WebSocketContext

        public WebSocketContext​(String clientID,
                                javax.websocket.Session session)
        Constructs a message context, that interfaces a Client, identified by its id, with the corresponding WebSocket-Session and its HttpSession.
        Parameters:
        clientID - the id of the client
        session - the WebSocket-Session of the client
    • Method Detail

      • getSession

        public javax.websocket.Session getSession()
        Gets the WebSocket-Session associated with the message.
        Returns:
        WebSocket-Session associated with the message
      • getQueryString

        public String getQueryString()
        Description copied from interface: MessageContext
        Returns the query string contained in the message for this context.

        Example:

        • https://somepage.com/somesite?key=value
        • QueryString: key=value
        Specified by:
        getQueryString in interface MessageContext
        Returns:
        the query string
      • getRequestURI

        public String getRequestURI()
        Description copied from interface: MessageContext
        Returns the URI requested by the message for this context from the protocol up to the query string.

        Example:

        • https://somepage.com/somesite?key=value
        • RequestURI: somepage.com/somesite
        Specified by:
        getRequestURI in interface MessageContext
        Returns:
        the requested URI
      • getClientID

        public String getClientID()
        Description copied from interface: MessageContext
        Returns the client id of the client which did send the message associated with this message context.
        Specified by:
        getClientID in interface MessageContext
        Returns:
        the client id
      • getHTTPSession

        public javax.servlet.http.HttpSession getHTTPSession()
        Description copied from interface: MessageContext
        Returns the HttpSession of the message associated with this message context.
        Specified by:
        getHTTPSession in interface MessageContext
        Returns:
        the HttpSession