X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=holmes-actions%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Fcommon%2Fdcae%2Fentity%2FDcaeConfigurations.java;h=4b90dd7315c9deb3f15b175b633b4d1f63f896c5;hb=81edfdbaffd9c450f37d2418bb444473ee3bbe77;hp=f1307c4bafa28a052a01ce2acc83c3eda1c9793a;hpb=105437a89bd5bcfcaf40dac25e2c087aafb0996b;p=holmes%2Fcommon.git diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/DcaeConfigurations.java b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/DcaeConfigurations.java index f1307c4..4b90dd7 100644 --- a/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/DcaeConfigurations.java +++ b/holmes-actions/src/main/java/org/onap/holmes/common/dcae/entity/DcaeConfigurations.java @@ -20,38 +20,49 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -import lombok.NoArgsConstructor; +import java.util.Set; -@NoArgsConstructor public class DcaeConfigurations extends HashMap{ - private Map streamsPublishes = new HashMap<>(); - private Map streamsSubscribes = new HashMap<>(); - private List rules = new ArrayList<>(); + + private static final String STREAMS_PUBLISHES = "streamsPublishes"; + private static final String STREAMS_SUBSCRIBES = "streamsSubscribes"; + private static final String RULES = "rules"; + + public DcaeConfigurations(){ + super(); + this.put(STREAMS_PUBLISHES, new HashMap()); + this.put(STREAMS_SUBSCRIBES, new HashMap()); + this.put(RULES, new ArrayList()); + } public void addDefaultRule(Rule rule) { if (null == rule) { return; } - this.rules.add(rule); + ((List)(this.get(RULES))).add(rule); } public List getDefaultRules() { - return this.rules; + return (List)(this.get(RULES)); } public SecurityInfo addPubSecInfo(String key, SecurityInfo value) { - return this.streamsPublishes.put(key, value); + return ((Map)(this.get(STREAMS_PUBLISHES))).put(key, value); } public SecurityInfo getPubSecInfo(String key) { - return this.streamsPublishes.get(key); + return ((Map)(this.get(STREAMS_PUBLISHES))).get(key); } public SecurityInfo addSubSecInfo(String key, SecurityInfo value) { - return this.streamsSubscribes.put(key, value); + return ((Map)(this.get(STREAMS_SUBSCRIBES))).put(key, value); } public SecurityInfo getSubSecInfo(String key) { - return this.streamsSubscribes.get(key); + return ((Map)(this.get(STREAMS_SUBSCRIBES))).get(key); + } + + public Set getSubKeys(){ + return ((Map)(this.get(STREAMS_SUBSCRIBES))).keySet(); } }