public class Configuration extends Object
| Constructor and Description |
|---|
Configuration() |
| Modifier and Type | Method and Description |
|---|---|
AckMode |
getAckMode() |
AuthorizationListener |
getAuthorizationListener() |
int |
getBossThreads() |
String |
getContext() |
ExceptionListener |
getExceptionListener() |
int |
getFirstDataTimeout() |
String |
getHostname() |
JsonSupport |
getJsonSupport() |
String |
getKeyManagerFactoryAlgorithm() |
InputStream |
getKeyStore() |
String |
getKeyStoreFormat() |
String |
getKeyStorePassword() |
int |
getMaxFramePayloadLength() |
int |
getMaxHttpContentLength() |
String |
getOrigin() |
String |
getPackagePrefix() |
int |
getPingInterval() |
int |
getPingTimeout() |
int |
getPort() |
SocketConfig |
getSocketConfig() |
String |
getSSLProtocol() |
StoreFactory |
getStoreFactory() |
List<Transport> |
getTransports() |
InputStream |
getTrustStore() |
String |
getTrustStoreFormat() |
String |
getTrustStorePassword() |
int |
getUpgradeTimeout() |
int |
getWorkerThreads() |
boolean |
isAddVersionHeader() |
boolean |
isAllowCustomRequests() |
boolean |
isHeartbeatsEnabled() |
boolean |
isHttpCompression() |
boolean |
isPreferDirectBuffer() |
boolean |
isRandomSession() |
boolean |
isUseLinuxNativeEpoll() |
boolean |
isWebsocketCompression() |
void |
setAckMode(AckMode ackMode)
Auto ack-response mode
Default is
AckMode.AUTO_SUCCESS_ONLY |
void |
setAddVersionHeader(boolean addVersionHeader)
Adds Server header with lib version to http response.
|
void |
setAllowCustomRequests(boolean allowCustomRequests)
Allow to service custom requests differs from socket.io protocol.
|
void |
setAuthorizationListener(AuthorizationListener authorizationListener)
Authorization listener invoked on every handshake.
|
void |
setBossThreads(int bossThreads) |
void |
setContext(String context) |
void |
setExceptionListener(ExceptionListener exceptionListener)
Exception listener invoked on any exception in
SocketIO listener
|
void |
setFirstDataTimeout(int firstDataTimeout)
Timeout between channel opening and first data transfer
Helps to avoid 'silent channel' attack and prevents
'Too many open files' problem in this case
|
void |
setHostname(String hostname)
Optional parameter.
|
void |
setHttpCompression(boolean httpCompression)
Activate http protocol compression.
|
void |
setJsonSupport(JsonSupport jsonSupport)
Allows to setup custom implementation of
JSON serialization/deserialization
|
void |
setKeyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm) |
void |
setKeyStore(InputStream keyStore)
SSL key store stream, maybe appointed to any source
|
void |
setKeyStoreFormat(String keyStoreFormat)
Key store format
|
void |
setKeyStorePassword(String keyStorePassword)
SSL key store password
|
void |
setMaxFramePayloadLength(int maxFramePayloadLength)
Set maximum websocket frame content length limit
|
void |
setMaxHttpContentLength(int value)
Set maximum http content length limit
|
void |
setOrigin(String origin)
Set Access-Control-Allow-Origin header value for http each
response.
|
void |
setPackagePrefix(String packagePrefix)
Package prefix for sending json-object from client
without full class name.
|
void |
setPingInterval(int heartbeatIntervalSecs)
Ping interval
|
void |
setPingTimeout(int heartbeatTimeoutSecs)
Ping timeout
Use
0 to disable it |
void |
setPort(int port) |
void |
setPreferDirectBuffer(boolean preferDirectBuffer)
Buffer allocation method used during packet encoding.
|
void |
setRandomSession(boolean randomSession) |
void |
setSocketConfig(SocketConfig socketConfig)
TCP socket configuration
|
void |
setSSLProtocol(String sslProtocol)
Set the name of the requested SSL protocol
|
void |
setStoreFactory(StoreFactory clientStoreFactory)
Data store - used to store session data and implements distributed pubsub.
|
void |
setTransports(Transport... transports)
Transports supported by server
|
void |
setTrustStore(InputStream trustStore) |
void |
setTrustStoreFormat(String trustStoreFormat) |
void |
setTrustStorePassword(String trustStorePassword) |
void |
setUpgradeTimeout(int upgradeTimeout)
Transport upgrade timeout in milliseconds
|
void |
setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll) |
void |
setWebsocketCompression(boolean websocketCompression)
Activate websocket protocol compression.
|
void |
setWorkerThreads(int workerThreads) |
public JsonSupport getJsonSupport()
public void setJsonSupport(JsonSupport jsonSupport)
jsonSupport - - json mapperJsonSupportpublic String getHostname()
public void setHostname(String hostname)
hostname - - name of hostpublic int getPort()
public void setPort(int port)
public int getBossThreads()
public void setBossThreads(int bossThreads)
public int getWorkerThreads()
public void setWorkerThreads(int workerThreads)
public void setPingInterval(int heartbeatIntervalSecs)
heartbeatIntervalSecs - - time in millisecondspublic int getPingInterval()
public void setPingTimeout(int heartbeatTimeoutSecs)
0 to disable itheartbeatTimeoutSecs - - time in millisecondspublic int getPingTimeout()
public boolean isHeartbeatsEnabled()
public String getContext()
public void setContext(String context)
public boolean isAllowCustomRequests()
public void setAllowCustomRequests(boolean allowCustomRequests)
falseallowCustomRequests - - true to allowpublic void setKeyStorePassword(String keyStorePassword)
keyStorePassword - - password of key storepublic String getKeyStorePassword()
public void setKeyStore(InputStream keyStore)
keyStore - - key store input streampublic InputStream getKeyStore()
public void setKeyStoreFormat(String keyStoreFormat)
keyStoreFormat - - key store formatpublic String getKeyStoreFormat()
public void setMaxHttpContentLength(int value)
value - the maximum length of the aggregated http content.public int getMaxHttpContentLength()
public void setTransports(Transport... transports)
transports - - list of transportspublic void setPackagePrefix(String packagePrefix)
packagePrefix - - prefix stringpublic String getPackagePrefix()
public void setPreferDirectBuffer(boolean preferDirectBuffer)
truepreferDirectBuffer - true if a direct buffer should be tried to be used as target for
the encoded messages. If false is used it will allocate a heap
buffer, which is backed by an byte array.public boolean isPreferDirectBuffer()
public void setStoreFactory(StoreFactory clientStoreFactory)
MemoryStoreFactoryclientStoreFactory - - implements StoreFactoryMemoryStoreFactory,
RedissonStoreFactory,
HazelcastStoreFactorypublic StoreFactory getStoreFactory()
public void setAuthorizationListener(AuthorizationListener authorizationListener)
AuthorizationListener.isAuthorized method.
Accepts all clients by default.authorizationListener - - authorization listener itselfAuthorizationListenerpublic AuthorizationListener getAuthorizationListener()
public void setExceptionListener(ExceptionListener exceptionListener)
exceptionListener - - listenerExceptionListenerpublic ExceptionListener getExceptionListener()
public SocketConfig getSocketConfig()
public void setSocketConfig(SocketConfig socketConfig)
socketConfig - - configpublic void setAckMode(AckMode ackMode)
AckMode.AUTO_SUCCESS_ONLYackMode - - ack modeAckModepublic AckMode getAckMode()
public String getTrustStoreFormat()
public void setTrustStoreFormat(String trustStoreFormat)
public InputStream getTrustStore()
public void setTrustStore(InputStream trustStore)
public String getTrustStorePassword()
public void setTrustStorePassword(String trustStorePassword)
public String getKeyManagerFactoryAlgorithm()
public void setKeyManagerFactoryAlgorithm(String keyManagerFactoryAlgorithm)
public void setMaxFramePayloadLength(int maxFramePayloadLength)
maxFramePayloadLength - - lengthpublic int getMaxFramePayloadLength()
public void setUpgradeTimeout(int upgradeTimeout)
upgradeTimeout - - upgrade timeoutpublic int getUpgradeTimeout()
public void setAddVersionHeader(boolean addVersionHeader)
Default is true
addVersionHeader - - true to add headerpublic boolean isAddVersionHeader()
public void setOrigin(String origin)
null
If value is null then request ORIGIN header value used.origin - - originpublic String getOrigin()
public boolean isUseLinuxNativeEpoll()
public void setUseLinuxNativeEpoll(boolean useLinuxNativeEpoll)
public void setSSLProtocol(String sslProtocol)
sslProtocol - - name of protocolpublic String getSSLProtocol()
public void setFirstDataTimeout(int firstDataTimeout)
firstDataTimeout - - timeout valuepublic int getFirstDataTimeout()
public void setHttpCompression(boolean httpCompression)
gzip or
deflate encoding choice depends on the "Accept-Encoding" header value.
Default is true
httpCompression - - true to use http compressionpublic boolean isHttpCompression()
public void setWebsocketCompression(boolean websocketCompression)
permessage-deflate encoding only.
Default is true
websocketCompression - - true to use websocket compressionpublic boolean isWebsocketCompression()
public boolean isRandomSession()
public void setRandomSession(boolean randomSession)
Copyright © 2012–2021. All rights reserved.