Class DefaultCacheManagerAdmin
java.lang.Object
org.infinispan.manager.DefaultCacheManagerAdmin
- All Implemented Interfaces:
CacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>,EmbeddedCacheManagerAdmin
The default implementation of
EmbeddedCacheManagerAdmin- Since:
- 9.2
- Author:
- Tristan Tarrant
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.commons.api.CacheContainerAdmin
CacheContainerAdmin.AdminFlag -
Method Summary
Modifier and TypeMethodDescriptionvoidassignAlias(String aliasName, String cacheName) Assign an alias to a cache.<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.voidcreateTemplate(String name, Configuration configuration) Creates a template that is replicated across the cluster using the specified configuration.<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.getOrCreateTemplate(String name, Configuration configuration) Retrieves an existing template or creates one across the cluster using the specified configuration.voidremoveCache(String cacheName) Removes a cache from the cache container.voidremoveTemplate(String name) Removes a template from the cache container.voidupdateConfigurationAttribute(String cacheName, String attributeName, String attributeValue) Updates a mutable configuration attribute for the given cache.Sets any additionalCacheContainerAdmin.AdminFlags to be used when performing administrative operations.withFlags(CacheContainerAdmin.AdminFlag... flags) Sets any additionalCacheContainerAdmin.AdminFlags to be used when performing administrative operations.withSubject(Subject subject) Performs any cache manager operations using the specifiedSubject.
-
Method Details
-
createCache
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 interfaceCacheContainerAdmin<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
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 interfaceCacheContainerAdmin<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
Description copied from interface:EmbeddedCacheManagerAdminCreates a cache on the container using the specified template.- Specified by:
createCachein interfaceCacheContainerAdmin<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
Description copied from interface:EmbeddedCacheManagerAdminRetrieves an existing cache or creates one using the specified template if it doesn't exist- Specified by:
getOrCreateCachein interfaceCacheContainerAdmin<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
-
createTemplate
Description copied from interface:EmbeddedCacheManagerAdminCreates a template that is replicated across the cluster using the specified configuration. The template 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 template to be created on all nodes before returning.- Specified by:
createTemplatein interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Specified by:
createTemplatein interfaceEmbeddedCacheManagerAdmin- Parameters:
name- the name of the templateconfiguration- the configuration to use. It must be a clustered configuration (e.g. distributed)
-
getOrCreateTemplate
Description copied from interface:EmbeddedCacheManagerAdminRetrieves an existing template or creates one across the cluster using the specified configuration. The template 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 template to be created on all nodes before returning.- Specified by:
getOrCreateTemplatein interfaceEmbeddedCacheManagerAdmin- Parameters:
name- the name of the templateconfiguration- the configuration to use. It must be a clustered configuration (e.g. distributed)- Returns:
- the template configuration
-
removeTemplate
Description copied from interface:EmbeddedCacheManagerAdminRemoves a template from the cache container. Any persisted data will be cleared.- Specified by:
removeTemplatein interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Specified by:
removeTemplatein interfaceEmbeddedCacheManagerAdmin- Parameters:
name- the name of the template to remove
-
removeCache
Description copied from interface:CacheContainerAdminRemoves a cache from the cache container. Any persisted data will be cleared.- Specified by:
removeCachein interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Parameters:
cacheName- the name of the cache to remove
-
withFlags
Description copied from interface:CacheContainerAdminSets any additionalCacheContainerAdmin.AdminFlags to be used when performing administrative operations. Note: whether an operation supports a certain flag or not is dependent on the configuration and environment. If a flag cannot be honored, the operation will fail with an exception.- Specified by:
withFlagsin interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Parameters:
flags-- Returns:
-
withFlags
Description copied from interface:CacheContainerAdminSets any additionalCacheContainerAdmin.AdminFlags to be used when performing administrative operations. Note: whether an operation supports a certain flag or not is dependent on the configuration and environment. If a flag cannot be honored, the operation will fail with an exception.- Specified by:
withFlagsin interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Parameters:
flags-- Returns:
-
withSubject
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- Parameters:
subject-- Returns:
- an
EmbeddedCacheManagerAdmininstance on which a real operation is to be invoked, using the specified subject
-
updateConfigurationAttribute
public void updateConfigurationAttribute(String cacheName, String attributeName, String attributeValue) Description copied from interface:EmbeddedCacheManagerAdminUpdates a mutable configuration attribute for the given cache.- Specified by:
updateConfigurationAttributein interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Specified by:
updateConfigurationAttributein interfaceEmbeddedCacheManagerAdmin- Parameters:
cacheName- the name of the cache on which the attribute will be updatedattributeName- the path of the attribute we want to changeattributeValue- the new value to apply to the attribute
-
assignAlias
Description copied from interface:CacheContainerAdminAssign an alias to a cache. If the alias was already associated with another cache, the association will be reassigned to the specified cache. If the alias was not associated with any cache, it is created and associated to the specified cache. If the alias was already associated with the specified cache, this operation does nothing.- Specified by:
assignAliasin interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin, Configuration>- Parameters:
aliasName- the name of the aliascacheName- the name of the cache to which the alias should be associated
-