@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Import(value=MongoHttpSessionConfiguration.class) @Configuration public @interface EnableMongoHttpSession
@Configuration
class to expose the
SessionRepositoryFilter as a bean named "springSessionRepositoryFilter" and backed by
Mongo. Use collectionName
to change default name of the collection used to
store sessions.
@EnableMongoHttpSession
public class MongoHttpSessionConfig {
@Bean
public MongoOperations mongoOperations() throws UnknownHostException {
return new MongoTemplate(new MongoClient(), "databaseName");
}
}
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
collectionName
The collection name to use.
|
int |
maxInactiveIntervalInSeconds
The maximum time a session will be kept if it is inactive.
|