Package io.github.centrifugal.centrifuge
Class Options
- java.lang.Object
-
- io.github.centrifugal.centrifuge.Options
-
public class Options extends java.lang.Object
Configuration for aClient
instance.
-
-
Constructor Summary
Constructors Constructor Description Options()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getData()
Dns
getDns()
java.util.Map<java.lang.String,java.lang.String>
getHeaders()
int
getMaxReconnectDelay()
int
getMaxServerPingDelay()
int
getMinReconnectDelay()
java.lang.String
getName()
java.net.Proxy
getProxy()
java.lang.String
getProxyLogin()
java.lang.String
getProxyPassword()
int
getTimeout()
java.lang.String
getToken()
ConnectionTokenGetter
getTokenGetter()
java.lang.String
getVersion()
void
setData(byte[] data)
Set custom connection data.void
setDns(Dns dns)
Set custom DNS resolver..void
setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set custom headers for WebSocket Upgrade request.void
setMaxReconnectDelay(int maxReconnectDelay)
Set max time between reconnect attempts in milliseconds.void
setMaxServerPingDelay(int maxServerPingDelay)
Set max time of ping delay from server in milliseconds.void
setMinReconnectDelay(int minReconnectDelay)
Set minimal time before reconnect attempt in milliseconds.void
setName(java.lang.String name)
Set client name - name of this client.void
setProxy(java.net.Proxy proxy)
Set proxy to use.void
setProxyCredentials(java.lang.String login, java.lang.String password)
Set proxy credentials.void
setTimeout(int timeout)
Set custom timeout for requests in milliseconds.void
setToken(java.lang.String token)
Set connection token.void
setTokenGetter(ConnectionTokenGetter tokenGetter)
Set a method to extract new connection token upon expiration.void
setVersion(java.lang.String version)
Set client version - version of application.
-
-
-
Method Detail
-
getToken
public java.lang.String getToken()
-
setToken
public void setToken(java.lang.String token)
Set connection token. If your tokens expire and you want SDK to automatically refresh tokens then set ConnectionTokenGetter (see below).
-
getTokenGetter
public ConnectionTokenGetter getTokenGetter()
-
setTokenGetter
public void setTokenGetter(ConnectionTokenGetter tokenGetter)
Set a method to extract new connection token upon expiration.
-
getName
public java.lang.String getName()
-
setName
public void setName(java.lang.String name)
Set client name - name of this client. This should not be unique per client – it identifies client application name actually, so name should have a limited number of possible values. By default this client uses "java" as a name.
-
getVersion
public java.lang.String getVersion()
-
setVersion
public void setVersion(java.lang.String version)
Set client version - version of application. This may be used for observability on the server (for example in analytics).
-
getData
public byte[] getData()
-
setData
public void setData(byte[] data)
Set custom connection data. This data will be delivered to server in Connect command. For Centrifugo this may be useful in case of using connect proxy.
-
setHeaders
public void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Set custom headers for WebSocket Upgrade request.
-
getHeaders
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
-
getTimeout
public int getTimeout()
-
setTimeout
public void setTimeout(int timeout)
Set custom timeout for requests in milliseconds. By default, 5000 is used.
-
getMinReconnectDelay
public int getMinReconnectDelay()
-
setMinReconnectDelay
public void setMinReconnectDelay(int minReconnectDelay)
Set minimal time before reconnect attempt in milliseconds. By default, 500 is used.
-
getMaxReconnectDelay
public int getMaxReconnectDelay()
-
setMaxReconnectDelay
public void setMaxReconnectDelay(int maxReconnectDelay)
Set max time between reconnect attempts in milliseconds. By default, 20000 is used.
-
getMaxServerPingDelay
public int getMaxServerPingDelay()
-
setMaxServerPingDelay
public void setMaxServerPingDelay(int maxServerPingDelay)
Set max time of ping delay from server in milliseconds. By default, 10000 is used.
-
setProxy
public void setProxy(java.net.Proxy proxy)
Set proxy to use.
-
getProxy
public java.net.Proxy getProxy()
-
setProxyCredentials
public void setProxyCredentials(java.lang.String login, java.lang.String password)
Set proxy credentials.
-
getProxyLogin
public java.lang.String getProxyLogin()
-
getProxyPassword
public java.lang.String getProxyPassword()
-
getDns
public Dns getDns()
-
setDns
public void setDns(Dns dns)
Set custom DNS resolver..
-
-