public abstract class AbstractSettingsManager extends SettingsManager
SettingsManaeger
implementation that handles the loading of
SettingDefinition
s and the configuration of objects.
Modifier and Type | Class and Description |
---|---|
private class |
AbstractSettingsManager.ConfigurableObject |
Modifier and Type | Field and Description |
---|---|
private SetMultiMap<String,AbstractSettingsManager.ConfigurableObject> |
configurableObjects |
private ReadWriteLock |
configurableObjectsLock |
private static org.slf4j.Logger |
LOG |
private SettingDefinitionProviderRepository |
settingDefinitionRepository |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSettingsManager()
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
private void |
applySetting(SettingDefinition<?,?> setting,
SettingValue<?> oldValue,
SettingValue<?> newValue)
Applies the a new setting to all
ConfiguredObject s. |
void |
changeSetting(SettingValue<?> newValue)
Changes a setting.
|
private void |
configure(AbstractSettingsManager.ConfigurableObject co) |
void |
configure(Object object)
Configure
o with the required settings. |
void |
deleteAdminUser(AdministratorUser user)
Deletes the user previously returned by
SettingsManager.getAdminUser(java.lang.String) or SettingsManager.getAdminUsers() . |
void |
deleteSetting(SettingDefinition<?,?> setting)
Deletes the setting defined by
setting . |
protected abstract void |
deleteSettingValue(String key)
Deletes the setting with the specified key.
|
SettingDefinition<?,?> |
getDefinitionByKey(String key)
Get the definition that is defined with the specified key.
|
Set<String> |
getKeys() |
private SettingValue<Object> |
getNotNullSettingValue(AbstractSettingsManager.ConfigurableObject co) |
<T> SettingValue<T> |
getSetting(SettingDefinition<?,T> key)
Gets the value of the setting defined by
key . |
protected SettingDefinitionProviderRepository |
getSettingDefinitionRepository() |
Set<SettingDefinition<?,?>> |
getSettingDefinitions()
Gets all
SettingDefinition s known by this class. |
Map<SettingDefinition<?,?>,SettingValue<?>> |
getSettings()
Gets all values for all definitions.
|
protected abstract SettingValue<?> |
getSettingValue(String key)
Returns the value of the specified setting or
null if it does not
exist. |
protected abstract Set<SettingValue<?>> |
getSettingValues() |
boolean |
hasAdminUser()
Checks if a administrator user exists.
|
protected abstract void |
saveSettingValue(SettingValue<?> setting)
Saves the setting value.
|
void |
setActive(BindingKey bk,
boolean active)
Sets the status of a binding.
|
void |
setActive(OfferingExtensionKey oek,
boolean active)
Sets the status of a offering extension.
|
void |
setActive(OfferingExtensionKey oek,
boolean active,
boolean updateRepository)
Sets the status of a offering extension.
|
void |
setActive(OwsExtendedCapabilitiesKey oeck,
boolean active)
Sets the status of a extended capabilities.
|
void |
setActive(OwsExtendedCapabilitiesKey oeck,
boolean active,
boolean updateRepository)
Sets the status of a extended capabilities.
|
void |
setActive(ProcedureDescriptionFormatKey pdfkt,
boolean active)
Sets the status of a procedure description format for the specified
service and version.
|
void |
setActive(RequestOperatorKey rokt,
boolean active)
Sets the status of an operation.
|
void |
setActive(ResponseFormatKey rfkt,
boolean active)
Sets the status of a response format for the specified service and
version.
|
protected abstract void |
setBindingStatus(BindingKey bk,
boolean active)
Sets the status of a binding.
|
protected abstract void |
setOfferingExtensionStatus(OfferingExtensionKey oek,
boolean active) |
protected abstract void |
setOperationStatus(RequestOperatorKey requestOperatorKeyType,
boolean active)
Sets the status of an operation.
|
protected abstract void |
setOwsExtendedCapabilitiesStatus(OwsExtendedCapabilitiesKey oeck,
boolean active) |
protected abstract void |
setProcedureDescriptionFormatStatus(ProcedureDescriptionFormatKey pdfkt,
boolean active)
Sets the status of a response format for the specified service and
version.
|
protected abstract void |
setProcedureDescriptionFormatStatus(String pdf,
boolean active)
Deprecated.
|
protected abstract void |
setResponseFormatStatus(ResponseFormatKey rfkt,
boolean active)
Sets the status of a response format for the specified service and
version.
|
cleanup, createAdminUser, deleteAdminUser, deleteAll, getAdminUser, getAdminUsers, getInstance, getSettingFactory, isActive, isActive, isActive, isActive, isActive, isActive, saveAdminUser
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deleteCapabiltiesExtension, deleteOfferingExtension, deleteStaticCapabilities, disableCapabilitiesExtension, disableOfferingExtension, getActiveCapabilitiesExtensions, getActiveOfferingExtensions, getActiveStaticCapabilities, getActiveStaticCapabilitiesDocument, getAllCapabilitiesExtensions, getOfferingExtensions, getStaticCapabilities, getStaticCapabilities, isStaticCapabilitiesActive, saveCapabilitiesExtension, saveOfferingExtension, saveStaticCapabilities, setActiveStaticCapabilities
private static final org.slf4j.Logger LOG
private final SettingDefinitionProviderRepository settingDefinitionRepository
private final SetMultiMap<String,AbstractSettingsManager.ConfigurableObject> configurableObjects
private final ReadWriteLock configurableObjectsLock
protected AbstractSettingsManager() throws ConfigurationException
ConfigurationException
- if loading of SettingDefinitionProvider
failsprotected SettingDefinitionProviderRepository getSettingDefinitionRepository()
public Set<SettingDefinition<?,?>> getSettingDefinitions()
SettingsManager
SettingDefinition
s known by this class.
getSettingDefinitions
in class SettingsManager
public void changeSetting(SettingValue<?> newValue) throws ConfigurationException, ConnectionProviderException
SettingsManager
changeSetting
in class SettingsManager
newValue
- the new value of the setting
ConfigurationException
- if there is a problem changing the setting.ConnectionProviderException
public void deleteSetting(SettingDefinition<?,?> setting) throws ConfigurationException, ConnectionProviderException
SettingsManager
setting
.
deleteSetting
in class SettingsManager
setting
- the definition
ConfigurationException
- if there is a problem deleting the settingConnectionProviderException
private void applySetting(SettingDefinition<?,?> setting, SettingValue<?> oldValue, SettingValue<?> newValue) throws ConfigurationException
ConfiguredObject
s. If an error
occurs the the old value is reapplied.
setting
- the definitionoldValue
- the old value (or null
if there is none)newValue
- the new value (or null
if there is none)
ConfigurationException
- if there is a error configuring the objectspublic <T> SettingValue<T> getSetting(SettingDefinition<?,T> key) throws ConnectionProviderException
SettingsManager
key
.
getSetting
in class SettingsManager
T
- the type of the setting and valuekey
- the definition of the setting
ConnectionProviderException
public Map<SettingDefinition<?,?>,SettingValue<?>> getSettings() throws ConnectionProviderException
SettingsManager
null
is added to the map.
getSettings
in class SettingsManager
ConnectionProviderException
public void deleteAdminUser(AdministratorUser user) throws ConnectionProviderException
SettingsManager
SettingsManager.getAdminUser(java.lang.String)
or SettingsManager.getAdminUsers()
.
deleteAdminUser
in class SettingsManager
user
- ConnectionProviderException
public boolean hasAdminUser() throws ConnectionProviderException
SettingsManager
hasAdminUser
in class SettingsManager
true
if there is a admin user, otherwise false
.ConnectionProviderException
public void configure(Object object) throws ConfigurationException
SettingsManager
o
with the required settings. All changes to a setting
required by the object will be applied.
configure
in class SettingsManager
object
- the object to configure
ConfigurationException
- if there is a problem configuring the objectConfigurable
,
Setting
private void configure(AbstractSettingsManager.ConfigurableObject co) throws ConfigurationException
ConfigurationException
public SettingDefinition<?,?> getDefinitionByKey(String key)
SettingsManager
getDefinitionByKey
in class SettingsManager
key
- the key
null
if there is no definition for the
keyprivate SettingValue<Object> getNotNullSettingValue(AbstractSettingsManager.ConfigurableObject co) throws ConnectionProviderException, ConfigurationException
public void setActive(RequestOperatorKey rokt, boolean active) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
rokt
- the key identifying the operationactive
- whether the operation is active or not
ConnectionProviderException
public void setActive(ResponseFormatKey rfkt, boolean active) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
rfkt
- the service/version/responseFormat combinationactive
- the statusConnectionProviderException
public void setActive(ProcedureDescriptionFormatKey pdfkt, boolean active) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
pdfkt
- the service/version/procedure description combinationactive
- the statusConnectionProviderException
public void setActive(BindingKey bk, boolean active) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
bk
- the bindingactive
- the statusConnectionProviderException
public void setActive(OfferingExtensionKey oek, boolean active) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
oek
- the offering extensionactive
- the statusConnectionProviderException
public void setActive(OfferingExtensionKey oek, boolean active, boolean updateRepository) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
oek
- the offering extensionactive
- the statusupdateRepository
- indicator if the repository should be updatedConnectionProviderException
public void setActive(OwsExtendedCapabilitiesKey oeck, boolean active) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
oeck
- the extended capabilitiesactive
- the statusConnectionProviderException
public void setActive(OwsExtendedCapabilitiesKey oeck, boolean active, boolean updateRepository) throws ConnectionProviderException
SettingsManager
setActive
in class SettingsManager
oeck
- the extended capabilitiesactive
- the statusupdateRepository
- indicator if the repository should be updatedConnectionProviderException
protected abstract Set<SettingValue<?>> getSettingValues() throws ConnectionProviderException
ConnectionProviderException
protected abstract SettingValue<?> getSettingValue(String key) throws ConnectionProviderException
null
if it does not
exist.
key
- the key
ConnectionProviderException
protected abstract void deleteSettingValue(String key) throws ConnectionProviderException
key
- the keyConnectionProviderException
protected abstract void saveSettingValue(SettingValue<?> setting) throws ConnectionProviderException
setting
- the valueConnectionProviderException
protected abstract void setOperationStatus(RequestOperatorKey requestOperatorKeyType, boolean active) throws ConnectionProviderException
requestOperatorKeyType
- the key identifying the operationactive
- whether the operation is active or not
ConnectionProviderException
setActive(RequestOperatorKey, boolean)
protected abstract void setResponseFormatStatus(ResponseFormatKey rfkt, boolean active) throws ConnectionProviderException
rfkt
- the service/version/responseFormat combinationactive
- the statusConnectionProviderException
setActive(ResponseFormatKey, boolean)
protected abstract void setProcedureDescriptionFormatStatus(ProcedureDescriptionFormatKey pdfkt, boolean active) throws ConnectionProviderException
pdfkt
- the service/version/responseFormat combinationactive
- the statusConnectionProviderException
setActive(ProcedureDescriptionFormatKey, boolean)
@Deprecated protected abstract void setProcedureDescriptionFormatStatus(String pdf, boolean active) throws ConnectionProviderException
pdf
- the procedure description formatactive
- the statusConnectionProviderException
setProcedureDescriptionFormatStatus(ProcedureDescriptionFormatKey,
boolean)
protected abstract void setBindingStatus(BindingKey bk, boolean active) throws ConnectionProviderException
bk
- the bindingactive
- the statusConnectionProviderException
setActive(org.n52.sos.binding.BindingKey, boolean)
protected abstract void setOfferingExtensionStatus(OfferingExtensionKey oek, boolean active) throws ConnectionProviderException
ConnectionProviderException
protected abstract void setOwsExtendedCapabilitiesStatus(OwsExtendedCapabilitiesKey oeck, boolean active) throws ConnectionProviderException
ConnectionProviderException
Copyright © 2012-2015 52north.org. All Rights Reserved.