Class DefaultGeocoderServiceManager
- java.lang.Object
-
- org.opennms.features.geocoder.service.DefaultGeocoderServiceManager
-
- All Implemented Interfaces:
GeocoderServiceManager
public class DefaultGeocoderServiceManager extends java.lang.Object implements GeocoderServiceManager
-
-
Constructor Summary
Constructors Constructor Description DefaultGeocoderServiceManager(org.osgi.framework.BundleContext bundleContext, org.osgi.service.cm.ConfigurationAdmin configurationAdmin, GeocoderServiceManagerConfiguration configuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeocoderService
getActiveGeocoderService()
Returns the current activeGeocoderService
or null if none is active.GeocoderServiceManagerConfiguration
getConfiguration()
Returns the configuration for the service managerGeocoderService
getGeocoderService(java.lang.String geocoderId)
Returns theGeocoderService
identified by the providedgeocoderId
java.util.List<GeocoderService>
getGeocoderServices()
Returns all registeredGeocoderService
.void
resetConfiguration()
Deletes all configuration files related to the geocoder service.void
updateConfiguration(GeocoderServiceManagerConfiguration newConfiguration)
Updates the configuration for the service managervoid
updateGeocoderConfiguration(java.lang.String geocoderId, java.util.Map<java.lang.String,java.lang.Object> newProperties)
Updates the configuration for theGeocoderService
with the provided id.
-
-
-
Constructor Detail
-
DefaultGeocoderServiceManager
public DefaultGeocoderServiceManager(org.osgi.framework.BundleContext bundleContext, org.osgi.service.cm.ConfigurationAdmin configurationAdmin, GeocoderServiceManagerConfiguration configuration)
-
-
Method Detail
-
resetConfiguration
public void resetConfiguration() throws java.io.IOException
Description copied from interface:GeocoderServiceManager
Deletes all configuration files related to the geocoder service. This results in falling back to the defaults- Specified by:
resetConfiguration
in interfaceGeocoderServiceManager
- Throws:
java.io.IOException
- when deleting the configuration files failed.
-
updateConfiguration
public void updateConfiguration(GeocoderServiceManagerConfiguration newConfiguration) throws java.io.IOException
Description copied from interface:GeocoderServiceManager
Updates the configuration for the service manager- Specified by:
updateConfiguration
in interfaceGeocoderServiceManager
- Throws:
java.io.IOException
- when writing the configuration file failed
-
getConfiguration
public GeocoderServiceManagerConfiguration getConfiguration()
Description copied from interface:GeocoderServiceManager
Returns the configuration for the service manager- Specified by:
getConfiguration
in interfaceGeocoderServiceManager
- Returns:
- the configuration for the service manager
-
getActiveGeocoderService
public GeocoderService getActiveGeocoderService()
Description copied from interface:GeocoderServiceManager
Returns the current activeGeocoderService
or null if none is active.- Specified by:
getActiveGeocoderService
in interfaceGeocoderServiceManager
- Returns:
- the current active
GeocoderService
or null if none is active.
-
getGeocoderServices
public java.util.List<GeocoderService> getGeocoderServices()
Description copied from interface:GeocoderServiceManager
Returns all registeredGeocoderService
. None of those may be active- Specified by:
getGeocoderServices
in interfaceGeocoderServiceManager
- Returns:
- all registered
GeocoderService
.
-
updateGeocoderConfiguration
public void updateGeocoderConfiguration(java.lang.String geocoderId, java.util.Map<java.lang.String,java.lang.Object> newProperties) throws java.io.IOException, GeocoderConfigurationException
Description copied from interface:GeocoderServiceManager
Updates the configuration for theGeocoderService
with the provided id.- Specified by:
updateGeocoderConfiguration
in interfaceGeocoderServiceManager
- Parameters:
geocoderId
- The id of theGeocoderService
to updatenewProperties
- The new configuration of theGeocoderService
- Throws:
java.io.IOException
- in case the configuration could not be persistedGeocoderConfigurationException
-
getGeocoderService
public GeocoderService getGeocoderService(java.lang.String geocoderId)
Description copied from interface:GeocoderServiceManager
Returns theGeocoderService
identified by the providedgeocoderId
- Specified by:
getGeocoderService
in interfaceGeocoderServiceManager
- Parameters:
geocoderId
- The id of theGeocoderService
to return.- Returns:
- the
GeocoderService
identified by the providedgeocoderId
-
-