public abstract class AmbariServerConfigurationProvider<T extends AmbariServerConfiguration> extends Object implements com.google.inject.Provider<T>
This implementation registers for the following Ambari server events to help load the relevant properties when available and/or updated:
Modifier | Constructor and Description |
---|---|
protected |
AmbariServerConfigurationProvider(AmbariServerConfigurationCategory configurationCategory,
AmbariEventPublisher publisher,
AmbariJpaPersistService persistService) |
Modifier and Type | Method and Description |
---|---|
void |
ambariConfigurationChanged(AmbariConfigurationChangedEvent event)
Upon receiving this event, if the expected configuration category has been updated, the data is
reloaded.
|
T |
get() |
void |
jpaInitialized(JpaInitializedEvent event)
Upon receiving this event, the JPA infrastructure has completed initialization and the relevant
data may be retrieved.
|
protected abstract T |
loadInstance(Collection<AmbariConfigurationEntity> configurationEntities)
Returns a instance of the data configuration container implementation filled with data from the
supplied collection of
AmbariConfigurationEntity s |
protected Map<String,String> |
toProperties(Collection<AmbariConfigurationEntity> configurationEntities)
Converts a collection of
AmbariConfigurationEntity s into a map of property names to values. |
protected AmbariServerConfigurationProvider(AmbariServerConfigurationCategory configurationCategory, AmbariEventPublisher publisher, AmbariJpaPersistService persistService)
public void ambariConfigurationChanged(AmbariConfigurationChangedEvent event)
event
- the received AmbariConfigurationChangedEvent
public void jpaInitialized(JpaInitializedEvent event)
event
- the received JpaInitializedEvent
public T get()
get
in interface javax.inject.Provider<T extends AmbariServerConfiguration>
protected Map<String,String> toProperties(Collection<AmbariConfigurationEntity> configurationEntities)
AmbariConfigurationEntity
s into a map of property names to values.configurationEntities
- the collection of AmbariConfigurationEntity
s to processprotected abstract T loadInstance(Collection<AmbariConfigurationEntity> configurationEntities)
AmbariConfigurationEntity
sconfigurationEntities
- a collection of AmbariConfigurationEntity
sCopyright © 2022 Apache Software Foundation. All rights reserved.