diff --git a/docs/src/docs/asciidoc/guides/hazelcast-spring.adoc b/docs/src/docs/asciidoc/guides/hazelcast-spring.adoc
index a78d055..95e304e 100644
--- a/docs/src/docs/asciidoc/guides/hazelcast-spring.adoc
+++ b/docs/src/docs/asciidoc/guides/hazelcast-spring.adoc
@@ -81,7 +81,7 @@ The filter is what is in charge of replacing the `HttpSession` implementation to
In this instance Spring Session is backed by Hazelcast.
<2> We create a `HazelcastInstance` that connects Spring Session to Hazelcast.
By default, an embedded instance of Hazelcast is started and connected to by the application.
-For more information on configuring Hazelcast, refer to the http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#hazelcast-configuration[reference documentation].
+For more information on configuring Hazelcast, refer to the http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#hazelcast-configuration[reference documentation].
== Servlet Container Initialization
@@ -126,7 +126,7 @@ You can run the sample by obtaining the {download-url}[source code] and invoking
====
Hazelcast will run in embedded mode with your application by default, but if you want to connect
to a stand alone instance instead, you can configure it by following the instructions in the
-http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#hazelcast-configuration[reference documentation].
+http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#hazelcast-configuration[reference documentation].
====
----
@@ -157,9 +157,9 @@ Go ahead and view the cookies (click for help with https://developer.chrome.com/
=== Interact with the data store
-If you like, you can remove the session using http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#hazelcast-java-client[a Java client],
-http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#other-client-implementations[one of the other clients], or the
-http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#management-center[management center].
+If you like, you can remove the session using http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#hazelcast-java-client[a Java client],
+http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#other-client-implementations[one of the other clients], or the
+http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#management-center[management center].
==== Using the console
@@ -168,7 +168,7 @@ For example, using the management center console after connecting to your Hazelc
default> ns spring:session:sessions
spring:session:sessions> m.clear
-TIP: The Hazelcast documentation has instructions for http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#console[the console].
+TIP: The Hazelcast documentation has instructions for http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#executing-console-commands[the console].
Alternatively, you can also delete the explicit key. Enter the following into the console ensuring to replace `7e8383a4-082c-4ffe-a4bc-c40fd3363c5e` with the value of your SESSION cookie:
@@ -179,7 +179,7 @@ Now visit the application at http://localhost:8080/ and observe that we are no l
==== Using the REST API
As described in the other clients section of the documentation, there is a
-http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#rest-client[REST API]
+http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#rest-client[REST API]
provided by the Hazelcast node(s).
For example, you could delete an individual key as follows (replacing `7e8383a4-082c-4ffe-a4bc-c40fd3363c5e` with the value of your SESSION cookie):
diff --git a/docs/src/docs/asciidoc/index.adoc b/docs/src/docs/asciidoc/index.adoc
index 2b27542..25e9efc 100644
--- a/docs/src/docs/asciidoc/index.adoc
+++ b/docs/src/docs/asciidoc/index.adoc
@@ -513,7 +513,7 @@ include::{docs-test-dir}docs/http/HazelcastHttpSessionConfig.java[tags=config]
----
This will configure Hazelcast in embedded mode with default configuration.
-See the http://docs.hazelcast.org/docs/latest/manual/html-single/hazelcast-documentation.html#hazelcast-configuration[Hazelcast documentation] for
+See the http://docs.hazelcast.org/docs/latest/manual/html-single/index.html#hazelcast-configuration[Hazelcast documentation] for
detailed information on configuration options for Hazelcast.
[[api-enablehazelcasthttpsession-storage]]
@@ -521,8 +521,9 @@ detailed information on configuration options for Hazelcast.
Sessions will be stored in a distributed `Map` in Hazelcast using a < {
- private final static String MAX_INACTIVE_INTERVAL_IN_SECONDS_STR = "1";
- private final static int MAX_INACTIVE_INTERVAL_IN_SECONDS = Integer.valueOf(MAX_INACTIVE_INTERVAL_IN_SECONDS_STR);
+ private final static int MAX_INACTIVE_INTERVAL_IN_SECONDS = 1;
@Autowired
private SessionRepository repository;
@@ -143,9 +142,29 @@ public class EnableHazelcastHttpSessionEventsTests {
assertThat(repository.getSession(sessionToSave.getId())).isNull();
}
+ @Test
+ public void saveUpdatesTimeToLiveTest() throws InterruptedException {
+ S sessionToSave = repository.createSession();
+
+ repository.save(sessionToSave);
+
+ synchronized (lock) {
+ lock.wait((sessionToSave.getMaxInactiveIntervalInSeconds() * 1000) - 500);
+ }
+
+ // Get and save the session like SessionRepositoryFilter would.
+ S sessionToUpdate = repository.getSession(sessionToSave.getId());
+ repository.save(sessionToUpdate);
+
+ synchronized (lock) {
+ lock.wait((sessionToUpdate.getMaxInactiveIntervalInSeconds() * 1000) - 100);
+ }
+
+ assertThat(repository.getSession(sessionToUpdate.getId())).isNotNull();
+ }
@Configuration
- @EnableHazelcastHttpSession(maxInactiveIntervalInSeconds = MAX_INACTIVE_INTERVAL_IN_SECONDS_STR)
+ @EnableHazelcastHttpSession(maxInactiveIntervalInSeconds = MAX_INACTIVE_INTERVAL_IN_SECONDS)
static class HazelcastSessionConfig {
@Bean
diff --git a/spring-session/src/integration-test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationXmlTests.java b/spring-session/src/integration-test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationXmlTests.java
index 6838dbf..a5b2c43 100644
--- a/spring-session/src/integration-test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationXmlTests.java
+++ b/spring-session/src/integration-test/java/org/springframework/session/hazelcast/config/annotation/web/http/HazelcastHttpSessionConfigurationXmlTests.java
@@ -43,59 +43,6 @@ import com.hazelcast.core.HazelcastInstance;
*/
public class HazelcastHttpSessionConfigurationXmlTests {
- @RunWith(SpringJUnit4ClassRunner.class)
- @ContextConfiguration
- @WebAppConfiguration
- public static class CustomXmlInactiveIntervalTest {
-
- @Autowired
- private SessionRepository repository;
-
- @Autowired
- private HazelcastInstance hazelcast;
-
- @Test
- public void saveSessionTest() throws InterruptedException {
-
- S sessionToSave = repository.createSession();
-
- assertThat(sessionToSave.getMaxInactiveIntervalInSeconds())
- .isEqualTo(150);
-
- repository.save(sessionToSave);
-
- S session = repository.getSession(sessionToSave.getId());
-
- assertThat(session.getId()).isEqualTo(sessionToSave.getId());
- assertThat(session.getMaxInactiveIntervalInSeconds())
- .isEqualTo(150);
- }
-
- @Test
- public void checkUnderlyingMapSettingsTest() {
- assertThat(
- hazelcast.getConfig()
- .getMapConfig("spring:session:sessions")
- .getMaxIdleSeconds())
- .isEqualTo(150);
- }
-
- @Configuration
- @EnableHazelcastHttpSession(maxInactiveIntervalInSeconds = "")
- static class HazelcastSessionXmlConfigCustomIdle {
-
- @Bean
- public HazelcastInstance embeddedHazelcast() {
- Config hazelcastConfig = new ClasspathXmlConfig(
- "org/springframework/session/hazelcast/config/annotation/web/http/hazelcast-custom-idle-time.xml");
- NetworkConfig netConfig = new NetworkConfig();
- netConfig.setPort(SocketUtils.findAvailableTcpPort());
- hazelcastConfig.setNetworkConfig(netConfig);
- return Hazelcast.newHazelcastInstance(hazelcastConfig);
- }
- }
- }
-
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration
@WebAppConfiguration
@@ -104,9 +51,6 @@ public class HazelcastHttpSessionConfigurationXmlTests repository;
- @Autowired
- private HazelcastInstance hazelcast;
-
@Test
public void saveSessionTest() throws InterruptedException {
@@ -120,15 +64,6 @@ public class HazelcastHttpSessionConfigurationXmlTests repository;
- @Autowired
- private HazelcastInstance hazelcast;
-
@Test
public void saveSessionTest() throws InterruptedException {
@@ -169,17 +101,8 @@ public class HazelcastHttpSessionConfigurationXmlTestsIf you wish to use external configuration (outside of this annotation) to set this value, you can
- * set this to "" (an empty String), which will prevent this configuration from overriding
- * the external configuration for this value.