sensorconfig service
This commit is contained in:
parent
c5c997d92b
commit
0c40aa88b1
2
pom.xml
2
pom.xml
|
@ -50,7 +50,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.loafle.overflow</groupId>
|
<groupId>com.loafle.overflow</groupId>
|
||||||
<artifactId>commons-java</artifactId>
|
<artifactId>commons-java</artifactId>
|
||||||
<version>1.0.118-SNAPSHOT</version>
|
<version>1.0.120-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -29,7 +29,6 @@ import com.loafle.overflow.model.sensor.SensorItem;
|
||||||
import com.loafle.overflow.model.sensorconfig.SensorConfig;
|
import com.loafle.overflow.model.sensorconfig.SensorConfig;
|
||||||
import com.loafle.overflow.model.sensorconfig.SensorConfigConnection;
|
import com.loafle.overflow.model.sensorconfig.SensorConfigConnection;
|
||||||
import com.loafle.overflow.model.sensorconfig.SensorConfigCrawler;
|
import com.loafle.overflow.model.sensorconfig.SensorConfigCrawler;
|
||||||
import com.loafle.overflow.model.sensorconfig.SensorConfigItems;
|
|
||||||
import com.loafle.overflow.model.sensorconfig.SensorConfigSchedule;
|
import com.loafle.overflow.model.sensorconfig.SensorConfigSchedule;
|
||||||
import com.loafle.overflow.service.central.meta.MetaCollectionItemMappingService;
|
import com.loafle.overflow.service.central.meta.MetaCollectionItemMappingService;
|
||||||
|
|
||||||
|
@ -58,7 +57,7 @@ public class CentralSensorConfigService {
|
||||||
sensorConfig.setCrawler(this.configCrawler(sensor));
|
sensorConfig.setCrawler(this.configCrawler(sensor));
|
||||||
sensorConfig.setConnection(this.configConnection(sensor));
|
sensorConfig.setConnection(this.configConnection(sensor));
|
||||||
sensorConfig.setSchedule(this.configSchedule(sensor));
|
sensorConfig.setSchedule(this.configSchedule(sensor));
|
||||||
sensorConfig.setItems(this.configItems(sensor));
|
sensorConfig.setMetaCollectionItems(this.configItems(sensor));
|
||||||
|
|
||||||
Probe probe = sensor.getTarget().getInfra().getProbe();
|
Probe probe = sensor.getTarget().getInfra().getProbe();
|
||||||
String encryptedSensorConfigBase64 = this.toEncryptString(sensorConfig, probe.getEncryptionKey());
|
String encryptedSensorConfigBase64 = this.toEncryptString(sensorConfig, probe.getEncryptionKey());
|
||||||
|
@ -184,7 +183,7 @@ public class CentralSensorConfigService {
|
||||||
return sensorConfigSchedule;
|
return sensorConfigSchedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SensorConfigItems configItems(Sensor sensor) throws OverflowException {
|
private List<MetaCollectionItem> configItems(Sensor sensor) throws OverflowException {
|
||||||
List<SensorItem> sensorItems = this.sensorItemService.readAllBySensorID(sensor.getId());
|
List<SensorItem> sensorItems = this.sensorItemService.readAllBySensorID(sensor.getId());
|
||||||
if (null == sensorItems || sensorItems.size() == 0) {
|
if (null == sensorItems || sensorItems.size() == 0) {
|
||||||
throw new OverflowException(String.format("ID[%s] of Sensor has no SensorItem", sensor.getId()));
|
throw new OverflowException(String.format("ID[%s] of Sensor has no SensorItem", sensor.getId()));
|
||||||
|
@ -198,9 +197,6 @@ public class CentralSensorConfigService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SensorConfigItems sensorConfigItems = new SensorConfigItems();
|
return metaCollectionItems;
|
||||||
sensorConfigItems.setMetaCollectionItems(metaCollectionItems);
|
|
||||||
|
|
||||||
return sensorConfigItems;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user