AeroGear Netty SockJS Codec 0.11.0

org.jboss.aerogear.io.netty.handler.codec.sockjs
Class SockJsConfig

java.lang.Object
  extended by org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsConfig

public final class SockJsConfig
extends Object

Configuration for a SockJS Session.


Nested Class Summary
static class SockJsConfig.Builder
           
 
Method Summary
 boolean areCookiesNeeded()
          Determines if a JSESSIONID cookie will be set.
 long heartbeatInterval()
          A heartbeat interval.
 boolean isTls()
          Determines whether transport layer security (TLS) should be used.
 boolean isWebSocketEnabled()
          Determines whether WebSocket support will not be enabled.
 String keyStore()
          Returns the keystore to be used if transport layer security is enabled.
 String keyStorePassword()
          Returns the keystore password to be used if transport layer security is enabled.
 int maxStreamingBytesSize()
          The max number of types that a streaming transport protocol should allow to be returned before closing the connection, forcing the client to reconnect.
 String prefix()
          The prefix/name, of the SockJS service.
 long sessionTimeout()
          A time out for inactive sessions.
 String sockJsUrl()
          The url to the sock-js-.json.
 String toString()
           
 long webSocketHeartbeatInterval()
          The WebSocket heartbeat interval.
 Set<String> webSocketProtocol()
          If WebSockets are in use the this give the oppertunity to specify what 'WebSocket-Protocols' should be returned and supported by this SockJS session.
 String webSocketProtocolCSV()
          If WebSockets are in use the this give the oppertunity to specify what 'WebSocket-Protocols' should be returned and supported by this SockJS session.
static SockJsConfig.Builder withPrefix(String prefix)
          The prefix, or name, of the service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

prefix

public String prefix()
The prefix/name, of the SockJS service. For example, in the url "http://localhost/echo/111/12345/xhr", 'echo' is the prefix.

Returns:
String the prefix/name of the SockJS service.

isWebSocketEnabled

public boolean isWebSocketEnabled()
Determines whether WebSocket support will not be enabled.

Returns:
true if WebSocket support is enabled.

webSocketHeartbeatInterval

public long webSocketHeartbeatInterval()
The WebSocket heartbeat interval. This might be required in certain environments where idle connections are closed by a proxy. It is a separate value from the hearbeat that the streaming protocols use as it is often desirable to have a much larger value for it.

Returns:
long how often, in ms, that a WebSocket heartbeat should be sent

webSocketProtocol

public Set<String> webSocketProtocol()
If WebSockets are in use the this give the oppertunity to specify what 'WebSocket-Protocols' should be returned and supported by this SockJS session.

Returns:
Set<String> of WebSocket protocols supported.

webSocketProtocolCSV

public String webSocketProtocolCSV()
If WebSockets are in use the this give the oppertunity to specify what 'WebSocket-Protocols' should be returned and supported by this SockJS session.

Returns:
String A comma separated value String with the WebSocket protocols supported

areCookiesNeeded

public boolean areCookiesNeeded()
Determines if a JSESSIONID cookie will be set. This is used by some load balancers to enable session stickyness.

Returns:
true if a JSESSIONID cookie should be set.

sockJsUrl

public String sockJsUrl()
The url to the sock-js-.json. This is used by the 'prefix/iframe' protocol and the url is replaced in the script returned to the client. This allows for configuring the version of sockjs used. By default it is 'http://cdn.sockjs.org/sockjs-0.3.4.min.js'.

Returns:
String the url to the sockjs version to be used.

sessionTimeout

public long sessionTimeout()
A time out for inactive sessions.

Returns:
long the timeout in ms. The default is 5000ms.

heartbeatInterval

public long heartbeatInterval()
A heartbeat interval.

Returns:
long how often, in ms, that a heartbeat should be sent

maxStreamingBytesSize

public int maxStreamingBytesSize()
The max number of types that a streaming transport protocol should allow to be returned before closing the connection, forcing the client to reconnect. This is done so that the responseText in the XHR Object will not grow and be come an issue for the client. Instead, by forcing a reconnect the client will create a new XHR object and this can be see as a form of garbage collection.

Returns:
int the max number of bytes that can be written. Default is 131072.

isTls

public boolean isTls()
Determines whether transport layer security (TLS) should be used.

Returns:
true if transport layer security should be used.

keyStore

public String keyStore()
Returns the keystore to be used if transport layer security is enabled.

Returns:
String the path to the keystore to be used

keyStorePassword

public String keyStorePassword()
Returns the keystore password to be used if transport layer security is enabled.

Returns:
String the password to the configured keystore

toString

public String toString()
Overrides:
toString in class Object

withPrefix

public static SockJsConfig.Builder withPrefix(String prefix)
The prefix, or name, of the service. For example, in the url "http://localhost/echo/111/12345/xhr", 'echo' is the prefix.

Parameters:
prefix - the prefix/name of the SockJS service.

AeroGear Netty SockJS Codec 0.11.0

Copyright © 2014 JBoss by Red Hat. All Rights Reserved.