public interface ClientServiceConfig extends Config
This is the configuration for the (optional) client service within a
Web Server configuration
. The client service handles
Diffusion client connections.
This is a server side only configuration item. These properties may only be be set before a Diffusion Server is started.
Modifier and Type | Method and Description |
---|---|
int |
getCometBytesBeforeNewPoll()
Gets comet bytes before new poll value.
|
int |
getCometInitialMessagePadding()
Gets comet initial message padding.
|
int |
getCompressionThreshold()
Gets the compression threshold.
|
String |
getCORSOrigin()
Gets the CORS origin value.
|
int |
getMaximumInboundRequestSize()
Gets the maximum inbound request size.
|
long |
getMessageSequenceTimeout()
Gets the message sequence timeout.
|
String |
getName()
Gets the service name.
|
String |
getWebsocketOrigin()
Gets the web socket origin.
|
boolean |
isClosingCallbackRequests()
Deprecated.
since Diffusion 5.7. This method will be removed in a future
release.
|
boolean |
isCookieDisabled()
Is the session cookie disabled?
|
boolean |
isDebug()
Is debug set?
|
boolean |
isWebsocketSecureResponse()
Deprecated.
Setting is ignored. It applied to behavior defined by draft
versions of the WebSocket specification that is no longer
supported.
|
void |
setCloseCallbackRequests(boolean closeRequests)
Deprecated.
since Diffusion 5.7. This method will be removed in a future
release.
|
void |
setCometBytesBeforeNewPoll(int bytes)
Sets comet bytes before new poll.
|
void |
setCometInitialMessagePadding(int padding)
Sets comet initial message padding.
|
void |
setCompressionThreshold(int threshold)
Sets the compression threshold.
|
void |
setCookieDisabled(boolean disabled)
Sets the session cookie as enabled/disabled.
|
void |
setCORSOrigin(String origin)
Sets the CORS origin.
|
void |
setDebug(boolean debug)
Sets debug.
|
void |
setMaximumInboundRequestSize(int maxSize)
Sets the maximum inbound request size.
|
void |
setMessageSequenceTimeout(long timeout)
Sets the message sequence timeout.
|
void |
setWebsocketOrigin(String origin)
Sets the web socket origin.
|
void |
setWebsocketSecureResponse(boolean secureResponse)
Deprecated.
Setting is ignored. It applied to behavior defined by draft
versions of the WebSocket specification that is no longer
supported.
|
String getName()
void setMessageSequenceTimeout(long timeout) throws ConfigException
This is used with HTTP clients to indicate how long to wait for a missing message in a sequence of messages before assuming it is lost and closing the client session.
If not specified, a default value of 2 seconds is used.
timeout
- value in milliseconds. If this exceeds one hour
(3600000 ms), a warning will be logged and the timeout will be set
to one hour.ConfigException
- if unable to set the propertylong getMessageSequenceTimeout()
void setWebsocketOrigin(String origin) throws ConfigException
This is used to control access from client web socket to diffusion. This is a REGEX pattern that will match the origin of the request. ".*" matches anything so all requests are allowed.
If this is not explicitly set then the service will not be able to handle Web socket connections.
origin
- the web socket originConfigException
- if unable to set the propertyString getWebsocketOrigin()
void setCORSOrigin(String origin) throws ConfigException
This is used to control access from client web (XHR) to diffusion. This element will enable Cross Origin Resource Sharing. This is a REGEX pattern that will match the origin of the request. ".*" matches anything so all requests are allowed.
If this is not explicitly set then the service will not be able to handle CORS requests
origin
- the CORS originConfigException
- if unable to set the propertyString getCORSOrigin()
@Deprecated void setWebsocketSecureResponse(boolean secureResponse) throws ConfigException
secureResponse
- ignoredConfigException
- if unable to set the property@Deprecated boolean isWebsocketSecureResponse()
@Deprecated void setCloseCallbackRequests(boolean closeRequests) throws ConfigException
This is used only for Diffusion client callback requests. It indicates whether to obey the keep alive header or to close all requests.
If this is not explicitly specified then false is assumed meaning that the keep alive header will be obeyed.
closeRequests
- true to close all callback requestsConfigException
- if unable to set the property@Deprecated boolean isClosingCallbackRequests()
void setCompressionThreshold(int threshold) throws ConfigException
Compression will be used for all HTTP responses that exceed this size.
If this is not explicitly specified then 512 is assumed.
threshold
- in bytesConfigException
- if unable to set the propertyint getCompressionThreshold()
void setMaximumInboundRequestSize(int maxSize) throws ConfigException
The maximum number of bytes that the HTTP request can have.
A value of zero (the default) indicates that the maximum message size will be used.
maxSize
- size in bytesConfigException
- if unable to set the propertyint getMaximumInboundRequestSize()
void setCometBytesBeforeNewPoll(int bytes) throws ConfigException
This parameter allows you to specify the number of bytes after which a Comet connection is forced to re-establish itself. This can help to reduce the potential for memory leaks in the browser due to the long-lived nature of a Comet connection, at the expense of degraded performance due to more frequent HTTP handshakes.
If this is not explicitly specified then 30k is assumed.
bytes
- before new pollConfigException
- if unable to set the propertyint getCometBytesBeforeNewPoll()
void setCometInitialMessagePadding(int padding) throws ConfigException
Some browsers do not pass on data received via a Comet connection until some minimum number of bytes have been received. This means that in the case where an initial load message is small, the client may never receive it. In order to work around this restriction, you can set a value here which will ensure that the first message received will be padded with extra bytes that are automatically discarded by the client library.
If this is not explicitly specified then 124 is assumed.
padding
- in bytesConfigException
- if unable to set the propertyint getCometInitialMessagePadding()
void setCookieDisabled(boolean disabled) throws ConfigException
disabled
- set cookie as enabled/disabledConfigException
- if unable to set the propertyboolean isCookieDisabled()
void setDebug(boolean debug)
Default is false.
debug
- set debug on or offboolean isDebug()
Copyright © 2016 Push Technology Ltd. All Rights Reserved.