2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018 Huawei Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.mso.bpmn.infrastructure.properties;
22 import org.openecomp.mso.logger.MessageEnum;
23 import org.openecomp.mso.logger.MsoLogger;
24 import org.openecomp.mso.properties.MsoPropertiesException;
25 import org.openecomp.mso.properties.MsoPropertiesFactory;
27 import java.util.Arrays;
28 import java.util.List;
30 public class BPMNProperties {
32 public static String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA";
34 private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA);
36 public static String getProperty(String key, String defaultValue) {
39 value = new MsoPropertiesFactory().getMsoJavaProperties(MSO_PROP_APIHANDLER_INFRA).getProperty(key, defaultValue);
40 } catch (MsoPropertiesException e) {
41 msoLogger.error (MessageEnum.NO_PROPERTIES, "Unknown. Mso Properties ID not found in cache: "
42 + MSO_PROP_APIHANDLER_INFRA, "BPMN", "", MsoLogger.ErrorCode.DataError,
43 "Exception - Mso Properties ID not found in cache", e);
46 msoLogger.debug("Config read for " + MSO_PROP_APIHANDLER_INFRA + " - key:" + key + " value:" + value);
50 public static List<String> getResourceSequenceProp(String input) {
51 String resourceSequence = getProperty("mso.workflow.custom." + input + ".resource.sequence", null);
52 if (resourceSequence != null) {
53 return Arrays.asList(resourceSequence.split(","));