public class DefaultCacheManagerAdmin extends Object implements EmbeddedCacheManagerAdmin
EmbeddedCacheManagerAdmin
CacheContainerAdmin.AdminFlag
Modifier and Type | Method and Description |
---|---|
<K,V> Cache<K,V> |
createCache(String cacheName,
Configuration configuration)
Creates a cache across the cluster.
|
<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> |
getOrCreateCache(String cacheName,
Configuration configuration)
Retrieves an existing cache or creates one 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
|
void |
removeCache(String cacheName)
Removes a cache from the cache container.
|
EmbeddedCacheManagerAdmin |
withFlags(CacheContainerAdmin.AdminFlag... flags)
Sets any additional
CacheContainerAdmin.AdminFlag s to be used when performing administrative operations. |
EmbeddedCacheManagerAdmin |
withFlags(EnumSet<CacheContainerAdmin.AdminFlag> flags)
Sets any additional
CacheContainerAdmin.AdminFlag s to be used when performing administrative operations. |
EmbeddedCacheManagerAdmin |
withSubject(Subject subject)
Performs any cache manager operations using the specified
Subject . |
public <K,V> Cache<K,V> createCache(String cacheName, Configuration configuration)
EmbeddedCacheManagerAdmin
createCache
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
createCache
in interface EmbeddedCacheManagerAdmin
K
- the generic type of the keyV
- the generic type of the valuecacheName
- the name of the cacheconfiguration
- the configuration to use. It must be a clustered configuration (e.g. distributed)public <K,V> Cache<K,V> getOrCreateCache(String cacheName, Configuration configuration)
EmbeddedCacheManagerAdmin
getOrCreateCache
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
getOrCreateCache
in interface EmbeddedCacheManagerAdmin
K
- the generic type of the keyV
- the generic type of the valuecacheName
- the name of the cacheconfiguration
- the configuration to use. It must be a clustered configuration (e.g. distributed)public <K,V> Cache<K,V> createCache(String cacheName, String template)
EmbeddedCacheManagerAdmin
createCache
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
createCache
in interface EmbeddedCacheManagerAdmin
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 usedpublic <K,V> Cache<K,V> getOrCreateCache(String cacheName, String template)
EmbeddedCacheManagerAdmin
getOrCreateCache
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
getOrCreateCache
in interface EmbeddedCacheManagerAdmin
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 usedpublic void removeCache(String cacheName)
CacheContainerAdmin
removeCache
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
cacheName
- the name of the cache to removepublic EmbeddedCacheManagerAdmin withFlags(CacheContainerAdmin.AdminFlag... flags)
CacheContainerAdmin
CacheContainerAdmin.AdminFlag
s 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.withFlags
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
public EmbeddedCacheManagerAdmin withFlags(EnumSet<CacheContainerAdmin.AdminFlag> flags)
CacheContainerAdmin
CacheContainerAdmin.AdminFlag
s 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.withFlags
in interface CacheContainerAdmin<EmbeddedCacheManagerAdmin,Configuration>
public EmbeddedCacheManagerAdmin withSubject(Subject subject)
EmbeddedCacheManagerAdmin
Subject
. Only applies to cache managers with authorization
enabled (see GlobalConfigurationBuilder.security()
.withSubject
in interface EmbeddedCacheManagerAdmin
EmbeddedCacheManagerAdmin
instance on which a real operation is to be invoked, using the specified subjectCopyright © 2021 JBoss by Red Hat. All rights reserved.