2 * ============LICENSE_START=======================================================
3 * PNF-REGISTRATION-HANDLER
4 * ================================================================================
5 * Copyright (C) 2018 Nokia. 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=========================================================
21 package org.onap.netconfsimulator.netconfcore.configuration;
23 import org.slf4j.Logger;
24 import org.slf4j.LoggerFactory;
25 import org.springframework.beans.factory.annotation.Value;
26 import org.springframework.context.annotation.Bean;
27 import org.springframework.context.annotation.Configuration;
30 class NetconfBeanConfiguration {
32 private static final Logger LOGGER = LoggerFactory.getLogger(NetconfBeanConfiguration.class);
34 @Value("${netconf.port}")
35 private Integer netconfPort;
37 @Value("${netconf.address}")
38 private String netconfAddress;
40 @Value("${netconf.user}")
41 private String netconfUser;
43 @Value("${netconf.password}")
44 private String netconfPassword;
47 NetconfConfigurationReader configurationReader() {
48 NetconfConnectionParams params = new NetconfConnectionParams(netconfAddress, netconfPort, netconfUser, netconfPassword);
49 LOGGER.info("Configuration params are : {}", params);
50 return new NetconfConfigurationReader(params, new NetconfSessionHelper());
54 NetconfConfigurationEditor configurationEditor() {
55 NetconfConnectionParams params =
56 new NetconfConnectionParams(netconfAddress, netconfPort, netconfUser, netconfPassword);
57 return new NetconfConfigurationEditor(params, new NetconfSessionHelper());