2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk features
4 * ================================================================================
5 * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.impl.conf;
25 * @author Michael Dürre
29 import java.net.MalformedURLException;
31 import java.util.ArrayList;
32 import java.util.Arrays;
33 import java.util.List;
35 import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
36 import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
37 import org.onap.ccsdk.features.sdnr.wt.common.configuration.filechange.IConfigChangedListener;
38 import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo;
39 import org.onap.ccsdk.features.sdnr.wt.common.database.config.HostInfo.Protocol;
40 import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.IEsConfig;
41 import org.slf4j.Logger;
42 import org.slf4j.LoggerFactory;
44 public class NetconfStateConfig implements Configuration {
46 private static final Logger LOG = LoggerFactory.getLogger(NetconfStateConfig.class);
48 public static final String SECTION_MARKER_NCSTATE = "netconfstate";
50 private static final String PROPERTY_KEY_HANDLEASYNC = "asynchandling";
52 private static final Object DEFAULT_VALUE_TRUSTALLCERTS = false;
56 private final ConfigurationFileRepresentation configuration;
58 public NetconfStateConfig(ConfigurationFileRepresentation configuration) {
60 this.configuration = configuration;
61 this.configuration.addSection(SECTION_MARKER_NCSTATE);
66 public boolean handleAsync() {
67 return configuration.getPropertyBoolean(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC);
71 public String getSectionName() {
72 return SECTION_MARKER_NCSTATE;
76 public synchronized void defaults() {
77 // Add default if not available
78 configuration.setPropertyIfNotAvailable(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC,
79 DEFAULT_VALUE_TRUSTALLCERTS);