org.glassfish.tyrus.client
Class ClientManager

java.lang.Object
  extended by org.glassfish.tyrus.client.ClientManager
All Implemented Interfaces:
ClientContainer

public class ClientManager
extends Object
implements ClientContainer

ClientManager implementation.

Author:
Stepan Kopriva (stepan.kopriva at oracle.com)

Method Summary
 void connectToServer(Endpoint endpoint, ClientEndpointConfiguration configuration)
          Connect the supplied endpoint to its server using the supplied handshake parameters
static ClientManager createClient()
           
static ClientManager createClient(String engineProviderClassname)
          Create new ClientManager instance.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createClient

public static ClientManager createClient()

createClient

public static ClientManager createClient(String engineProviderClassname)
Create new ClientManager instance.

Returns:
new ClientManager instance.

connectToServer

public void connectToServer(Endpoint endpoint,
                            ClientEndpointConfiguration configuration)
Description copied from interface: ClientContainer
Connect the supplied endpoint to its server using the supplied handshake parameters

Specified by:
connectToServer in interface ClientContainer
Parameters:
endpoint - the endpoint which will be connected to the server
configuration - the client configuration used to connect the client

getActiveSessions

public Set<Session> getActiveSessions()
Description copied from interface: ClientContainer
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.

Specified by:
getActiveSessions in interface ClientContainer
Returns:
the set of sessions, active at the time of return.

getMaxSessionIdleTimeout

public long getMaxSessionIdleTimeout()
Description copied from interface: ClientContainer
Return the maximum time in seconds that a web socket session may be idle before the container may close it.

Specified by:
getMaxSessionIdleTimeout in interface ClientContainer
Returns:
the number of seconds idle wed socket sessions are active

setMaxSessionIdleTimeout

public void setMaxSessionIdleTimeout(long timeout)
Description copied from interface: ClientContainer
Sets the maximum time that a web socket session may be idle before the container may close it.

Specified by:
setMaxSessionIdleTimeout in interface ClientContainer

getMaxBinaryMessageBufferSize

public long getMaxBinaryMessageBufferSize()
Description copied from interface: ClientContainer
Returns the maximum size of binary message that this container will buffer.

Specified by:
getMaxBinaryMessageBufferSize in interface ClientContainer
Returns:
the maximum size of binary message in number of bytes

setMaxBinaryMessageBufferSize

public void setMaxBinaryMessageBufferSize(long max)
Description copied from interface: ClientContainer
Sets the maximum size of binary message that this container will buffer.

Specified by:
setMaxBinaryMessageBufferSize in interface ClientContainer

getMaxTextMessageBufferSize

public long getMaxTextMessageBufferSize()
Description copied from interface: ClientContainer
Sets the maximum size of text message that this container will buffer.

Specified by:
getMaxTextMessageBufferSize in interface ClientContainer
Returns:
the maximum size of text message in number of bytes

setMaxTextMessageBufferSize

public void setMaxTextMessageBufferSize(long max)
Description copied from interface: ClientContainer
Sets the maximum size of text message that this container will buffer.

Specified by:
setMaxTextMessageBufferSize in interface ClientContainer

getInstalledExtensions

public Set<String> getInstalledExtensions()
Description copied from interface: ClientContainer
Return the set of Extensions installed in the container.

Specified by:
getInstalledExtensions in interface ClientContainer
Returns:
the set of extensions.


Copyright © 2012. All Rights Reserved.