Package org.infinispan.manager
Class DefaultCacheManagerAdmin
- java.lang.Object
-
- org.infinispan.manager.DefaultCacheManagerAdmin
-
- All Implemented Interfaces:
org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>,EmbeddedCacheManagerAdmin
public class DefaultCacheManagerAdmin extends Object implements EmbeddedCacheManagerAdmin
The default implementation ofEmbeddedCacheManagerAdmin- Since:
- 9.2
- Author:
- Tristan Tarrant
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <K,V>
Cache<K,V>createCache(String cacheName, String template)Creates a cache on the container using the specified template.<K,V>
Cache<K,V>createCache(String cacheName, Configuration configuration)Creates a cache across the cluster.<K,V>
Cache<K,V>getOrCreateCache(String cacheName, String template)Retrieves an existing cache or creates one using the specified template if it doesn't exist<K,V>
Cache<K,V>getOrCreateCache(String cacheName, Configuration configuration)Retrieves an existing cache or creates one across the cluster using the specified configuration.voidremoveCache(String cacheName)EmbeddedCacheManagerAdminwithFlags(EnumSet<org.infinispan.commons.api.CacheContainerAdmin.AdminFlag> flags)EmbeddedCacheManagerAdminwithFlags(org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags)EmbeddedCacheManagerAdminwithSubject(Subject subject)Performs any cache manager operations using the specifiedSubject.
-
-
-
Method Detail
-
createCache
public <K,V> Cache<K,V> createCache(String cacheName, Configuration configuration)
Description copied from interface:EmbeddedCacheManagerAdminCreates a cache across the cluster. The cache will survive topology changes, e.g. when a new node joins the cluster, it will automatically be created there. This method will wait for the cache to be created on all nodes before returning.- Specified by:
createCachein interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>- Specified by:
createCachein interfaceEmbeddedCacheManagerAdmin- Type Parameters:
K- the generic type of the keyV- the generic type of the value- Parameters:
cacheName- the name of the cacheconfiguration- the configuration to use. It must be a clustered configuration (e.g. distributed)- Returns:
- the cache
-
getOrCreateCache
public <K,V> Cache<K,V> getOrCreateCache(String cacheName, Configuration configuration)
Description copied from interface:EmbeddedCacheManagerAdminRetrieves an existing cache or creates one across the cluster using the specified configuration. The cache will survive topology changes, e.g. when a new node joins the cluster, it will automatically be created there. This method will wait for the cache to be created on all nodes before returning.- Specified by:
getOrCreateCachein interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>- Specified by:
getOrCreateCachein interfaceEmbeddedCacheManagerAdmin- Type Parameters:
K- the generic type of the keyV- the generic type of the value- Parameters:
cacheName- the name of the cacheconfiguration- the configuration to use. It must be a clustered configuration (e.g. distributed)- Returns:
- the cache
-
createCache
public <K,V> Cache<K,V> createCache(String cacheName, String template)
Description copied from interface:EmbeddedCacheManagerAdminCreates a cache on the container using the specified template.- Specified by:
createCachein interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>- Specified by:
createCachein interfaceEmbeddedCacheManagerAdmin- Parameters:
cacheName- the name of the cache to createtemplate- the template to use for the cache. If null, the configuration marked as default on the container will be used- Returns:
- the cache
-
getOrCreateCache
public <K,V> Cache<K,V> getOrCreateCache(String cacheName, String template)
Description copied from interface:EmbeddedCacheManagerAdminRetrieves an existing cache or creates one using the specified template if it doesn't exist- Specified by:
getOrCreateCachein interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>- Specified by:
getOrCreateCachein interfaceEmbeddedCacheManagerAdmin- Parameters:
cacheName- the name of the cache to createtemplate- the template to use for the cache. If null, the configuration marked as default on the container will be used- Returns:
- the cache
-
removeCache
public void removeCache(String cacheName)
- Specified by:
removeCachein interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
-
withFlags
public EmbeddedCacheManagerAdmin withFlags(org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags)
- Specified by:
withFlagsin interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
-
withFlags
public EmbeddedCacheManagerAdmin withFlags(EnumSet<org.infinispan.commons.api.CacheContainerAdmin.AdminFlag> flags)
- Specified by:
withFlagsin interfaceorg.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
-
withSubject
public EmbeddedCacheManagerAdmin withSubject(Subject subject)
Description copied from interface:EmbeddedCacheManagerAdminPerforms any cache manager operations using the specifiedSubject. Only applies to cache managers with authorization enabled (seeGlobalConfigurationBuilder.security().- Specified by:
withSubjectin interfaceEmbeddedCacheManagerAdmin- Returns:
- an
EmbeddedCacheManagerAdmininstance on which a real operation is to be invoked, using the specified subject
-
-