javax.websocket

## Interface Session

All Superinterfaces:
  java.lang.AutoCloseable, java.io.Closeable

    public interface Session
    extends java.io.Closeable

### Method Summary

Methods
`void` `addMessageHandler(MessageHandler listener)`
`void` `close()` Close the connection to the remote end point using the code `CloseReason.CloseCodes.NORMAL_CLOSURE` and an empty reason phrase.
`void` `close(CloseReason closeStatus)` Close the connection to the remote end point using the specified code and reason phrase.
`RemoteEndpoint.Async` `getAsyncRemote()`
`RemoteEndpoint.Basic` `getBasicRemote()`
`WebSocketContainer` `getContainer()` Returns the container that created this session.
`java.lang.String` `getId()` Provides a unique identifier for the session.
`int` `getMaxBinaryMessageBufferSize()` Get the current maximum buffer size (in bytes) for binary messages.
`long` `getMaxIdleTimeout()` Get the idle timeout for this session in milliseconds.
`int` `getMaxTextMessageBufferSize()` Get the current maximum buffer size (in characters) for text messages.
`java.util.Set<MessageHandler>` `getMessageHandlers()`
`java.util.List<Extension>` `getNegotiatedExtensions()`
`java.lang.String` `getNegotiatedSubprotocol()`
`java.util.Set<Session>` `getOpenSessions()` Obtain the set of currently open sessions for the local endpoint that this session is associated with.
`java.util.Map<java.lang.String,java.lang.String>` `getPathParameters()`
`java.lang.String` `getProtocolVersion()`
`java.lang.String` `getQueryString()`
`java.util.Map<java.lang.String,java.util.List<java.lang.String>>` `getRequestParameterMap()`
`java.net.URI` `getRequestURI()`
`java.security.Principal` `getUserPrincipal()`
`java.util.Map<java.lang.String,java.lang.Object>` `getUserProperties()`
`boolean` `isOpen()`
`boolean` `isSecure()`
`void` `removeMessageHandler(MessageHandler listener)`
`void` `setMaxBinaryMessageBufferSize(int max)` Set the current maximum buffer size (in bytes) for binary messages.
`void` `setMaxIdleTimeout(long seconds)` Set the idle timeout for this session in milliseconds.
`void` `setMaxTextMessageBufferSize(int max)` Set the current maximum buffer size (in characters) for text messages.

### Method Detail

#### getContainer

    WebSocketContainer getContainer()

Returns the container that created this session.

#### addMessageHandler

    void addMessageHandler(MessageHandler listener)
                           throws java.lang.IllegalStateException

Throws:
  `java.lang.IllegalStateException`

#### getMessageHandlers

    java.util.Set<MessageHandler> getMessageHandlers()

#### removeMessageHandler

    void removeMessageHandler(MessageHandler listener)

#### getProtocolVersion

    java.lang.String getProtocolVersion()

#### getNegotiatedSubprotocol

    java.lang.String getNegotiatedSubprotocol()

#### getNegotiatedExtensions

    java.util.List<Extension> getNegotiatedExtensions()

#### isSecure

    boolean isSecure()

#### isOpen

    boolean isOpen()

#### getMaxIdleTimeout

    long getMaxIdleTimeout()

Get the idle timeout for this session in milliseconds. Zero or negative values indicate an infinite timeout.

#### setMaxIdleTimeout

    void setMaxIdleTimeout(long seconds)

Set the idle timeout for this session in milliseconds. Zero or negative values indicate an infinite timeout.

#### setMaxBinaryMessageBufferSize

    void setMaxBinaryMessageBufferSize(int max)

Set the current maximum buffer size (in bytes) for binary messages.

#### getMaxBinaryMessageBufferSize

    int getMaxBinaryMessageBufferSize()

Get the current maximum buffer size (in bytes) for binary messages.

#### setMaxTextMessageBufferSize

    void setMaxTextMessageBufferSize(int max)

Set the current maximum buffer size (in characters) for text messages.

#### getMaxTextMessageBufferSize

    int getMaxTextMessageBufferSize()

Get the current maximum buffer size (in characters) for text messages.

#### getAsyncRemote

    RemoteEndpoint.Async getAsyncRemote()

#### getBasicRemote

    RemoteEndpoint.Basic getBasicRemote()

#### getId

    java.lang.String getId()

Provides a unique identifier for the session. This identifier should not be relied upon to be generated from a secure random source.

#### close

    void close()
               throws java.io.IOException

Close the connection to the remote end point using the code `CloseReason.CloseCodes.NORMAL_CLOSURE` and an empty reason phrase.

Specified by:
  `close` in interface `java.lang.AutoCloseable`
Specified by:
  `close` in interface `java.io.Closeable`
Throws:
  `java.io.IOException`

#### close

    void close(CloseReason closeStatus)
               throws java.io.IOException

Close the connection to the remote end point using the specified code and reason phrase.

Throws:
  `java.io.IOException`

#### getRequestURI

    java.net.URI getRequestURI()

#### getRequestParameterMap

    java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRequestParameterMap()

#### getQueryString

    java.lang.String getQueryString()

#### getPathParameters

    java.util.Map<java.lang.String,java.lang.String> getPathParameters()

#### getUserProperties

    java.util.Map<java.lang.String,java.lang.Object> getUserProperties()

#### getUserPrincipal

    java.security.Principal getUserPrincipal()

#### getOpenSessions

    java.util.Set<Session> getOpenSessions()

Obtain the set of currently open sessions for the local endpoint that this session is associated with.