Package org.infinispan.manager
Interface EmbeddedCacheManagerAdmin
- All Superinterfaces:
CacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration>
- All Known Implementing Classes:
DefaultCacheManagerAdmin
public interface EmbeddedCacheManagerAdmin
extends CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
Cache manager operations which affect the whole cluster. An instance of this can be retrieved from
EmbeddedCacheManager.administration()
- 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 TypeMethodDescription<K,
V> Cache <K, V> createCache
(String name, String template) Creates a cache on the container using the specified template.<K,
V> Cache <K, V> createCache
(String name, Configuration configuration) Creates a cache across the cluster.void
createTemplate
(String name, Configuration configuration) Creates a template that is replicated across the cluster using the specified configuration.<K,
V> Cache <K, V> getOrCreateCache
(String name, 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 name, 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.void
removeTemplate
(String name) Removes a template from the cache container.withSubject
(Subject subject) Performs any cache manager operations using the specifiedSubject
.Methods inherited from interface org.infinispan.commons.api.CacheContainerAdmin
removeCache, withFlags, withFlags
-
Method Details
-
createCache
Creates a cache on the container using the specified template.- Specified by:
createCache
in interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration> - Parameters:
name
- 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
- Throws:
CacheException
- if a cache with the same name already exists
-
getOrCreateCache
Retrieves an existing cache or creates one using the specified template if it doesn't exist- Specified by:
getOrCreateCache
in interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration> - Parameters:
name
- 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
-
createCache
Creates 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:
createCache
in interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration> - Type Parameters:
K
- the generic type of the keyV
- the generic type of the value- Parameters:
name
- the name of the cacheconfiguration
- the configuration to use. It must be a clustered configuration (e.g. distributed)- Returns:
- the cache
- Throws:
CacheException
- if a cache with the same name already exists
-
getOrCreateCache
Retrieves 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:
getOrCreateCache
in interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration> - Type Parameters:
K
- the generic type of the keyV
- the generic type of the value- Parameters:
name
- the name of the cacheconfiguration
- the configuration to use. It must be a clustered configuration (e.g. distributed)- Returns:
- the cache
-
createTemplate
Creates 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:
createTemplate
in interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration> - Parameters:
name
- the name of the templateconfiguration
- the configuration to use. It must be a clustered configuration (e.g. distributed)- Throws:
CacheConfigurationException
- if a template with the same name already exists
-
getOrCreateTemplate
Retrieves 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.- 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
Removes a template from the cache container. Any persisted data will be cleared.- Specified by:
removeTemplate
in interfaceCacheContainerAdmin<EmbeddedCacheManagerAdmin,
Configuration> - Parameters:
name
- the name of the template to remove
-
withSubject
Performs any cache manager operations using the specifiedSubject
. Only applies to cache managers with authorization enabled (seeGlobalConfigurationBuilder.security()
.- Parameters:
subject
-- Returns:
- an
EmbeddedCacheManagerAdmin
instance on which a real operation is to be invoked, using the specified subject
-