modify control loop name
[holmes/common.git] / holmes-actions / src / main / java / org / onap / holmes / common / dcae / utils / DcaeConfigurationParser.java
index e4899d3..9284dd8 100644 (file)
  * See the License for the specific language governing permissions and\r
  * limitations under the License.\r
  */\r
-\r
 package org.onap.holmes.common.dcae.utils;\r
 \r
 import java.util.Arrays;\r
+import java.util.HashMap;\r
 import java.util.List;\r
 import java.util.Map.Entry;\r
 import java.util.Set;\r
@@ -30,6 +30,8 @@ import org.onap.holmes.common.exception.CorrelationException;
 \r
 public class DcaeConfigurationParser {\r
 \r
+    private static final String RULE_CONTENT_SPLIT = "\\$\\$\\$";\r
+\r
     private static final List<String> OBJECT_ATTRS = Arrays\r
             .asList(new String[]{"streams_subscribes", "streams_publishes", "services_calls", "services_provides"});\r
 \r
@@ -102,7 +104,9 @@ public class DcaeConfigurationParser {
         Set<Entry<String, Object>> entries = jsonObject.entrySet();\r
         for (Entry<String, Object> entry : entries) {\r
             if (entry.getKey().startsWith("holmes.default.rule")) {\r
-                ret.addDefaultRule(new Rule(entry.getKey(), (String) entry.getValue(), 1));\r
+                String value = (String) entry.getValue();\r
+                String[] contents = value.split(RULE_CONTENT_SPLIT);\r
+                ret.addDefaultRule(new Rule(entry.getKey(), contents[0], contents[1], 1));\r
             }\r
         }\r
     }\r