org.infinispan.counter.impl.manager.CounterConfigurationStorage Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-clustered-counter Show documentation
Show all versions of infinispan-clustered-counter Show documentation
Infinispan Clustered Counter module
package org.infinispan.counter.impl.manager;
import java.util.Map;
import org.infinispan.counter.api.CounterConfiguration;
/**
* A local storage to persist counter's {@link CounterConfiguration}.
*
* @author Pedro Ruivo
* @since 9.2
*/
public interface CounterConfigurationStorage {
/**
* Invoked when starts, it returns all the persisted counter's.
*
* @return all the persisted counter's name and configurations.
*/
Map loadAll();
/**
* Persists the counter's configuration.
*
* @param name the counter's name.
* @param configuration the counter's {@link CounterConfiguration}.
*/
void store(String name, CounterConfiguration configuration);
/**
* Remove a counter configuration
*
* @param name the counter's name.
*/
void remove(String name);
/**
* Validates if the {@link CounterConfiguration} has a valid {@link org.infinispan.counter.api.Storage}.
*
* It throws an exception if the implementation doesn't support one or more {@link org.infinispan.counter.api.Storage} modes.
*
* @param configuration the {@link CounterConfiguration} to check.
*/
void validatePersistence(CounterConfiguration configuration);
}