@Test public void testInit() throws InternalServiceException { SensorInstanceProvider provider = new SensorInstanceProvider(); setEmptyInMemoryRepositories(provider); provider.init(); assertTrue(iterableToCollection(provider.getSensors()).isEmpty()); }
public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigurations(); for (SensorConfiguration sensorConfiguration : configs) { sensorInstances.add(initSensorInstance(sensorConfiguration)); } LOGGER.info("Initialised {} with #{} sensor configuration(s).", getClass().getSimpleName(), sensorInstances.size()); }
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigurations(); for (SensorConfiguration sensorConfiguration : configs) { sensorInstances.add(initSensorInstance(sensorConfiguration)); } LOGGER.info("Initialised {} with #{} sensor configuration(s).", getClass().getSimpleName(), sensorInstances.size()); } }
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigurations(); for (SensorConfiguration sensorConfiguration : configs) { sensorInstances.add(initSensorInstance(sensorConfiguration)); } LOGGER.info("Initialised {} with #{} sensor configuration(s).", getClass().getSimpleName(), sensorInstances.size()); }  }
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigurations(); for (SensorConfiguration sensorConfiguration : configs) { sensorInstances.add(initSensorInstance(sensorConfiguration)); } LOGGER.info("Initialised {} with #{} sensor configuration(s).", getClass().getSimpleName(), sensorInstances.size()); }  void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(String procedure); SensorPlugin getSensorForProcedure(String procedure); SensorPlugin getSensorForTaskId(String taskId); SensorConfigurationRepository getSensorConfigurationRepository(); void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository); SensorTaskRepository getSensorTaskRepository(); void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository); void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent); }
SensorInstanceProvider implements InsertSensorOfferingListener { public void init() throws InternalServiceException { sensorPluginLoader = ServiceLoader.load(SensorInstanceFactory.class); if (isMissingRepository()) { throw new IllegalStateException("SensorInstanceProvider misses a repository."); } Iterable<SensorConfiguration> configs = sensorConfigurationRepository.getSensorConfigurations(); for (SensorConfiguration sensorConfiguration : configs) { sensorInstances.add(initSensorInstance(sensorConfiguration)); } LOGGER.info("Initialised {} with #{} sensor configuration(s).", getClass().getSimpleName(), sensorInstances.size()); }  void init(); Iterable<SensorPlugin> getSensors(); boolean containsTaskWith(String taskId); SensorTask getTaskForTaskId(String taskId); boolean containsSensorWith(String procedure); SensorPlugin getSensorForProcedure(String procedure); SensorPlugin getSensorForTaskId(String taskId); SensorConfigurationRepository getSensorConfigurationRepository(); void setSensorConfigurationRepository(SensorConfigurationRepository sensorConfigurationRepository); SensorTaskRepository getSensorTaskRepository(); void setSensorTaskRepository(SensorTaskRepository sensorTaskRepository); void handleInsertSensorOffering(InsertSensorOfferingEvent insertSensorOfferingEvent);  }