-
Notifications
You must be signed in to change notification settings - Fork 612
/
LocalConfigurationStorage.java
56 lines (49 loc) · 2.25 KB
/
LocalConfigurationStorage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package org.infinispan.globalstate;
import java.util.EnumSet;
import java.util.Map;
import org.infinispan.commons.api.CacheContainerAdmin;
import org.infinispan.configuration.cache.Configuration;
import org.infinispan.manager.EmbeddedCacheManager;
/**
* The {@link LocalConfigurationStorage} is responsible for applying on each node the configuration changes initiated
* through the {@link org.infinispan.globalstate.GlobalConfigurationManager} and persist them if requested via
* {@link org.infinispan.commons.api.CacheContainerAdmin.AdminFlag#PERMANENT}.
*
* @author Tristan Tarrant
* @since 9.2
*/
public interface LocalConfigurationStorage {
/**
* Initialization entry point for the {@link LocalConfigurationStorage}
* @param embeddedCacheManager
*/
void initialize(EmbeddedCacheManager embeddedCacheManager);
/**
* Checks whether this {@link LocalConfigurationStorage} supports the supplied flags.
* A {@link org.infinispan.commons.CacheConfigurationException} will be thrown in case this cannot be done.
*
*/
void validateFlags(EnumSet<CacheContainerAdmin.AdminFlag> flags);
/**
* Creates the cache using the supplied template, configuration and flags. This method may be invoked either with or
* without a template. In both cases a concrete configuration will also be available. If a template name is present,
* the {@link LocalConfigurationStorage} should use it, e.g. when persisting the configuration.
*
* @param name the name of the cache to create
* @param template the template that should be used to configure the cache. Can be null.
* @param configuration the {@link Configuration} to use
* @param flags the desired {@link org.infinispan.commons.api.CacheContainerAdmin.AdminFlag}s
*/
void createCache(String name, String template, Configuration configuration, EnumSet<CacheContainerAdmin.AdminFlag> flags);
/**
* Removes the specified cache.
*
* @param name the name of the cache to remove
* @param flags the desired {@link org.infinispan.commons.api.CacheContainerAdmin.AdminFlag}s
*/
void removeCache(String name, EnumSet<CacheContainerAdmin.AdminFlag> flags);
/**
* Loads all persisted cache configurations
*/
Map<String, Configuration> loadAll();
}