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

## Class GemFireHttpSessionConfiguration

- java.lang.Object
- - org.springframework.session.config.annotation.web.http.SpringHttpSessionConfiguration
  - - org.springframework.session.data.gemfire.config.annotation.web.http.GemFireHttpSessionConfiguration

All Implemented Interfaces:
  org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.annotation.ImportAware, org.springframework.context.ApplicationContextAware

    @Configuration
    public class GemFireHttpSessionConfiguration
    extends org.springframework.session.config.annotation.web.http.SpringHttpSessionConfiguration
    implements org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.annotation.ImportAware

The `GemFireHttpSessionConfiguration` class is a Spring `@Configuration` class used to configure and initialize Pivotal GemFire/Apache Geode as a clustered, replicated and distributed `HttpSession` provider implementation in Spring `ExpiringSession`.

Since:
  1.1.0
See Also:
  `ExpirationAttributes`, `GemFireCache`, `Region`, `RegionAttributes`, `RegionShortcut`, `ClientRegionShortcut`, `Pool`, `BeanClassLoaderAware`, `Bean`, `Configuration`, `ImportAware`, `AnnotationMetadata`, `GemfireOperations`, `GemfireTemplate`, `IndexFactoryBean`, `IndexType`, `RegionAttributesFactoryBean`, `ExpiringSession`, `SpringHttpSessionConfiguration`, `GemFireOperationsSessionRepository`, `EnableGemFireHttpSession`, `GemFireCacheTypeAwareRegionFactoryBean`, `SessionAttributesIndexFactoryBean`

### Field Summary

Fields
`static org.apache.geode.cache.client.ClientRegionShortcut` `DEFAULT_CLIENT_REGION_SHORTCUT` The default `ClientRegionShortcut` used to configure the GemFire ClientCache Region that will store Spring Sessions.
`static java.lang.String` `DEFAULT_GEMFIRE_POOL_NAME` Name of the GemFire `Pool` used by the client Region for managing Session state information.
`static java.lang.String[]` `DEFAULT_INDEXABLE_SESSION_ATTRIBUTES` The default names of all Session attributes that should be indexed by GemFire.
`static int` `DEFAULT_MAX_INACTIVE_INTERVAL_IN_SECONDS` The default maximum interval in seconds in which a Session can remain inactive before it is considered expired.
`static org.apache.geode.cache.RegionShortcut` `DEFAULT_SERVER_REGION_SHORTCUT` The default `RegionShortcut` used to configure the GemFire Cache Region that will store Spring Sessions.
`static java.lang.String` `DEFAULT_SPRING_SESSION_GEMFIRE_REGION_NAME` The default name of the Gemfire (Client)Cache Region used to store Sessions.
`protected static java.lang.Class<java.lang.Object>` `SPRING_SESSION_GEMFIRE_REGION_KEY_CONSTRAINT`
`protected static java.lang.Class<AbstractGemFireOperationsSessionRepository.GemFireSession>` `SPRING_SESSION_GEMFIRE_REGION_VALUE_CONSTRAINT`

### Constructor Summary

Constructors
Constructor and Description
`GemFireHttpSessionConfiguration()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected java.lang.ClassLoader` `getBeanClassLoader()` Gets a reference to the `ClassLoader` used to load bean definition class types in a Spring context.
`protected org.apache.geode.cache.client.ClientRegionShortcut` `getClientRegionShortcut()` Gets the `ClientRegionShortcut` used to configure the GemFire ClientCache Region that will store Spring Sessions.
`protected java.lang.String[]` `getIndexableSessionAttributes()` Get the names of all Session attributes that should be indexed by GemFire.
`protected int` `getMaxInactiveIntervalInSeconds()` Gets the maximum interval in seconds in which a Session can remain inactive before it is considered expired.
`protected java.lang.String` `getPoolName()` Returns the name of the GemFire `Pool` used by the client Region for managing Sessions during cache operations involving the server.
`protected org.apache.geode.cache.RegionShortcut` `getServerRegionShortcut()` Gets the `RegionShortcut` used to configure the GemFire Cache Region that will store Spring Sessions.
`protected java.lang.String` `getSpringSessionGemFireRegionName()` Gets the name of the Gemfire (Client)Cache Region used to store Sessions.
`org.springframework.data.gemfire.IndexFactoryBean` `principalNameIndex(org.apache.geode.cache.GemFireCache gemfireCache)` Defines a GemFire Index bean on the GemFire cache `Region` storing and managing Sessions, specifically on the 'principalName' property for quick lookup of Sessions by 'principalName'.
`SessionAttributesIndexFactoryBean` `sessionAttributesIndex(org.apache.geode.cache.GemFireCache gemfireCache)` Defines a GemFire Index bean on the GemFire cache `Region` storing and managing Sessions, specifically on all Session attributes for quick lookup and queries on Session attribute names with a given value.

`GemFireCacheTypeAwareRegionFactoryBean<java.lang.Object,org.springframework.session.ExpiringSession>`

`sessionRegion(org.apache.geode.cache.GemFireCache gemfireCache, org.apache.geode.cache.RegionAttributes<java.lang.Object,org.springframework.session.ExpiringSession> sessionRegionAttributes)`
Defines a Spring GemFire `Cache` `Region` bean used to store and manage Sessions using either a client-server or peer-to-peer (p2p) topology.

`org.springframework.data.gemfire.RegionAttributesFactoryBean` `sessionRegionAttributes(org.apache.geode.cache.GemFireCache gemfireCache)` Defines a Spring GemFire `RegionAttributes` bean used to configure and initialize the GemFire cache `Region` storing Sessions.
`org.springframework.data.gemfire.GemfireTemplate` `sessionRegionTemplate(org.apache.geode.cache.GemFireCache gemFireCache)` Defines a Spring GemfireTemplate bean used to interact with GemFire's (Client)Cache `Region` storing Sessions.
`GemFireOperationsSessionRepository` `sessionRepository(org.springframework.data.gemfire.GemfireOperations gemfireOperations)` Defines the Spring SessionRepository bean used to interact with GemFire as a Spring Session provider.
`void` `setBeanClassLoader(java.lang.ClassLoader beanClassLoader)` Sets a reference to the `ClassLoader` used to load bean definition class types in a Spring context.
`void` `setClientRegionShortcut(org.apache.geode.cache.client.ClientRegionShortcut shortcut)` Sets the `ClientRegionShortcut` used to configure the GemFire ClientCache Region that will store Spring Sessions.
`void` `setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)` Callback with the `AnnotationMetadata` of the class containing @Import annotation that imported this @Configuration class.
`void` `setIndexableSessionAttributes(java.lang.String[] indexableSessionAttributes)` Sets the names of all Session attributes that should be indexed by GemFire.
`void` `setMaxInactiveIntervalInSeconds(int maxInactiveIntervalInSeconds)` Sets the maximum interval in seconds in which a Session can remain inactive before it is considered expired.
`void` `setPoolName(java.lang.String poolName)` Sets the name of the GemFire `Pool` used by the client Region for managing Sessions during cache operations involving the server.
`void` `setServerRegionShortcut(org.apache.geode.cache.RegionShortcut shortcut)` Sets the `RegionShortcut` used to configure the GemFire Cache Region that will store Spring Sessions.
`void` `setSpringSessionGemFireRegionName(java.lang.String springSessionGemFireRegionName)` Sets the name of the Gemfire (Client)Cache Region used to store Sessions.

### Methods inherited from class org.springframework.session.config.annotation.web.http.SpringHttpSessionConfiguration

`init, sessionEventHttpSessionListenerAdapter, setApplicationContext, setCookieSerializer, setHttpSessionListeners, setHttpSessionStrategy, setServletContext, springSessionRepositoryFilter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### DEFAULT_MAX_INACTIVE_INTERVAL_IN_SECONDS

    public static final int DEFAULT_MAX_INACTIVE_INTERVAL_IN_SECONDS

The default maximum interval in seconds in which a Session can remain inactive before it is considered expired.

#### SPRING_SESSION_GEMFIRE_REGION_KEY_CONSTRAINT

    protected static final java.lang.Class<java.lang.Object> SPRING_SESSION_GEMFIRE_REGION_KEY_CONSTRAINT

#### SPRING_SESSION_GEMFIRE_REGION_VALUE_CONSTRAINT

    protected static final java.lang.Class<AbstractGemFireOperationsSessionRepository.GemFireSession> SPRING_SESSION_GEMFIRE_REGION_VALUE_CONSTRAINT

#### DEFAULT_CLIENT_REGION_SHORTCUT

    public static final org.apache.geode.cache.client.ClientRegionShortcut DEFAULT_CLIENT_REGION_SHORTCUT

The default `ClientRegionShortcut` used to configure the GemFire ClientCache Region that will store Spring Sessions.

#### DEFAULT_SERVER_REGION_SHORTCUT

    public static final org.apache.geode.cache.RegionShortcut DEFAULT_SERVER_REGION_SHORTCUT

The default `RegionShortcut` used to configure the GemFire Cache Region that will store Spring Sessions.

#### DEFAULT_GEMFIRE_POOL_NAME

    public static final java.lang.String DEFAULT_GEMFIRE_POOL_NAME

Name of the GemFire `Pool` used by the client Region for managing Session state information.

See Also:
  Constant Field Values

#### DEFAULT_SPRING_SESSION_GEMFIRE_REGION_NAME

    public static final java.lang.String DEFAULT_SPRING_SESSION_GEMFIRE_REGION_NAME

The default name of the Gemfire (Client)Cache Region used to store Sessions.

See Also:
  Constant Field Values

#### DEFAULT_INDEXABLE_SESSION_ATTRIBUTES

    public static final java.lang.String[] DEFAULT_INDEXABLE_SESSION_ATTRIBUTES

The default names of all Session attributes that should be indexed by GemFire.

### Constructor Detail

#### GemFireHttpSessionConfiguration

    public GemFireHttpSessionConfiguration()

### Method Detail

#### setBeanClassLoader

    public void setBeanClassLoader(java.lang.ClassLoader beanClassLoader)

Sets a reference to the `ClassLoader` used to load bean definition class types in a Spring context.

Specified by:
  `setBeanClassLoader` in interface `org.springframework.beans.factory.BeanClassLoaderAware`
Parameters:
  `beanClassLoader` - the ClassLoader used by the Spring container to load bean class types.
See Also:
  `BeanClassLoaderAware.setBeanClassLoader(ClassLoader)`, `ClassLoader`

#### getBeanClassLoader

    protected java.lang.ClassLoader getBeanClassLoader()

Gets a reference to the `ClassLoader` used to load bean definition class types in a Spring context.

Returns:
  the ClassLoader used by the Spring container to load bean class types.
See Also:
  `ClassLoader`

#### setClientRegionShortcut

    public void setClientRegionShortcut(org.apache.geode.cache.client.ClientRegionShortcut shortcut)

Sets the `ClientRegionShortcut` used to configure the GemFire ClientCache Region that will store Spring Sessions.

Parameters:
  `shortcut` - the ClientRegionShortcut used to configure the GemFire ClientCache Region.
See Also:
  `ClientRegionShortcut`

#### getClientRegionShortcut

    protected org.apache.geode.cache.client.ClientRegionShortcut getClientRegionShortcut()

Gets the `ClientRegionShortcut` used to configure the GemFire ClientCache Region that will store Spring Sessions. Defaults to `ClientRegionShortcut.PROXY`.

Returns:
  the ClientRegionShortcut used to configure the GemFire ClientCache Region.
See Also:
  `ClientRegionShortcut`, `EnableGemFireHttpSession.clientRegionShortcut()`

#### setIndexableSessionAttributes

    public void setIndexableSessionAttributes(java.lang.String[] indexableSessionAttributes)

Sets the names of all Session attributes that should be indexed by GemFire.

Parameters:
  `indexableSessionAttributes` - an array of Strings indicating the names of all Session attributes for which an Index will be created by GemFire.

#### getIndexableSessionAttributes

    protected java.lang.String[] getIndexableSessionAttributes()

Get the names of all Session attributes that should be indexed by GemFire.

Returns:
  an array of Strings indicating the names of all Session attributes for which an Index will be created by GemFire. Defaults to an empty String array if unspecified.
See Also:
  `EnableGemFireHttpSession.indexableSessionAttributes()`

#### setMaxInactiveIntervalInSeconds

    public void setMaxInactiveIntervalInSeconds(int maxInactiveIntervalInSeconds)

Sets the maximum interval in seconds in which a Session can remain inactive before it is considered expired.

Parameters:
  `maxInactiveIntervalInSeconds` - an integer value specifying the maximum interval in seconds that a Session can remain inactive before it is considered expired.

#### getMaxInactiveIntervalInSeconds

    protected int getMaxInactiveIntervalInSeconds()

Gets the maximum interval in seconds in which a Session can remain inactive before it is considered expired.

Returns:
  an integer value specifying the maximum interval in seconds that a Session can remain inactive before it is considered expired.
See Also:
  `EnableGemFireHttpSession.maxInactiveIntervalInSeconds()`

#### setPoolName

    public void setPoolName(java.lang.String poolName)

Sets the name of the GemFire `Pool` used by the client Region for managing Sessions during cache operations involving the server.

Parameters:
  `poolName` - the name of a GemFire `Pool`.
See Also:
  `Pool.getName()`

#### getPoolName

    protected java.lang.String getPoolName()

Returns the name of the GemFire `Pool` used by the client Region for managing Sessions during cache operations involving the server.

Returns:
  the name of a GemFire `Pool`.
See Also:
  `Pool.getName()`

#### setServerRegionShortcut

    public void setServerRegionShortcut(org.apache.geode.cache.RegionShortcut shortcut)

Sets the `RegionShortcut` used to configure the GemFire Cache Region that will store Spring Sessions.

Parameters:
  `shortcut` - the RegionShortcut used to configure the GemFire Cache Region.
See Also:
  `RegionShortcut`

#### getServerRegionShortcut

    protected org.apache.geode.cache.RegionShortcut getServerRegionShortcut()

Gets the `RegionShortcut` used to configure the GemFire Cache Region that will store Spring Sessions. Defaults to `RegionShortcut.PARTITION`.

Returns:
  the RegionShortcut used to configure the GemFire Cache Region.
See Also:
  `RegionShortcut`, `EnableGemFireHttpSession.serverRegionShortcut()`

#### setSpringSessionGemFireRegionName

    public void setSpringSessionGemFireRegionName(java.lang.String springSessionGemFireRegionName)

Sets the name of the Gemfire (Client)Cache Region used to store Sessions.

Parameters:
  `springSessionGemFireRegionName` - a String specifying the name of the GemFire (Client)Cache Region used to store the Session.

#### getSpringSessionGemFireRegionName

    protected java.lang.String getSpringSessionGemFireRegionName()

Gets the name of the Gemfire (Client)Cache Region used to store Sessions. Defaults to 'ClusteredSpringSessions'.

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

#### setImportMetadata

    public void setImportMetadata(org.springframework.core.type.AnnotationMetadata importMetadata)

Callback with the `AnnotationMetadata` of the class containing @Import annotation that imported this @Configuration class.

Specified by:
  `setImportMetadata` in interface `org.springframework.context.annotation.ImportAware`
Parameters:
  `importMetadata` - the AnnotationMetadata of the class importing this @Configuration class.

#### sessionRepository

    @Bean
    public GemFireOperationsSessionRepository sessionRepository(@Qualifier(value="sessionRegionTemplate")
                                                                      org.springframework.data.gemfire.GemfireOperations gemfireOperations)

Defines the Spring SessionRepository bean used to interact with GemFire as a Spring Session provider.

Parameters:
  `gemfireOperations` - an instance of `GemfireOperations` used to manage Spring Sessions in GemFire.
Returns:
  a GemFireOperationsSessionRepository for managing (clustering/replicating) Sessions using GemFire.

#### sessionRegionTemplate

    @Bean
     @DependsOn(value="ClusteredSpringSessions")
    public org.springframework.data.gemfire.GemfireTemplate sessionRegionTemplate(org.apache.geode.cache.GemFireCache gemFireCache)

Defines a Spring GemfireTemplate bean used to interact with GemFire's (Client)Cache `Region` storing Sessions.

Parameters:
  `gemFireCache` - reference to the single GemFire cache instance used by the `GemfireTemplate` to perform GemFire cache data access operations.
Returns:
  a `GemfireTemplate` used to interact with GemFire's (Client)Cache `Region` storing Sessions.
See Also:
  `GemfireTemplate`, `Region`

#### sessionRegion

    @Bean(name="ClusteredSpringSessions")
    public GemFireCacheTypeAwareRegionFactoryBean<java.lang.Object,org.springframework.session.ExpiringSession> sessionRegion(org.apache.geode.cache.GemFireCache gemfireCache,
                                                                                                                                                                    @Qualifier(value="sessionRegionAttributes")
                                                                                                                                                                    org.apache.geode.cache.RegionAttributes<java.lang.Object,org.springframework.session.ExpiringSession> sessionRegionAttributes)

Defines a Spring GemFire `Cache` `Region` bean used to store and manage Sessions using either a client-server or peer-to-peer (p2p) topology.

Parameters:
  `gemfireCache` - a reference to the GemFire `Cache`.
  `sessionRegionAttributes` - the GemFire `RegionAttributes` used to configure the `Region`.
Returns:
  a `GemFireCacheTypeAwareRegionFactoryBean` used to configure and initialize a GemFire Cache `Region` for storing and managing Sessions.
See Also:
  `getClientRegionShortcut()`, `getSpringSessionGemFireRegionName()`, `getServerRegionShortcut()`

#### sessionRegionAttributes

    @Bean
    public org.springframework.data.gemfire.RegionAttributesFactoryBean sessionRegionAttributes(org.apache.geode.cache.GemFireCache gemfireCache)

Defines a Spring GemFire `RegionAttributes` bean used to configure and initialize the GemFire cache `Region` storing Sessions. Expiration is also configured for the `Region` on the basis that the GemFire cache `Region` is a not a proxy, on either the client or server.

Parameters:
  `gemfireCache` - a reference to the GemFire cache.
Returns:
  an instance of `RegionAttributes` used to configure and initialize the GemFire cache `Region` for storing and managing Sessions.
See Also:
  `RegionAttributesFactoryBean`, `GemFireCache`, `PartitionAttributes`, `isExpirationAllowed(GemFireCache)`

#### principalNameIndex

    @Bean
     @DependsOn(value="ClusteredSpringSessions")
    public org.springframework.data.gemfire.IndexFactoryBean principalNameIndex(org.apache.geode.cache.GemFireCache gemfireCache)

Defines a GemFire Index bean on the GemFire cache `Region` storing and managing Sessions, specifically on the 'principalName' property for quick lookup of Sessions by 'principalName'.

Parameters:
  `gemfireCache` - a reference to the GemFire cache.
Returns:
  a `IndexFactoryBean` to create an GemFire Index on the 'principalName' property for Sessions stored in the GemFire cache `Region`.
See Also:
  `IndexFactoryBean`, `GemFireCache`

#### sessionAttributesIndex

    @Bean
     @DependsOn(value="ClusteredSpringSessions")
    public SessionAttributesIndexFactoryBean sessionAttributesIndex(org.apache.geode.cache.GemFireCache gemfireCache)

Defines a GemFire Index bean on the GemFire cache `Region` storing and managing Sessions, specifically on all Session attributes for quick lookup and queries on Session attribute names with a given value.

Parameters:
  `gemfireCache` - a reference to the GemFire cache.
Returns:
  a `IndexFactoryBean` to create an GemFire Index on attributes of Sessions stored in the GemFire cache `Region`.
See Also:
  `IndexFactoryBean`, `GemFireCache`