Class DefaultGeocoderServiceManager
- java.lang.Object
-
- org.opennms.features.geocoder.service.DefaultGeocoderServiceManager
-
- All Implemented Interfaces:
GeocoderServiceManager
public class DefaultGeocoderServiceManager extends 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(String geocoderId)
Returns theGeocoderService
identified by the providedgeocoderId
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(String geocoderId, Map<String,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 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:
IOException
- when deleting the configuration files failed.
-
updateConfiguration
public void updateConfiguration(GeocoderServiceManagerConfiguration newConfiguration) throws IOException
Description copied from interface:GeocoderServiceManager
Updates the configuration for the service manager- Specified by:
updateConfiguration
in interfaceGeocoderServiceManager
- Throws:
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 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(String geocoderId, Map<String,Object> newProperties) throws 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:
IOException
- in case the configuration could not be persistedGeocoderConfigurationException
-
getGeocoderService
public GeocoderService getGeocoderService(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
-
-