Class DefaultCacheManagerAdmin

    • Method Detail

      • createCache

        public <K,​V> Cache<K,​V> createCache​(String cacheName,
                                                        Configuration configuration)
        Description copied from interface: EmbeddedCacheManagerAdmin
        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 interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Specified by:
        createCache in interface EmbeddedCacheManagerAdmin
        Type Parameters:
        K - the generic type of the key
        V - the generic type of the value
        Parameters:
        cacheName - the name of the cache
        configuration - 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: EmbeddedCacheManagerAdmin
        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 interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Specified by:
        getOrCreateCache in interface EmbeddedCacheManagerAdmin
        Type Parameters:
        K - the generic type of the key
        V - the generic type of the value
        Parameters:
        cacheName - the name of the cache
        configuration - 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: EmbeddedCacheManagerAdmin
        Creates a cache on the container using the specified template.
        Specified by:
        createCache in interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Specified by:
        createCache in interface EmbeddedCacheManagerAdmin
        Parameters:
        cacheName - the name of the cache to create
        template - 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: EmbeddedCacheManagerAdmin
        Retrieves an existing cache or creates one using the specified template if it doesn't exist
        Specified by:
        getOrCreateCache in interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Specified by:
        getOrCreateCache in interface EmbeddedCacheManagerAdmin
        Parameters:
        cacheName - the name of the cache to create
        template - 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)
        Description copied from interface: org.infinispan.commons.api.CacheContainerAdmin
        Removes a cache from the cache container. Any persisted data will be cleared.
        Specified by:
        removeCache in interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Parameters:
        cacheName - the name of the cache to remove
      • withFlags

        public EmbeddedCacheManagerAdmin withFlags​(org.infinispan.commons.api.CacheContainerAdmin.AdminFlag... flags)
        Description copied from interface: org.infinispan.commons.api.CacheContainerAdmin
        Sets any additional CacheContainerAdmin.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:
        withFlags in interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Returns:
      • withFlags

        public EmbeddedCacheManagerAdmin withFlags​(EnumSet<org.infinispan.commons.api.CacheContainerAdmin.AdminFlag> flags)
        Description copied from interface: org.infinispan.commons.api.CacheContainerAdmin
        Sets any additional CacheContainerAdmin.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:
        withFlags in interface org.infinispan.commons.api.CacheContainerAdmin<EmbeddedCacheManagerAdmin,​Configuration>
        Returns: