Annotation Interface EnableGemFireHttpSession


@Target(TYPE) @Retention(RUNTIME) @Documented @Configuration @Import(GemFireHttpSessionConfiguration.class) public @interface EnableGemFireHttpSession
Add this annotation to a Spring application defined @Configuration Class exposing the SessionRepositoryFilter as a bean named springSessionRepositoryFilter to back the HttpSession with either Apache Geode or Pivotal GemFire. In order to use this annotation, a single Apache Geode / Pivotal GemFire ClientCache or Peer Cache instance must be provided. The most common use case is to use Apache Geode or Pivotal GemFire's client/server topology, where your Spring Session enabled application uses a ClientCache to manage Session state in a cluster of dedicated Apache Geode or Pivotal GemFire servers. For example:
 
 @ClientCacheApplication(subscriptionEnabled = true)
 @EnableGemFireHttpSession(poolName = "DEFAULT"
 public class ClientCacheHttpSessionConfiguration {

 }
 
 
Alternatively, though less common (and not recommended), you can use Spring Session with Apache Geode or Pivotal GemFire in the embedded Peer Cache scenario, where your Spring Session enabled application is technically a peer in the Apache Geode or Pivotal GemFire cluster. For example:
 
 @PeerCacheApplication
 @EnableGemFireHttpSession
 public class PeerCacheHttpSessionConfiguration {

 }
 
 
More advanced configurations can extend GemFireHttpSessionConfiguration instead.
Since:
1.1.0
See Also:
  • Element Details

    • clientRegionShortcut

      org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut
      Defines the ClientCache Region data management policy. Defaults to ClientRegionShortcut.PROXY. Use the spring.session.data.gemfire.cache.client.region.shortcut in Spring Boot application.properties.
      Returns:
      a ClientRegionShortcut used to configure the ClientCache Region data management policy.
      See Also:
      • ClientRegionShortcut
      Default:
      PROXY
    • exposeConfigurationAsProperties

      boolean exposeConfigurationAsProperties
      Determines whether the configuration for Spring Session using Apache Geode or Pivotal GemFire should be exposed in the Spring Environment as Properties. Currently, users may configure Spring Session for Apache Geode or Pivotal GemFire using attributes on this Annotation, using the well-known and documented Properties (e.g. spring.session.data.gemfire.session.expiration.max-inactive-interval-seconds) or using the SpringSessionGemFireConfigurer declared as a bean in the Spring application context. The Properties that are exposed will use the well-known property names that are documented in this Annotation's attributes. The values of the resulting Properties follows the precedence as outlined in the documentation: first any SpringSessionGemFireConfigurer bean defined takes precedence, followed by explicit Properties declared in Spring Boot application.properties and finally, this Annotation's attribute values. Defaults to false. Use spring.session.data.gemfire.session.configuration.expose in Spring Boot application.properties.
      Returns:
      a boolean value indicating whether to expose the configuration of Spring Session using Apache Geode or Pivotal GemFire in the Spring Environment as Properties.
      Default:
      false
    • indexableSessionAttributes

      String[] indexableSessionAttributes
      Identifies the Session attributes by name that will be indexed for query operations. For instance, find all Sessions in Apache Geode or Pivotal GemFire having attribute A defined with value X. Defaults to empty String array. Use the spring.session.data.gemfire.session.attributes.indexed in Spring Boot application.properties.
      Returns:
      an array of Strings identifying the names of Session attributes to index.
      Default:
      {}
    • maxInactiveIntervalInSeconds

      int maxInactiveIntervalInSeconds
      Defines the maximum interval in seconds that a Session can remain inactive before it expires. Defaults to 1800 seconds, or 30 minutes. Use the spring.session.data.gemfire.session.expiration.max-inactive-interval-seconds in Spring Boot application.properties.
      Returns:
      an integer value defining the maximum inactive interval in seconds before the Session expires.
      Default:
      1800
    • poolName

      String poolName
      Specifies the name of the specific Pool used by the ClientCache Region (i.e. ClusteredSpringSessions) when performing cache data access operations. This is attribute is only used in the client/server topology. Defaults to gemfirePool. Use the spring.session.data.gemfire.cache.client.pool.name in Spring Boot application.properties.
      Returns:
      the name of the Pool used by the ClientCache Region to send Session state to the cluster of servers.
      See Also:
      Default:
      "gemfirePool"
    • regionName

      String regionName
      Defines the name of the (client)cache Region used to store Session state. Defaults to ClusteredSpringSessions. Use the spring.session.data.gemfire.session.region.name in Spring Boot application.properties.
      Returns:
      a String specifying the name of the (client)cache Region used to store Session state.
      See Also:
      Default:
      "ClusteredSpringSessions"
    • serverRegionShortcut

      org.apache.geode.cache.RegionShortcut serverRegionShortcut
      Defines the Cache Region data management policy. Defaults to RegionShortcut.PARTITION. Use the spring.session.data.gemfire.cache.server.region.shortcut in Spring Boot application.properties.
      Returns:
      a RegionShortcut used to specify and configure the Cache Region data management policy.
      See Also:
      • RegionShortcut
      Default:
      PARTITION
    • sessionExpirationPolicyBeanName

      String sessionExpirationPolicyBeanName
      Defines the name of the bean referring to the SessionExpirationPolicy used to configure the Session expiration logic and strategy. The bean referred to by its name must be of type SessionExpirationPolicy. Defaults to unset. Use the spring.session.data.gemfire.session.expiration.bean-name in Spring Boot application.properties.
      Returns:
      a String containing the bean name of the configured SessionExpirationPolicy.
      See Also:
      Default:
      ""
    • sessionSerializerBeanName

      String sessionSerializerBeanName
      Defines the name of the bean referring to the SessionSerializer used to serialize Session state between client and server or to disk when persisting or overflowing Session state. The bean referred to by its name must be of type SessionSerializer. Defaults to SessionPdxSerializer. Use the spring.session.data.gemfire.session.serializer.bean-name in Spring Boot application.properties.
      Returns:
      a String containing the bean name of the configured SessionSerializer.
      See Also:
      Default:
      "SessionPdxSerializer"