Class JavaxWebSocketSession

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, javax.websocket.Session

    public class JavaxWebSocketSession
    extends java.lang.Object
    implements javax.websocket.Session
    Client Session for the JSR.
    • Method Detail

      • addMessageHandler

        public <T> void addMessageHandler​(java.lang.Class<T> clazz,
                                          javax.websocket.MessageHandler.Partial<T> handler)
        Specified by:
        addMessageHandler in interface javax.websocket.Session
        Since:
        JSR356 v1.1
        See Also:
        Session.addMessageHandler(Class, MessageHandler.Partial)
      • addMessageHandler

        public <T> void addMessageHandler​(java.lang.Class<T> clazz,
                                          javax.websocket.MessageHandler.Whole<T> handler)
        Specified by:
        addMessageHandler in interface javax.websocket.Session
        Since:
        JSR356 v1.1
        See Also:
        Session.addMessageHandler(Class, MessageHandler.Whole)
      • addMessageHandler

        public void addMessageHandler​(javax.websocket.MessageHandler handler)
                               throws java.lang.IllegalStateException
        Specified by:
        addMessageHandler in interface javax.websocket.Session
        Throws:
        java.lang.IllegalStateException
        Since:
        JSR356 v1.0
        See Also:
        Session.addMessageHandler(MessageHandler)
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.close()
      • close

        public void close​(javax.websocket.CloseReason closeReason)
        Specified by:
        close in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.close(CloseReason)
      • filterReturnType

        public void filterReturnType​(java.lang.Object obj)
        Access for MethodHandle implementations to filter the return value of user provided TEXT/BINARY based message handling methods.
        Parameters:
        obj - the return object
      • getAsyncRemote

        public javax.websocket.RemoteEndpoint.Async getAsyncRemote()
        Specified by:
        getAsyncRemote in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getAsyncRemote()
      • getBasicRemote

        public javax.websocket.RemoteEndpoint.Basic getBasicRemote()
        Specified by:
        getBasicRemote in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getBasicRemote()
      • getContainer

        public javax.websocket.WebSocketContainer getContainer()
        Specified by:
        getContainer in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getContainer()
      • getEndpoint

        public java.lang.Object getEndpoint()
      • abort

        public void abort()
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getId()
      • getMaxBinaryMessageBufferSize

        public int getMaxBinaryMessageBufferSize()
        Specified by:
        getMaxBinaryMessageBufferSize in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getMaxBinaryMessageBufferSize()
      • setMaxBinaryMessageBufferSize

        public void setMaxBinaryMessageBufferSize​(int length)
        Maximum size of a whole BINARY message that this implementation can buffer.
        Specified by:
        setMaxBinaryMessageBufferSize in interface javax.websocket.Session
        Parameters:
        length - the length in bytes
        Since:
        JSR356 v1.0
        See Also:
        Session.setMaxBinaryMessageBufferSize(int)
      • getMaxIdleTimeout

        public long getMaxIdleTimeout()
        Specified by:
        getMaxIdleTimeout in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getMaxIdleTimeout()
      • setMaxIdleTimeout

        public void setMaxIdleTimeout​(long milliseconds)
        Specified by:
        setMaxIdleTimeout in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.setMaxIdleTimeout(long)
      • getMaxTextMessageBufferSize

        public int getMaxTextMessageBufferSize()
        Specified by:
        getMaxTextMessageBufferSize in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getMaxTextMessageBufferSize()
      • setMaxTextMessageBufferSize

        public void setMaxTextMessageBufferSize​(int length)
        Maximum size of a whole TEXT message that this implementation can buffer.
        Specified by:
        setMaxTextMessageBufferSize in interface javax.websocket.Session
        Parameters:
        length - the length in bytes
        Since:
        JSR356 v1.0
        See Also:
        Session.setMaxTextMessageBufferSize(int)
      • getMessageHandlers

        public java.util.Set<javax.websocket.MessageHandler> getMessageHandlers()
        Specified by:
        getMessageHandlers in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getMessageHandlers()
      • getNegotiatedExtensions

        public java.util.List<javax.websocket.Extension> getNegotiatedExtensions()
        Specified by:
        getNegotiatedExtensions in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getNegotiatedExtensions()
      • getNegotiatedSubprotocol

        public java.lang.String getNegotiatedSubprotocol()
        Specified by:
        getNegotiatedSubprotocol in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getNegotiatedSubprotocol()
      • getOpenSessions

        public java.util.Set<javax.websocket.Session> getOpenSessions()
        Specified by:
        getOpenSessions in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getOpenSessions()
      • getPathParameters

        public java.util.Map<java.lang.String,​java.lang.String> getPathParameters()
        Specified by:
        getPathParameters in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getPathParameters()
      • getProtocolVersion

        public java.lang.String getProtocolVersion()
        Specified by:
        getProtocolVersion in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getProtocolVersion()
      • getQueryString

        public java.lang.String getQueryString()
        Specified by:
        getQueryString in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getQueryString()
      • getRequestParameterMap

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getRequestParameterMap()
        Specified by:
        getRequestParameterMap in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getRequestParameterMap()
      • getRequestURI

        public java.net.URI getRequestURI()
        Specified by:
        getRequestURI in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        )
      • getUserPrincipal

        public java.security.Principal getUserPrincipal()
        Specified by:
        getUserPrincipal in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getUserPrincipal()
      • getUserProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getUserProperties()
        Specified by:
        getUserProperties in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.getUserProperties()
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.isOpen()
      • isSecure

        public boolean isSecure()
        Specified by:
        isSecure in interface javax.websocket.Session
        Since:
        JSR356 v1.0
        See Also:
        Session.isSecure()
      • removeMessageHandler

        public void removeMessageHandler​(javax.websocket.MessageHandler handler)
        Specified by:
        removeMessageHandler in interface javax.websocket.Session
      • toString

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