public class ClusterConfigServiceImpl extends Object implements ClusterConfigService
| Constructor and Description |
|---|
ClusterConfigServiceImpl(MongoJackObjectMapperProvider mapperProvider,
MongoConnection mongoConnection,
NodeId nodeId,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
ChainingClassLoader chainingClassLoader,
ClusterEventBus clusterEventBus) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
get(Class<T> type)
Retrieve Java class of a certain type from the cluster configuration.
|
<T> T |
getOrDefault(Class<T> type,
T defaultValue)
Retrieve Java class of a certain type from the cluster configuration or return a default value
in case that failed.
|
Set<Class<?>> |
list()
List all classes of configuration beans in the database.
|
<T> int |
remove(Class<T> type)
Remove a configuration bean from the cluster configuration.
|
<T> void |
write(T payload)
Write a configuration bean to the cluster configuration.
|
@Inject public ClusterConfigServiceImpl(MongoJackObjectMapperProvider mapperProvider, MongoConnection mongoConnection, NodeId nodeId, com.fasterxml.jackson.databind.ObjectMapper objectMapper, ChainingClassLoader chainingClassLoader, ClusterEventBus clusterEventBus)
public <T> T get(Class<T> type)
ClusterConfigServiceget in interface ClusterConfigServiceT - The type of the Java configuration bean.type - The Class of the Java configuration bean to retrieve.null if it couldn't be retrieved.public <T> T getOrDefault(Class<T> type, T defaultValue)
ClusterConfigServicegetOrDefault in interface ClusterConfigServiceT - The type of the Java configuration bean.type - The Class of the Java configuration bean to retrieve.defaultValue - An instance of T which is returned as default value.public <T> void write(T payload)
ClusterConfigServicewrite in interface ClusterConfigServiceT - The type of the Java configuration bean.payload - The object to write to the cluster configuration. Must be serializable by Jackson!public <T> int remove(Class<T> type)
ClusterConfigServiceremove in interface ClusterConfigServicetype - The Class of the Java configuration bean to remove.public Set<Class<?>> list()
ClusterConfigServicelist in interface ClusterConfigServiceCopyright © 2012-2016 Graylog, Inc.. All Rights Reserved.