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:booleanDetermines if a http-session should always be created.voidsetAlwaysCreateHttpSession(boolean alwaysCreateHttpSession) You can set this to false if you do not want that jadice web toolkit enforces the creation of a http-session.voidsetKeepAliveInterval(Duration interval) This applies only to longpoll and server sent events:voidsetLongPollTimeout(Duration longPollTimeout) This applies only to longpoll:voidsetResponseAggregationWindow(Duration responseAggregationWindow) This applies only to longpoll:voidsetSessionTimeout(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.voidsetWebSocketTimeout(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.ConnectionConfigurationSets 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:
setSessionTimeoutin 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.ConnectionConfigurationThis 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:
setLongPollTimeoutin 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.ConnectionConfigurationThis 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:
setWebSocketTimeoutin 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.ConnectionConfigurationThis 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:
setKeepAliveIntervalin 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.ConnectionConfigurationThis 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:
setResponseAggregationWindowin 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.ConnectionConfigurationThis 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:
getResponseAggregationWindowin 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.ConnectionConfigurationThis 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:
getLongPollTimeoutin 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.ConnectionConfigurationThis 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:
getWebSocketTimeoutin 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.ConnectionConfigurationGets 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:
getSessionTimeoutin 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.ConnectionConfigurationThis 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:
getKeepAliveIntervalin 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.ConnectionConfigurationDetermines 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:
isAlwaysCreateHttpSessionin 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.ConnectionConfigurationYou can set this to false if you do not want that jadice web toolkit enforces the creation of a http-session.- Specified by:
setAlwaysCreateHttpSessionin interfacecom.levigo.jadice.web.transport.server.internal.config.ConnectionConfiguration- Parameters:
alwaysCreateHttpSession-
-
toString
-