Class DefaultNetworkConfiguration
- All Implemented Interfaces:
ServerConfiguration.NetworkConfiguration
,com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Direct Known Subclasses:
SpringPropertiesNetworkConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis applies only to longpoll and server sent events:This applies only to longpoll:This applies only to longpoll:Gets the time after which an idle client (that has neither sent a keep alive message, nor a normal message) is considered to be timed out.This applies only to websocket:boolean
Determines if a http-session should always be created.void
setAlwaysCreateHttpSession
(boolean alwaysCreateHttpSession) You can set this to false if you do not want that jadice web toolkit enforces the creation of a http-session.void
setKeepAliveInterval
(Duration interval) This applies only to longpoll and server sent events:void
setLongPollTimeout
(Duration longPollTimeout) This applies only to longpoll:void
setResponseAggregationWindow
(Duration responseAggregationWindow) This applies only to longpoll:void
setSessionTimeout
(Duration sessionTimeout) Sets the time after which an idle client (that has neither sent a keep alive message, nor a normal message) is considered to be timed out.void
setWebSocketTimeout
(Duration webSocketTimeout) This applies only to websocket:toString()
-
Constructor Details
-
DefaultNetworkConfiguration
public DefaultNetworkConfiguration()
-
-
Method Details
-
setSessionTimeout
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
Sets the time after which an idle client (that has neither sent a keep alive message, nor a normal message) is considered to be timed out.This value should be large enough to cover also slow networks or other bottlenecks. Typically the timeout value should be in between 30 seconds up to a minute and need to be always lager then zero.
If a client times out, the connection is closed and a cleanup is performed for all resources connected to a client session.
- Specified by:
setSessionTimeout
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Parameters:
sessionTimeout
- the timeout value
-
setLongPollTimeout
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to longpoll:Sets the time after a longpoll request, times out. The timeout will only kick in, if the server has no message for the client and not sent any message to the client in the meantime. If the server sent a message, the longpoll request will be answered and a new longpoll will be generated by the client.
- Specified by:
setLongPollTimeout
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Parameters:
longPollTimeout
- the time after a non-answered-longpoll operation times out
-
setWebSocketTimeout
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to websocket:Sets the time after a websocket request, times out. The timeout will only kick in, if the server has no message for the client and not sent any message to the client in the meantime. If the server sent a message, the websocket request will be answered and a new websocket will be generated by the client. Caution: different app-servers sometimes handle values like 0 or Double.MAX_VALUE differently. The value 0 does not necessarily indicate the session will never timeout due to inactivity. Also some app-servers like Wildly won't accept Double.MAX_VALUE, others like Tomcat seem to add an additional duration of 5s on-top of the given value. Internally
Session.setMaxIdleTimeout(long)
is used.- Specified by:
setWebSocketTimeout
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Parameters:
webSocketTimeout
- the time after a non-answered-websocket operation times out
-
setKeepAliveInterval
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to longpoll and server sent events:Sets the interval at which a keep alive message is sent to the client so that the client knows the server and connection is still alive. Typically the value should be round about a halve minute and always larger then zero.
Smaller values tend to flood the network, larger values tend render this functionality pointless.
- Specified by:
setKeepAliveInterval
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Parameters:
interval
- the interval
-
setResponseAggregationWindow
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to longpoll:Sets the time window a request is held open in order to aggregate messages the server wants to send to the client. This window is only used, once the server has messages that will be sent. This results in less messages and thus less traffic, since they are sent in a batch.
The window needs to be small, so that the answer to the client isn't delayed too long, and must be larger then zero. Typically in between 50 ms to 100 ms.
Larger values result in a noticeable delay. Very short values (0 ms to 10ms) are likely to result in empty longpoll answers, since the server hasn't finished computing yet.
- Specified by:
setResponseAggregationWindow
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Parameters:
responseAggregationWindow
- the time window a longpoll request is delayed
-
getResponseAggregationWindow
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to longpoll:Gets the time window a request is held open in order to aggregate messages the server wants to send to the client. This window is only used, once the server has messages that will be sent. This results in less messages and thus less traffic, since they are sent in a batch.
- Specified by:
getResponseAggregationWindow
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Returns:
- the time window a longpoll request is delayed
-
getLongPollTimeout
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to longpoll:Get the time after a longpoll request, times out. The timeout will only kick in, if the server has no message for the client and not sent any message to the client in the meantime. If the server sent a message, the longpoll request will be answered and a new longpoll will be generated by the client.
- Specified by:
getLongPollTimeout
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Returns:
- the time after a non-answered-longpoll operation times out
-
getWebSocketTimeout
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to websocket:Get the time after a websocket request times out. The timeout will only kick in, if the server has no message for the client and not sent any message to the client in the meantime. If the server sent a message, the websocket request will be answered and a new websocket will be generated by the client.
- Specified by:
getWebSocketTimeout
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Returns:
- the time after a non-answered-websocket operation times out. The default is 9 hours
-
getSessionTimeout
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
Gets the time after which an idle client (that has neither sent a keep alive message, nor a normal message) is considered to be timed out.If a client times out, the connection is closed and a cleanup is performed for all resources connected to a client session.
- Specified by:
getSessionTimeout
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Returns:
- the timeout value
-
getKeepAliveInterval
Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
This applies only to longpoll and server sent events:Returns the interval at which a keep alive message is sent to the client so that the client knows the server and connection is still alive.
- Specified by:
getKeepAliveInterval
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Returns:
- the interval
-
isAlwaysCreateHttpSession
public boolean isAlwaysCreateHttpSession()Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
Determines if a http-session should always be created. This takes place in the TransportWebtoolkitFilter. If you do not require a http-session and the according JSESSIONID-cookie you can disable this. Defaults to true.- Specified by:
isAlwaysCreateHttpSession
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Returns:
- true if a http-session should always be created
-
setAlwaysCreateHttpSession
public void setAlwaysCreateHttpSession(boolean alwaysCreateHttpSession) Description copied from interface:com.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
You can set this to false if you do not want that jadice web toolkit enforces the creation of a http-session.- Specified by:
setAlwaysCreateHttpSession
in interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration
- Parameters:
alwaysCreateHttpSession
-
-
toString
-