Class ConfigurationResourceManager
- java.lang.Object
-
- org.swisspush.gateleen.core.configuration.ConfigurationResourceManager
-
- All Implemented Interfaces:
LoggableResource
public class ConfigurationResourceManager extends Object implements LoggableResource
Manage the modifications of configuration resources and notify observers- Author:
- https://github.com/mcweba [Marc-Andre Weber]
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_RESOURCE_CHANGED_ADDRESS
-
Constructor Summary
Constructors Constructor Description ConfigurationResourceManager(io.vertx.core.Vertx vertx, ResourceStorage storage, GateleenExceptionFactory exceptionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenableResourceLogging(boolean resourceLoggingEnabled)Enable or disable the resource logging.Map<String,List<ConfigurationResourceObserver>>getObservers()io.vertx.core.Future<Optional<io.vertx.core.buffer.Buffer>>getRegisteredResource(String resourceUri)Call this method to get the validated registered resource immediately.booleanhandleConfigurationResource(io.vertx.core.http.HttpServerRequest request)voidregisterObserver(ConfigurationResourceObserver observer, String resourceUri)voidregisterResource(String resourceUri, String resourceSchema)
-
-
-
Field Detail
-
CONFIG_RESOURCE_CHANGED_ADDRESS
public static final String CONFIG_RESOURCE_CHANGED_ADDRESS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConfigurationResourceManager
public ConfigurationResourceManager(io.vertx.core.Vertx vertx, ResourceStorage storage, GateleenExceptionFactory exceptionFactory)
-
-
Method Detail
-
getRegisteredResource
public io.vertx.core.Future<Optional<io.vertx.core.buffer.Buffer>> getRegisteredResource(String resourceUri)
Call this method to get the validated registered resource immediately. Otherwise you would have to wait for a change on the corresponding resource.- Parameters:
resourceUri- the uri of the registered resource
-
registerObserver
public void registerObserver(ConfigurationResourceObserver observer, String resourceUri)
-
enableResourceLogging
public void enableResourceLogging(boolean resourceLoggingEnabled)
Description copied from interface:LoggableResourceEnable or disable the resource logging. When enabling the resource logging, make sure to have a consumer for event bus events to the addressAddress.requestLoggingConsumerAddress()like the RequestLoggingConsumer class from gateleen-logging module.- Specified by:
enableResourceLoggingin interfaceLoggableResource- Parameters:
resourceLoggingEnabled- boolean value whether to enable or disable the resource logging
-
handleConfigurationResource
public boolean handleConfigurationResource(io.vertx.core.http.HttpServerRequest request)
-
getObservers
public Map<String,List<ConfigurationResourceObserver>> getObservers()
-
-