|
@@ -21,7 +21,8 @@ public class Configuration {
|
|
|
private static final Logger logger = LogManager.getLogger(Configuration.class);
|
|
private static final Logger logger = LogManager.getLogger(Configuration.class);
|
|
|
|
|
|
|
|
private final GeneralConfig generalConfig;
|
|
private final GeneralConfig generalConfig;
|
|
|
- private final Collection<ExecutableGroup> executableGroups;
|
|
|
|
|
|
|
+ private final Collection<ExecutableGroup> execGroups;
|
|
|
|
|
+ private final Collection<ExecutableSuperGroup> execSuperGroups;
|
|
|
private final Collection<MessageBrokerConfig> messageBrokerConfigs;
|
|
private final Collection<MessageBrokerConfig> messageBrokerConfigs;
|
|
|
private final Collection<EmailServerConfig> emailServerConfigs;
|
|
private final Collection<EmailServerConfig> emailServerConfigs;
|
|
|
private final Collection<SensLogServerConfig> sensLogServerConfigs;
|
|
private final Collection<SensLogServerConfig> sensLogServerConfigs;
|
|
@@ -30,13 +31,15 @@ public class Configuration {
|
|
|
private Configuration(
|
|
private Configuration(
|
|
|
GeneralConfig generalConfig,
|
|
GeneralConfig generalConfig,
|
|
|
Collection<ExecutableGroup> executableGroups,
|
|
Collection<ExecutableGroup> executableGroups,
|
|
|
|
|
+ Collection<ExecutableSuperGroup> execSGroups,
|
|
|
Collection<EmailServerConfig> emailServerConfigs,
|
|
Collection<EmailServerConfig> emailServerConfigs,
|
|
|
Collection<MessageBrokerConfig> messageBrokerConfigs,
|
|
Collection<MessageBrokerConfig> messageBrokerConfigs,
|
|
|
Collection<SensLogServerConfig> sensLogServerConfigs,
|
|
Collection<SensLogServerConfig> sensLogServerConfigs,
|
|
|
Collection<DataProviderConfig> dataProviderConfigs
|
|
Collection<DataProviderConfig> dataProviderConfigs
|
|
|
){
|
|
){
|
|
|
this.generalConfig = generalConfig;
|
|
this.generalConfig = generalConfig;
|
|
|
- this.executableGroups = executableGroups;
|
|
|
|
|
|
|
+ this.execGroups = executableGroups;
|
|
|
|
|
+ this.execSuperGroups = execSGroups;
|
|
|
this.messageBrokerConfigs = messageBrokerConfigs;
|
|
this.messageBrokerConfigs = messageBrokerConfigs;
|
|
|
this.emailServerConfigs = emailServerConfigs;
|
|
this.emailServerConfigs = emailServerConfigs;
|
|
|
this.sensLogServerConfigs = sensLogServerConfigs;
|
|
this.sensLogServerConfigs = sensLogServerConfigs;
|
|
@@ -118,7 +121,7 @@ public class Configuration {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Map<String, SuperGroup> executableSGroupsMap = new HashMap<>();
|
|
|
|
|
|
|
+ Map<String, ExecutableSuperGroup> executableSGroupsMap = new HashMap<>();
|
|
|
for (SuperGroupConfig sGConfig : superGroups.values()) {
|
|
for (SuperGroupConfig sGConfig : superGroups.values()) {
|
|
|
if (sGConfig.getPeriod() == null) {
|
|
if (sGConfig.getPeriod() == null) {
|
|
|
throw new IllegalStateException(
|
|
throw new IllegalStateException(
|
|
@@ -126,26 +129,31 @@ public class Configuration {
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- SuperGroup superGroup = new SuperGroup(sGConfig);
|
|
|
|
|
|
|
+ ExecutableSuperGroup executableSuperGroup = new ExecutableSuperGroup(sGConfig);
|
|
|
for (String groupId : sGConfig.getGroups()) {
|
|
for (String groupId : sGConfig.getGroups()) {
|
|
|
ExecutableGroup group = executableGroupsMap.get(groupId);
|
|
ExecutableGroup group = executableGroupsMap.get(groupId);
|
|
|
if (group == null) {
|
|
if (group == null) {
|
|
|
throw new IllegalStateException("Assigned group '"+groupId+"' does not exist.");
|
|
throw new IllegalStateException("Assigned group '"+groupId+"' does not exist.");
|
|
|
}
|
|
}
|
|
|
- superGroup.addNode(groupId, group);
|
|
|
|
|
|
|
+ GroupConfig gConfig = group.getConfig();
|
|
|
|
|
+ GroupConfig newGConfig = new GroupConfig(gConfig.getId(), gConfig.getName(), true,
|
|
|
|
|
+ gConfig.getDataProviderId(), gConfig.getMessageBrokerId(),
|
|
|
|
|
+ sGConfig.getResultType(), sGConfig.getPeriod()
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ executableSuperGroup.addNode(groupId, ExecutableGroup.copy(group, newGConfig));
|
|
|
}
|
|
}
|
|
|
- executableSGroupsMap.put(sGConfig.getId(), superGroup);
|
|
|
|
|
|
|
+ executableSGroupsMap.put(sGConfig.getId(), executableSuperGroup);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // TODO return
|
|
|
|
|
Collection<ExecutableGroup> execGroups = executableGroupsMap.values();
|
|
Collection<ExecutableGroup> execGroups = executableGroupsMap.values();
|
|
|
- Collection<SuperGroup> execSGroups = executableSGroupsMap.values();
|
|
|
|
|
|
|
+ Collection<ExecutableSuperGroup> execSGroups = executableSGroupsMap.values();
|
|
|
Collection<EmailServerConfig> emailServerConfigs = emailServers.values();
|
|
Collection<EmailServerConfig> emailServerConfigs = emailServers.values();
|
|
|
Collection<SensLogServerConfig> sensLogServerConfigs = sensLogServers.values();
|
|
Collection<SensLogServerConfig> sensLogServerConfigs = sensLogServers.values();
|
|
|
Collection<DataProviderConfig> dataProviderConfigs = dataProviders.values();
|
|
Collection<DataProviderConfig> dataProviderConfigs = dataProviders.values();
|
|
|
Collection<MessageBrokerConfig> messageBrokerConfigs = messageBrokers.values();
|
|
Collection<MessageBrokerConfig> messageBrokerConfigs = messageBrokers.values();
|
|
|
|
|
|
|
|
- return new Configuration(generalConfig, execGroups,
|
|
|
|
|
|
|
+ return new Configuration(generalConfig, execGroups, execSGroups,
|
|
|
emailServerConfigs, messageBrokerConfigs,
|
|
emailServerConfigs, messageBrokerConfigs,
|
|
|
sensLogServerConfigs, dataProviderConfigs
|
|
sensLogServerConfigs, dataProviderConfigs
|
|
|
);
|
|
);
|
|
@@ -340,14 +348,18 @@ public class Configuration {
|
|
|
return dataProviderConfigs;
|
|
return dataProviderConfigs;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public Collection<ExecutableGroup> getExecutableGroups() {
|
|
|
|
|
- return executableGroups;
|
|
|
|
|
|
|
+ public Collection<ExecutableGroup> getExecGroups() {
|
|
|
|
|
+ return execGroups;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public GeneralConfig getGeneralConfig() {
|
|
public GeneralConfig getGeneralConfig() {
|
|
|
return generalConfig;
|
|
return generalConfig;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public Collection<ExecutableSuperGroup> getSuperGroupsConfig() {
|
|
|
|
|
+ return execSuperGroups;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private static class TempUnitConfig {
|
|
private static class TempUnitConfig {
|
|
|
private final String id;
|
|
private final String id;
|
|
|
private final Integer period;
|
|
private final Integer period;
|