org.springframework.session.data.gemfire.config.annotation.web.http

## Annotation Type EnableGemFireHttpSession

    @Documented
     @Retention(value=RUNTIME)
     @Target(value=TYPE)
     @Configuration
     @Import(value=GemFireHttpSessionConfiguration.class)
    public @interface EnableGemFireHttpSession

Add this annotation to a Spring `@Configuration` class to expose the `SessionRepositoryFilter` as a bean named springSessionRepositoryFilter back the `HttpSession` by Pivotal GemFire or Apache Geode. In order to use this annotation, a single Pivotal GemFire/Apache Geode `Cache` or `ClientCache` instance must be provided. For example:

      @Configuration
      @EnableGemFireHttpSession
     public class GemFirePeerCacheHttpSessionConfiguration {

          @Bean
         public Properties gemfireProperties() {

           Properties gemfireProperties = new Properties();

           gemfireProperties.setProperty("name", "ExamplePeer");
           gemfireProperties.setProperty("mcast-port", "0");
           gemfireProperties.setProperty("log-level", "warning");

           return gemfireProperties;
         }

          @Bean
         public CacheFactoryBean gemfireCache() throws Exception {

           CacheFactoryBean cache  = new CacheFactoryBean();

           cache.setClose(true);
           cache.setProperties(gemfireProperties());

           return cache;
         }
     }

Alternatively, Spring Session can be configured to use Pivotal GemFire/Apache Geode as a cache client with a dedicated Pivotal GemFire/Apache Geode cluster and a `ClientCache`. For example: `@Configuration @EnableGemFireHttpSession public class GemFireClientCacheHttpSessionConfiguration { @Bean public Properties gemfireProperties() { Properties gemfireProperties = new Properties(); gemfireProperties.setProperty("name", "ExampleClient"); gemfireProperties.setProperty("log-level", "warning"); return gemfireProperties; } @Bean public ClientCacheFactoryBean gemfireCache() throws Exception { ClientCacheFactoryBean clientCache = new ClientCacheFactoryBean(); clientCache.setClose(true) clientCache.setProperties(gemfireProperties()); return clientCache; } @Bean public PoolFactoryBean gemfirePool() { PoolFactoryBean pool = new PoolFactoryBean(); pool.addServer(new ConnectionEndpoint("localhost", 40404); return pool; } }` More advanced configurations can extend `GemFireHttpSessionConfiguration` instead.

Since:
  1.1.0
See Also:
  `EnableSpringHttpSession`, `GemFireHttpSessionConfiguration`

### Optional Element Summary

Optional Elements
`org.apache.geode.cache.client.ClientRegionShortcut` `clientRegionShortcut` Defines the GemFire ClientCache Region DataPolicy.
`java.lang.String[]` `indexableSessionAttributes` Identifies the Session attributes by name that should be indexed for query operations.
`int` `maxInactiveIntervalInSeconds` Defines the maximum interval in seconds that a Session can remain inactive before it is considered expired.
`java.lang.String` `poolName` Specifies the name of the specific GemFire `Pool` used by the Spring Session Data GemFire client Region ('ClusteredSpringSessions') when performing cache operations.
`java.lang.String` `regionName` Defines the name of the GemFire (Client)Cache Region used to store Sessions.
`org.apache.geode.cache.RegionShortcut` `serverRegionShortcut` Defines the GemFire, Peer Cache Region DataPolicy.

### Element Detail

#### clientRegionShortcut

    public abstract org.apache.geode.cache.client.ClientRegionShortcut clientRegionShortcut

Defines the GemFire ClientCache Region DataPolicy.

Returns:
  a ClientRegionShortcut used to specify and configure the ClientCache Region DataPolicy.
See Also:
  `ClientRegionShortcut`

Default:
  org.apache.geode.cache.client.ClientRegionShortcut.PROXY

#### indexableSessionAttributes

    public abstract java.lang.String[] indexableSessionAttributes

Identifies the Session attributes by name that should be indexed for query operations. For instance, find all Sessions in GemFire having attribute A defined with value X.

Returns:
  an array of Strings identifying the names of Session attributes to index.

Default:
  {}

#### maxInactiveIntervalInSeconds

    public abstract int maxInactiveIntervalInSeconds

Defines the maximum interval in seconds that a Session can remain inactive before it is considered expired. Defaults to 1800 seconds, or 30 minutes.

Returns:
  an integer value defining the maximum inactive interval in seconds for declaring a Session expired.

Default:
  1800

#### poolName

    public abstract java.lang.String poolName

Specifies the name of the specific GemFire `Pool` used by the Spring Session Data GemFire client Region ('ClusteredSpringSessions') when performing cache operations. This is attribute is only used in the client/server topology.

Returns:
  the name of the GemFire `Pool` to be used by the client Region used to manage (HTTP) Sessions.
See Also:
  `GemfireConstants.DEFAULT_GEMFIRE_POOL_NAME`

Default:
  "gemfirePool"

#### regionName

    public abstract java.lang.String regionName

Defines the name of the GemFire (Client)Cache Region used to store Sessions.

Returns:
  a String specifying the name of the GemFire (Client)Cache Region used to store Sessions.
See Also:
  `Region.getName()`

Default:
  "ClusteredSpringSessions"

#### serverRegionShortcut

    public abstract org.apache.geode.cache.RegionShortcut serverRegionShortcut

Defines the GemFire, Peer Cache Region DataPolicy.

Returns:
  a RegionShortcut used to specify and configure the Peer Cache Region DataPolicy.
See Also:
  `RegionShortcut`

Default:
  org.apache.geode.cache.RegionShortcut.PARTITION