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 GeocoderServicegetActiveGeocoderService()Returns the current activeGeocoderServiceor null if none is active.GeocoderServiceManagerConfigurationgetConfiguration()Returns the configuration for the service managerGeocoderServicegetGeocoderService(java.lang.String geocoderId)Returns theGeocoderServiceidentified by the providedgeocoderIdjava.util.List<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(java.lang.String geocoderId, java.util.Map<java.lang.String,java.lang.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 java.io.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:
java.io.IOException- when deleting the configuration files failed.
-
updateConfiguration
public void updateConfiguration(GeocoderServiceManagerConfiguration newConfiguration) throws java.io.IOException
Description copied from interface:GeocoderServiceManagerUpdates the configuration for the service manager- Specified by:
updateConfigurationin interfaceGeocoderServiceManager- Throws:
java.io.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 java.util.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(java.lang.String geocoderId, java.util.Map<java.lang.String,java.lang.Object> newProperties) throws java.io.IOException, GeocoderConfigurationExceptionDescription 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:
java.io.IOException- in case the configuration could not be persistedGeocoderConfigurationException
-
getGeocoderService
public GeocoderService getGeocoderService(java.lang.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
-
-