Package io.github.centrifugal.centrifuge
Class Options
java.lang.Object
io.github.centrifugal.centrifuge.Options
Configuration for a
Client instance.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getData()getDns()intintintgetName()okhttp3.OkHttpClientgetProxy()intgetToken()voidsetData(byte[] data) Set custom connection data.voidSet custom DNS resolver for default OkHttpClient builder.voidsetHeaders(Map<String, String> headers) Set custom headers for WebSocket Upgrade request.voidsetMaxReconnectDelay(int maxReconnectDelay) Set max time between reconnect attempts in milliseconds.voidsetMaxServerPingDelay(int maxServerPingDelay) Set max time of ping delay from server in milliseconds.voidsetMinReconnectDelay(int minReconnectDelay) Set minimal time before reconnect attempt in milliseconds.voidSet client name - name of this client.voidsetOkHttpClient(okhttp3.OkHttpClient okHttpClient) Set OkHttpClient.voidSet proxy to use in default OkHttpClient builder.voidsetProxyCredentials(String login, String password) Set proxy credentials for default OkHttpClient builder.voidsetSSLSocketFactory(SSLSocketFactory sslSocketFactory) Set custom SSLSocketFactory for default OkHttpClient builder.voidsetSSLSocketFactory(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager) Set custom SSLSocketFactory and X509TrustManager for default OkHttpClient builder.voidsetTimeout(int timeout) Set custom timeout for requests in milliseconds.voidSet connection token.voidsetTokenGetter(ConnectionTokenGetter tokenGetter) Set a method to extract new connection token upon expiration.voidsetVersion(String version) Set client version - version of application.
-
Constructor Details
-
Options
public Options()
-
-
Method Details
-
getToken
-
setToken
Set connection token. If your tokens expire and you want SDK to automatically refresh tokens then set ConnectionTokenGetter (see below). -
getTokenGetter
-
setTokenGetter
Set a method to extract new connection token upon expiration. -
getName
-
setName
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
-
setVersion
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
Set custom headers for WebSocket Upgrade request. -
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. -
getOkHttpClient
public okhttp3.OkHttpClient getOkHttpClient() -
setOkHttpClient
public void setOkHttpClient(okhttp3.OkHttpClient okHttpClient) Set OkHttpClient. Can be used to pass configured custom OkHttpClient (with DNS, proxy, SSLSocketFactory etc.). -
setProxy
Set proxy to use in default OkHttpClient builder. Won't be used ifsetOkHttpClient(okhttp3.OkHttpClient)was used. -
getProxy
-
setProxyCredentials
Set proxy credentials for default OkHttpClient builder. Won't be used ifsetOkHttpClient(okhttp3.OkHttpClient)was used. -
getProxyLogin
-
getProxyPassword
-
getDns
-
setDns
Set custom DNS resolver for default OkHttpClient builder. Won't be used ifsetOkHttpClient(okhttp3.OkHttpClient)was used. -
setSSLSocketFactory
Set custom SSLSocketFactory for default OkHttpClient builder. Won't be used ifsetOkHttpClient(okhttp3.OkHttpClient)was used. -
setSSLSocketFactory
Set custom SSLSocketFactory and X509TrustManager for default OkHttpClient builder. Won't be used ifsetOkHttpClient(okhttp3.OkHttpClient)was used. -
getSSLSocketFactory
-
getTrustManager
-