All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.globalstate.GlobalConfigurationManager Maven / Gradle / Ivy

There is a newer version: 15.1.0.Dev04
Show newest version
package org.infinispan.globalstate;

import java.util.EnumSet;
import java.util.concurrent.CompletionStage;

import org.infinispan.Cache;
import org.infinispan.commons.api.CacheContainerAdmin.AdminFlag;
import org.infinispan.commons.internal.InternalCacheNames;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.factories.scopes.Scope;
import org.infinispan.factories.scopes.Scopes;

/**
 * The {@link GlobalConfigurationManager} is the main interface for sharing runtime configuration state across a cluster.
 * It uses an internal cache 'org.infinispan.CONFIG'. The cache is keyed with {@link ScopedState}. Each scope owner is responsible
 * for its own keys.
 *
 * @author Tristan Tarrant
 * @since 9.2
 */
@Scope(Scopes.GLOBAL)
public interface GlobalConfigurationManager {

   @Deprecated(forRemoval = true, since = "15.0")
   String CONFIG_STATE_CACHE_NAME = InternalCacheNames.CONFIG_STATE_CACHE_NAME;

   default void postStart() {}

   /**
    * Returns the global state cache
    */
    Cache getStateCache();

   /**
    * Defines a cluster-wide configuration template
    *
    * @param name the name of the template
    * @param configuration the configuration object
    * @param flags the flags to apply
    */
   CompletionStage createTemplate(String name, Configuration configuration, EnumSet flags);

   /**
    * Defines a cluster-wide configuration template
    *
    * @param name the name of the template
    * @param configuration the configuration object
    * @param flags the flags to apply
    */
   CompletionStage getOrCreateTemplate(String name, Configuration configuration, EnumSet flags);

   /**
    * Defines a cluster-wide cache configuration
    * @param cacheName the name of the configuration
    * @param configuration the configuration object
    * @param flags the flags to apply
    */
   CompletionStage createCache(String cacheName, Configuration configuration, EnumSet flags);

   /**
    * Defines a cluster-wide cache configuration or retrieves an existing one
    * @param cacheName the name of the configuration
    * @param configuration the configuration object
    * @param flags the flags to apply
    */
   CompletionStage getOrCreateCache(String cacheName, Configuration configuration, EnumSet flags);

   /**
    * Defines a cluster-wide cache configuration using the supplied template
    * @param cacheName the name of the configuration
    * @param template the template name to use
    * @param flags the flags to apply
    */
   CompletionStage createCache(String cacheName, String template, EnumSet flags);

   /**
    * Defines a cluster-wide cache configuration using the supplied template or retrieves an existing one
    * @param cacheName the name of the configuration
    * @param template the template name to use
    * @param flags the flags to apply
    */
   CompletionStage getOrCreateCache(String cacheName, String template, EnumSet flags);

   /**
    * Removes a cluster-wide cache and its configuration
    * @param cacheName the name of the cache
    * @param flags
    */
   CompletionStage removeCache(String cacheName, EnumSet flags);

   /**
    * Removes a cluster-wide template
    * @param name the name of the template
    * @param flags
    */
   CompletionStage removeTemplate(String name, EnumSet flags);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy