Class InfinispanSessionMetaDataFactory<C>
java.lang.Object
org.wildfly.clustering.session.infinispan.embedded.metadata.InfinispanSessionMetaDataFactory<C>
- Type Parameters:
C- the session context type
- All Implemented Interfaces:
AutoCloseable, CacheEntryCreator<String, ContextualSessionMetaDataEntry<C>, Map.Entry<Instant, Optional<Duration>>>, CacheEntryLocator<String, ContextualSessionMetaDataEntry<C>>, CacheEntryRemover<String>, ImmutableSessionMetaDataFactory<ContextualSessionMetaDataEntry<C>>, SessionMetaDataFactory<ContextualSessionMetaDataEntry<C>>
public class InfinispanSessionMetaDataFactory<C>
extends Object
implements SessionMetaDataFactory<ContextualSessionMetaDataEntry<C>>
A factory for creating session metadata.
- Author:
- Paul Ferraro
-
Constructor Summary
ConstructorsConstructorDescriptionInfinispanSessionMetaDataFactory(EmbeddedCacheConfiguration configuration) Creates a session metadata factory. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Creates immutable session metadata for the specified identifier and cache entry.createSessionMetaData(String id, ContextualSessionMetaDataEntry<C> entry) Creates invalidatable session metadata from the specified identifier and cache value.Creates a value in the cache, if it does not already exist.findValueAsync(String id) Locates the value in the cache with the specified identifier.purgeAsync(String id) Removes the specified entry from the cache.removeAsync(String id) Removes the specified entry from the cache.tryValueAsync(String id) Returns the value for the specified key, if possible without contention.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface CacheEntryCreator
createValueMethods inherited from interface CacheEntryLocator
findValue, tryValueMethods inherited from interface CacheEntryRemover
purge, remove
-
Constructor Details
-
InfinispanSessionMetaDataFactory
Creates a session metadata factory.- Parameters:
configuration- the configuration of the associated cache
-
-
Method Details
-
createValueAsync
public CompletionStage<ContextualSessionMetaDataEntry<C>> createValueAsync(String id, Map.Entry<Instant, Optional<Duration>> context) Description copied from interface:CacheEntryCreatorCreates a value in the cache, if it does not already exist.- Specified by:
createValueAsyncin interfaceCacheEntryCreator<String, ContextualSessionMetaDataEntry<C>, Map.Entry<Instant, Optional<Duration>>>- Parameters:
id- the cache entry identifier.context- the context of the created value- Returns:
- the new value, or the existing value the cache entry already exists.
-
findValueAsync
Description copied from interface:CacheEntryLocatorLocates the value in the cache with the specified identifier.- Specified by:
findValueAsyncin interfaceCacheEntryLocator<String, ContextualSessionMetaDataEntry<C>>- Parameters:
id- the cache entry identifier- Returns:
- the value of the cache entry, or null if not found.
-
tryValueAsync
Description copied from interface:CacheEntryLocatorReturns the value for the specified key, if possible without contention.- Specified by:
tryValueAsyncin interfaceCacheEntryLocator<String, ContextualSessionMetaDataEntry<C>>- Parameters:
id- a logical key- Returns:
- the value of the cache entry, or null if not found or unavailable.
-
removeAsync
Description copied from interface:CacheEntryRemoverRemoves the specified entry from the cache.- Specified by:
removeAsyncin interfaceCacheEntryRemover<C>- Parameters:
id- the cache entry identifier.- Returns:
- true, if the entry was removed.
-
purgeAsync
Description copied from interface:CacheEntryRemoverRemoves the specified entry from the cache.- Specified by:
purgeAsyncin interfaceCacheEntryRemover<C>- Parameters:
id- the cache entry identifier.- Returns:
- true, if the entry was removed.
-
createImmutableSessionMetaData
public ImmutableSessionMetaData createImmutableSessionMetaData(String id, ContextualSessionMetaDataEntry<C> entry) Description copied from interface:ImmutableSessionMetaDataFactoryCreates immutable session metadata for the specified identifier and cache entry.- Specified by:
createImmutableSessionMetaDatain interfaceImmutableSessionMetaDataFactory<C>- Parameters:
id- the identifier of a sessionentry- the cache value of the session- Returns:
- immutable session metadata for the specified identifier and cache entry.
-
createSessionMetaData
public InvalidatableSessionMetaData createSessionMetaData(String id, ContextualSessionMetaDataEntry<C> entry) Description copied from interface:SessionMetaDataFactoryCreates invalidatable session metadata from the specified identifier and cache value.- Specified by:
createSessionMetaDatain interfaceSessionMetaDataFactory<C>- Parameters:
id- the identifier of a sessionentry- the cache value of the session- Returns:
- invalidatable session metadata from the specified identifier and cache value.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSessionMetaDataFactory<C>
-