Class HotRodSessionMetaDataFactory<C>
java.lang.Object
org.wildfly.clustering.session.infinispan.remote.metadata.HotRodSessionMetaDataFactory<C>
- Type Parameters:
C- the local context type
- All Implemented Interfaces:
AutoCloseable,BiFunction<SessionCreationMetaDataEntry<C>,,SessionAccessMetaDataEntry, SessionMetaDataEntry<C>> CacheEntryCreator<String,,SessionMetaDataEntry<C>, Duration> CacheEntryLocator<String,,SessionMetaDataEntry<C>> CacheEntryRemover<String>,ImmutableSessionMetaDataFactory<SessionMetaDataEntry<C>>,SessionMetaDataFactory<SessionMetaDataEntry<C>>
public class HotRodSessionMetaDataFactory<C>
extends Object
implements SessionMetaDataFactory<SessionMetaDataEntry<C>>, BiFunction<SessionCreationMetaDataEntry<C>,SessionAccessMetaDataEntry,SessionMetaDataEntry<C>>
Factory for creating
SessionMetaData backed by a pair of RemoteCache entries.- Author:
- Paul Ferraro
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(SessionCreationMetaDataEntry<C> creationMetaData, SessionAccessMetaDataEntry accessMetaData) voidclose()createImmutableSessionMetaData(String id, SessionMetaDataEntry<C> entry) createSessionMetaData(String id, SessionMetaDataEntry<C> entry) createValueAsync(String id, Duration defaultTimeout) 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.removeAsync(String id) Removes the specified entry from the cache.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface org.wildfly.clustering.cache.CacheEntryCreator
createValueMethods inherited from interface org.wildfly.clustering.cache.CacheEntryLocator
findValue, tryValue, tryValueAsyncMethods inherited from interface org.wildfly.clustering.cache.CacheEntryRemover
purge, purgeAsync, remove
-
Constructor Details
-
HotRodSessionMetaDataFactory
-
-
Method Details
-
createValueAsync
public CompletionStage<SessionMetaDataEntry<C>> createValueAsync(String id, Duration defaultTimeout) Description copied from interface:CacheEntryCreatorCreates a value in the cache, if it does not already exist.- Specified by:
createValueAsyncin interfaceCacheEntryCreator<String,SessionMetaDataEntry<C>, Duration> - Parameters:
id- the cache entry identifier.defaultTimeout- 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,SessionMetaDataEntry<C>> - Parameters:
id- the cache entry identifier- Returns:
- the value of the cache entry, or null if not found.
-
apply
public SessionMetaDataEntry<C> apply(SessionCreationMetaDataEntry<C> creationMetaData, SessionAccessMetaDataEntry accessMetaData) - Specified by:
applyin interfaceBiFunction<SessionCreationMetaDataEntry<C>,SessionAccessMetaDataEntry, SessionMetaDataEntry<C>>
-
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.
-
createSessionMetaData
- Specified by:
createSessionMetaDatain interfaceSessionMetaDataFactory<C>
-
createImmutableSessionMetaData
public ImmutableSessionMetaData createImmutableSessionMetaData(String id, SessionMetaDataEntry<C> entry) - Specified by:
createImmutableSessionMetaDatain interfaceImmutableSessionMetaDataFactory<C>
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSessionMetaDataFactory<C>
-