|
|
|
@ -49,13 +49,21 @@ public class DeviceTaskConfigurationServiceImpl implements DeviceTaskConfigurati
|
|
|
|
|
|
|
|
|
|
private final MetadataManagementService metadataManagementService;
|
|
|
|
|
|
|
|
|
|
private final Cache<String, DeviceFrequencyMap> cache;
|
|
|
|
|
private static DeviceTaskConfigurationServiceImpl instance;
|
|
|
|
|
|
|
|
|
|
public DeviceTaskConfigurationServiceImpl() {
|
|
|
|
|
this.metadataManagementService = new MetadataManagementServiceImpl();
|
|
|
|
|
this.cache = CacheBuilder.newBuilder()
|
|
|
|
|
private static final Cache<String, DeviceFrequencyMap> cache = CacheBuilder.newBuilder()
|
|
|
|
|
.expireAfterWrite(1, TimeUnit.HOURS)
|
|
|
|
|
.build();
|
|
|
|
|
|
|
|
|
|
private DeviceTaskConfigurationServiceImpl() {
|
|
|
|
|
this.metadataManagementService = new MetadataManagementServiceImpl();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static synchronized DeviceTaskConfigurationServiceImpl getInstance() {
|
|
|
|
|
if (instance == null) {
|
|
|
|
|
instance = new DeviceTaskConfigurationServiceImpl();
|
|
|
|
|
}
|
|
|
|
|
return instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Metadata constructTaskFrequencyMetadata(Map<String, Integer> deviceFrequencies) {
|
|
|
|
|