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 GeocoderServicegetActiveGeocoderService()Returns the current activeGeocoderServiceor null if none is active.GeocoderServiceManagerConfigurationgetConfiguration()Returns the configuration for the service managerGeocoderServicegetGeocoderService(String geocoderId)Returns theGeocoderServiceidentified by the providedgeocoderIdList<GeocoderService>getGeocoderServices()Returns all registeredGeocoderService.voidresetConfiguration()Deletes all configuration files related to the geocoder service.voidupdateConfiguration(GeocoderServiceManagerConfiguration newConfiguration)Updates the configuration for the service managervoidupdateGeocoderConfiguration(String geocoderId, Map<String,Object> newProperties)Updates the configuration for theGeocoderServicewith 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 IOExceptionDescription copied from interface:GeocoderServiceManagerDeletes all configuration files related to the geocoder service. This results in falling back to the defaults- Specified by:
resetConfigurationin interfaceGeocoderServiceManager- Throws:
IOException- when deleting the configuration files failed.
-
updateConfiguration
public void updateConfiguration(GeocoderServiceManagerConfiguration newConfiguration) throws IOException
Description copied from interface:GeocoderServiceManagerUpdates the configuration for the service manager- Specified by:
updateConfigurationin interfaceGeocoderServiceManager- Throws:
IOException- when writing the configuration file failed
-
getConfiguration
public GeocoderServiceManagerConfiguration getConfiguration()
Description copied from interface:GeocoderServiceManagerReturns the configuration for the service manager- Specified by:
getConfigurationin interfaceGeocoderServiceManager- Returns:
- the configuration for the service manager
-
getActiveGeocoderService
public GeocoderService getActiveGeocoderService()
Description copied from interface:GeocoderServiceManagerReturns the current activeGeocoderServiceor null if none is active.- Specified by:
getActiveGeocoderServicein interfaceGeocoderServiceManager- Returns:
- the current active
GeocoderServiceor null if none is active.
-
getGeocoderServices
public List<GeocoderService> getGeocoderServices()
Description copied from interface:GeocoderServiceManagerReturns all registeredGeocoderService. None of those may be active- Specified by:
getGeocoderServicesin interfaceGeocoderServiceManager- Returns:
- all registered
GeocoderService.
-
updateGeocoderConfiguration
public void updateGeocoderConfiguration(String geocoderId, Map<String,Object> newProperties) throws IOException, GeocoderConfigurationException
Description copied from interface:GeocoderServiceManagerUpdates the configuration for theGeocoderServicewith the provided id.- Specified by:
updateGeocoderConfigurationin interfaceGeocoderServiceManager- Parameters:
geocoderId- The id of theGeocoderServiceto 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:GeocoderServiceManagerReturns theGeocoderServiceidentified by the providedgeocoderId- Specified by:
getGeocoderServicein interfaceGeocoderServiceManager- Parameters:
geocoderId- The id of theGeocoderServiceto return.- Returns:
- the
GeocoderServiceidentified by the providedgeocoderId
-
-