aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2018-04-11 09:21:04 +0000
committerGerrit Code Review <gerrit@onap.org>2018-04-11 09:21:04 +0000
commitc5bbee35bf664d166a8244448fe8f3f3e82ff2a0 (patch)
treee95f98f642f845b98fcb199257fe5be9b204d76a
parent5d9dbc633eac0d38915e02ff935aa3aebd255cf5 (diff)
parent8fa3be2ee8c65fe5ae6d97d21da93359ebcc96ef (diff)
Merge "Implement read resource sequence"
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java61
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/ResourceSequence.java30
2 files changed, 91 insertions, 0 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java
new file mode 100644
index 0000000000..70572dc94a
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java
@@ -0,0 +1,61 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.infrastructure.properties;
+
+import org.openecomp.mso.logger.MessageEnum;
+import org.openecomp.mso.logger.MsoLogger;
+import org.openecomp.mso.properties.MsoPropertiesException;
+import org.openecomp.mso.properties.MsoPropertiesFactory;
+
+import java.util.Arrays;
+import java.util.List;
+
+public class BPMNProperties {
+
+ public static String MSO_PROP_BPMN = "MSO_PROP_BPMN";
+
+ private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
+
+ public static String getProperty(String key, String defaultValue) {
+ String value;
+ try {
+ value = new MsoPropertiesFactory().getMsoJavaProperties(MSO_PROP_BPMN).getProperty(key, defaultValue);
+ } catch (MsoPropertiesException e) {
+ msoLogger.error (MessageEnum.NO_PROPERTIES, "Unknown. Mso Properties ID not found in cache: "
+ + MSO_PROP_BPMN, "BPMN", "", MsoLogger.ErrorCode.DataError,
+ "Exception - Mso Properties ID not found in cache", e);
+ return null;
+ }
+ msoLogger.debug("Config read for " + MSO_PROP_BPMN + " - key:" + key + " value:" + value);
+ return value;
+ }
+
+ public static List<String> getResourceSequenceProp() {
+ String resource_sequence = getProperty("resource_sequence", null);
+ if (resource_sequence != null) {
+ String[] resourceSequence = resource_sequence.split(",");
+ return Arrays.asList(resource_sequence);
+ }
+ return Arrays.asList(ResourceSequence.RESOURCE_EPC,
+ ResourceSequence.RESOURCE_IMS,
+ ResourceSequence.RESOUCE_OVERLAY,
+ ResourceSequence.RESOURCE_UNDERLAY);
+ }
+}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/ResourceSequence.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/ResourceSequence.java
new file mode 100644
index 0000000000..86e5d30b11
--- /dev/null
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/ResourceSequence.java
@@ -0,0 +1,30 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.openecomp.mso.bpmn.infrastructure.properties;
+
+public final class ResourceSequence {
+
+ public static final String RESOURCE_IMS = "ims";
+ public static final String RESOURCE_EPC = "epc";
+ public static final String RESOUCE_OVERLAY = "overlay";
+ public static final String RESOURCE_UNDERLAY = "underlay";
+
+ private ResourceSequence() {}
+} \ No newline at end of file