javax.net.websocket
Interface ClientContainer

All Known Subinterfaces:
ServerContainer
All Known Implementing Classes:
ClientManager, TyrusServerContainer

public interface ClientContainer

A ClientContainer is an implementation provided object that allows the developer to initiate a web socket handshake from the provided endpoint.

Since:
DRAFT 001
Author:
dannycoward

Method Summary
 void connectToServer(Endpoint endpoint, ClientEndpointConfiguration olc)
          Connect the supplied endpoint to its server using the supplied handshake parameters
 Set<Session> getActiveSessions()
          Return a copy of the Set of the currently active web socket sessions.
 Set<String> getInstalledExtensions()
          Return the set of Extensions installed in the container.
 long getMaxBinaryMessageBufferSize()
          Returns the maximum size of binary message that this container will buffer.
 long getMaxSessionIdleTimeout()
          Return the maximum time in seconds that a web socket session may be idle before the container may close it.
 long getMaxTextMessageBufferSize()
          Sets the maximum size of text message that this container will buffer.
 void setMaxBinaryMessageBufferSize(long max)
          Sets the maximum size of binary message that this container will buffer.
 void setMaxSessionIdleTimeout(long timeout)
          Sets the maximum time that a web socket session may be idle before the container may close it.
 void setMaxTextMessageBufferSize(long max)
          Sets the maximum size of text message that this container will buffer.
 

Method Detail

connectToServer

void connectToServer(Endpoint endpoint,
                     ClientEndpointConfiguration olc)
                     throws ConnectException
Connect the supplied endpoint to its server using the supplied handshake parameters

Parameters:
endpoint - the endpoint which will be connected to the server
olc - the client configuration used to connect the client
Throws:
ConnectException

getActiveSessions

Set<Session> getActiveSessions()
Return a copy of the Set of the currently active web socket sessions. These sessions may not still be active at any point after the return of this method, for example, Iterating over the set at a later time may yield closed session. Use session.isActive() to check.

Returns:
the set of sessions, active at the time of return.

getMaxSessionIdleTimeout

long getMaxSessionIdleTimeout()
Return the maximum time in seconds that a web socket session may be idle before the container may close it.

Returns:
the number of seconds idle wed socket sessions are active

setMaxSessionIdleTimeout

void setMaxSessionIdleTimeout(long timeout)
Sets the maximum time that a web socket session may be idle before the container may close it.

Parameters:
the - maximum time in seconds.

getMaxBinaryMessageBufferSize

long getMaxBinaryMessageBufferSize()
Returns the maximum size of binary message that this container will buffer.

Returns:
the maximum size of binary message in number of bytes

setMaxBinaryMessageBufferSize

void setMaxBinaryMessageBufferSize(long max)
Sets the maximum size of binary message that this container will buffer.

Parameters:
the - maximum size of binary message in number of bytes

getMaxTextMessageBufferSize

long getMaxTextMessageBufferSize()
Sets the maximum size of text message that this container will buffer.

Returns:
the maximum size of text message in number of bytes

setMaxTextMessageBufferSize

void setMaxTextMessageBufferSize(long max)
Sets the maximum size of text message that this container will buffer.

Parameters:
the - maximum size of text message in number of bytes

getInstalledExtensions

Set<String> getInstalledExtensions()
Return the set of Extensions installed in the container.

Returns:
the set of extensions.


Copyright © 2012. All Rights Reserved.