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;
24 import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
25 import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
26 import org.slf4j.Logger;
27 import org.slf4j.LoggerFactory;
29 public class NetconfStateConfig implements Configuration {
31 @SuppressWarnings("unused")
32 private static final Logger LOG = LoggerFactory.getLogger(NetconfStateConfig.class);
34 public static final String SECTION_MARKER_NCSTATE = "netconfstate";
36 private static final String PROPERTY_KEY_HANDLEASYNC = "asynchandling";
38 private static final Object DEFAULT_VALUE_TRUSTALLCERTS = false;
42 private final ConfigurationFileRepresentation configuration;
44 public NetconfStateConfig(ConfigurationFileRepresentation configuration) {
46 this.configuration = configuration;
47 this.configuration.addSection(SECTION_MARKER_NCSTATE);
52 public boolean handleAsync() {
53 return configuration.getPropertyBoolean(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC);
57 public String getSectionName() {
58 return SECTION_MARKER_NCSTATE;
62 public synchronized void defaults() {
63 // Add default if not available
64 configuration.setPropertyIfNotAvailable(SECTION_MARKER_NCSTATE, PROPERTY_KEY_HANDLEASYNC,
65 DEFAULT_VALUE_TRUSTALLCERTS);