Interface ClientServiceConfig
- All Superinterfaces:
Config
This is the configuration for the (optional) client service within a
Web Server configuration
. The client service handles
Diffusion client connections.
These properties may only be set before a Diffusion Server is started.
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescriptionGets the CORS origin value.int
Gets the maximum inbound request size.long
Gets the message sequence timeout.getName()
Gets the service name.Gets the WebSocket origin pattern.boolean
Is the session cookie disabled?boolean
isDebug()
Is debug set?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 WebSocket origin patten.
-
Method Details
-
getName
String getName()Gets the service name.- Returns:
- the service name
-
setMessageSequenceTimeout
Sets the message sequence timeout.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 4 seconds is used.
- Parameters:
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.- Throws:
ConfigException
- if unable to set the property
-
getMessageSequenceTimeout
long getMessageSequenceTimeout()Gets the message sequence timeout.- Returns:
- message sequence timeout
-
setWebsocketOrigin
Sets the WebSocket origin patten.The server will reject a WebSocket connection upgrade request that has an Origin header if the header does not match this regular expression.
The default value is ".*", which allows all WebSocket upgrade requests.
- Parameters:
origin
- the web socket origin regular expression- Throws:
ConfigException
- if unable to set the property
-
getWebsocketOrigin
String getWebsocketOrigin()Gets the WebSocket origin pattern.- Returns:
- the web socket origin regular expression
-
setCORSOrigin
Sets the CORS origin.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, the service will not be able to handle CORS requests
- Parameters:
origin
- the CORS origin- Throws:
ConfigException
- if unable to set the property
-
getCORSOrigin
String getCORSOrigin()Gets the CORS origin value.- Returns:
- CORS origin or null if not set
-
setMaximumInboundRequestSize
Sets the maximum inbound request size.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.
- Parameters:
maxSize
- size in bytes- Throws:
ConfigException
- if unable to set the property
-
getMaximumInboundRequestSize
int getMaximumInboundRequestSize()Gets the maximum inbound request size.- Returns:
- maximum inbound request size.
-
setCookieDisabled
Sets the session cookie as enabled/disabled. If disabled (set as true), the "Set-Cookie" header will not be present in the HTTP response for each client connection. Default is false (cookie enabled).- Parameters:
disabled
- set cookie as enabled/disabled- Throws:
ConfigException
- if unable to set the property- Since:
- 5.5
-
isCookieDisabled
boolean isCookieDisabled()Is the session cookie disabled?- Returns:
- true if the cookie has been disabled
- Since:
- 5.5
-
setDebug
void setDebug(boolean debug) Sets debug.Default is false.
- Parameters:
debug
- set debug on or off
-
isDebug
boolean isDebug()Is debug set?- Returns:
- true if set
-