AeroGear Netty SockJS Codec 0.11.0

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

java.lang.Object
  extended by org.jboss.aerogear.io.netty.handler.codec.sockjs.SockJsConfig.Builder
Enclosing class:
SockJsConfig

public static class SockJsConfig.Builder
extends Object


Constructor Summary
SockJsConfig.Builder(String prefix)
          The prefix, or name, of the service.
 
Method Summary
 SockJsConfig build()
          Builds Config with the previously set values.
 SockJsConfig.Builder cookiesNeeded()
          Determines if a JSESSIONID cookie will be set.
 SockJsConfig.Builder disableWebSocket()
          Will disable WebSocket suppport.
 SockJsConfig.Builder heartbeatInterval(long ms)
          Specifies a heartbeat interval.
 SockJsConfig.Builder keyStore(String keyStore)
          Specifies the keystore to be used if transport layer security (TLS) is enabled.
 SockJsConfig.Builder keyStorePassword(String password)
          Specifies the keystore password to be used if transport layer security (TLS) is enabled.
 SockJsConfig.Builder maxStreamingBytesSize(int max)
          The max number of types that a streaming transport protocol should allow to be returned before closing the connection, forcing the client to reconnect.
 SockJsConfig.Builder sessionTimeout(long ms)
          The max number of types that a streaming transport protocol should allow to be returned before closing the connection, forcing the client to reconnect.
 SockJsConfig.Builder sockJsUrl(String sockJsUrl)
          The url to the sock-js-.json.
 SockJsConfig.Builder tls(boolean tls)
          Determines whether transport layer security (TLS) should be used.
 SockJsConfig.Builder webSocketHeartbeatInterval(long ms)
          Specifies a heartbeat interval for SockJS WebSocket transport.
 SockJsConfig.Builder webSocketProtocols(String... protocols)
          Adds the given protocols which will be returned to during the Http upgrade request as the header 'WebSocket-Protocol'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SockJsConfig.Builder

public SockJsConfig.Builder(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.
Method Detail

disableWebSocket

public SockJsConfig.Builder disableWebSocket()
Will disable WebSocket suppport.


webSocketHeartbeatInterval

public SockJsConfig.Builder webSocketHeartbeatInterval(long ms)
Specifies a heartbeat interval for SockJS WebSocket transport. 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 mush larger value for it.

Parameters:
ms - how often that a WebSocket heartbeat should be sent

webSocketProtocols

public SockJsConfig.Builder webSocketProtocols(String... protocols)
Adds the given protocols which will be returned to during the Http upgrade request as the header 'WebSocket-Protocol'.

Parameters:
protocols - the protocols that are supported.

cookiesNeeded

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


sockJsUrl

public SockJsConfig.Builder sockJsUrl(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'.

Parameters:
sockJsUrl - the url to the sockjs version to be used.

sessionTimeout

public SockJsConfig.Builder sessionTimeout(long ms)
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.

Parameters:
ms - the max number of bytes that can be written. Default is 131072.

heartbeatInterval

public SockJsConfig.Builder heartbeatInterval(long ms)
Specifies a heartbeat interval.

Parameters:
ms - how often that a heartbeat should be sent

maxStreamingBytesSize

public SockJsConfig.Builder maxStreamingBytesSize(int max)
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.

Parameters:
max - the max number of bytes that can be written. Default is 131072.

tls

public SockJsConfig.Builder tls(boolean tls)
Determines whether transport layer security (TLS) should be used.

Parameters:
tls - if transport layer security should be used.

keyStore

public SockJsConfig.Builder keyStore(String keyStore)
Specifies the keystore to be used if transport layer security (TLS) is enabled.

Parameters:
keyStore - the keystore to be used when TLS is enabled.

keyStorePassword

public SockJsConfig.Builder keyStorePassword(String password)
Specifies the keystore password to be used if transport layer security (TLS) is enabled.

Parameters:
password - the keystore password to be used when TLS is enabled.

build

public SockJsConfig build()
Builds Config with the previously set values.

Returns:
SockJsConfig the configuration for the SockJS service.

AeroGear Netty SockJS Codec 0.11.0

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