Remove outdated doc for A1 Adaptor
[integration.git] / test / mocks / masspnfsim / pnf-sim-lightweight / src / main / java / org / onap / pnfsimulator / netconfmonitor / NetconfMonitorServiceConfiguration.java
1 /// *
2 // * ============LICENSE_START=======================================================
3 // * PNF-REGISTRATION-HANDLER
4 // * ================================================================================
5 // * Copyright (C) 2018 NOKIA 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
10 // *
11 // * http://www.apache.org/licenses/LICENSE-2.0
12 // *
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=========================================================
19 // */
20 //
21 // package org.onap.pnfsimulator.netconfmonitor;
22 //
23 // import com.tailf.jnc.JNCException;
24 // import com.tailf.jnc.NetconfSession;
25 // import com.tailf.jnc.SSHConnection;
26 // import com.tailf.jnc.SSHSession;
27 // import java.io.IOException;
28 // import java.util.Map;
29 // import java.util.Timer;
30 // import org.onap.pnfsimulator.netconfmonitor.netconf.NetconfConfigurationCache;
31 // import org.onap.pnfsimulator.netconfmonitor.netconf.NetconfConfigurationReader;
32 // import org.onap.pnfsimulator.netconfmonitor.netconf.NetconfConfigurationWriter;
33 // import org.onap.pnfsimulator.netconfmonitor.netconf.NetconfConnectionParams;
34 // import org.slf4j.Logger;
35 // import org.slf4j.LoggerFactory;
36 // import org.springframework.context.annotation.Bean;
37 // import org.springframework.context.annotation.Configuration;
38 //
39 // @Configuration
40 // public class NetconfMonitorServiceConfiguration {
41 //
42 // private static final Logger LOGGER =
43 /// LoggerFactory.getLogger(NetconfMonitorServiceConfiguration.class);
44 // private static final Map<String, String> enviroment = System.getenv();
45 //
46 // private static final String LOG_PATH = "/var/log";
47 //
48 // private static final String NETCONF_ADDRESS = "NETCONF_ADDRESS";
49 // private static final String NETCONF_PORT = "NETCONF_PORT";
50 // private static final String NETCONF_MODEL = "NETCONF_MODEL";
51 // private static final String NETCONF_MAIN_CONTAINER = "NETCONF_MAIN_CONTAINER";
52 //
53 // private static final String DEFAULT_NETCONF_ADDRESS = "localhost";
54 // private static final int DEFAULT_NETCONF_PORT = 830;
55 // private static final String DEFAULT_NETCONF_MODEL = "pnf-simulator";
56 // private static final String DEFAULT_NETCONF_MAIN_CONTAINER = "config";
57 //
58 // private static final String DEFAULT_NETCONF_USER = "netconf";
59 // private static final String DEFAULT_NETCONF_PASSWORD = "netconf";
60 //
61 // @Bean
62 // public Timer timer() {
63 // return new Timer("NetconfMonitorServiceTimer");
64 // }
65 //
66 // @Bean
67 // public NetconfConfigurationCache configurationCache() {
68 // return new NetconfConfigurationCache();
69 // }
70 //
71 // @Bean
72 // public NetconfConfigurationReader configurationReader() throws IOException, JNCException {
73 // NetconfConnectionParams params = resolveConnectionParams();
74 // LOGGER.info("Configuration params are : {}", params);
75 // NetconfSession session = createNetconfSession(params);
76 // return new NetconfConfigurationReader(session, buildModelPath());
77 // }
78 //
79 // NetconfSession createNetconfSession(NetconfConnectionParams params) throws IOException,
80 /// JNCException {
81 // SSHConnection sshConnection = new SSHConnection(params.address, params.port);
82 // sshConnection.authenticateWithPassword(params.user, params.password);
83 // return new NetconfSession( new SSHSession(sshConnection));
84 // }
85 //
86 // @Bean
87 // public NetconfConfigurationWriter netconfConfigurationWriter() {
88 // return new NetconfConfigurationWriter(LOG_PATH);
89 // }
90 //
91 // private String buildModelPath() {
92 // return String.format("/%s:%s",
93 // enviroment.getOrDefault(NETCONF_MODEL, DEFAULT_NETCONF_MODEL),
94 // enviroment.getOrDefault(NETCONF_MAIN_CONTAINER, DEFAULT_NETCONF_MAIN_CONTAINER));
95 // }
96 //
97 // NetconfConnectionParams resolveConnectionParams() {
98 // return new NetconfConnectionParams(
99 // enviroment.getOrDefault(NETCONF_ADDRESS, DEFAULT_NETCONF_ADDRESS),
100 // resolveNetconfPort(),
101 // DEFAULT_NETCONF_USER,
102 // DEFAULT_NETCONF_PASSWORD);
103 // }
104 //
105 // private int resolveNetconfPort() {
106 // try {
107 // return Integer.parseInt(enviroment.get(NETCONF_PORT));
108 // } catch (NumberFormatException e) {
109 // LOGGER.warn("Invalid netconf port: {}. Default netconf port {} is set.", e.getMessage(),
110 // DEFAULT_NETCONF_PORT);
111 // return DEFAULT_NETCONF_PORT;
112 // }
113 // }
114 // }