Fix DefaultMapBodyOrder body sorting
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / config / Configuration.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.netconf.test.tool.config;
9
10 import com.google.common.collect.ImmutableSet;
11 import java.io.File;
12 import java.util.Set;
13 import java.util.concurrent.TimeUnit;
14 import org.opendaylight.netconf.api.CapabilityURN;
15 import org.opendaylight.netconf.auth.AuthProvider;
16 import org.opendaylight.netconf.shaded.sshd.server.auth.pubkey.PublickeyAuthenticator;
17 import org.opendaylight.netconf.test.tool.operations.OperationsCreator;
18 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandler;
19 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandlerDefault;
20 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
21 import org.slf4j.Logger;
22 import org.slf4j.LoggerFactory;
23
24 public class Configuration {
25     private static final Logger LOG = LoggerFactory.getLogger(Configuration.class);
26
27     public static final Set<String> DEFAULT_BASE_CAPABILITIES_EXI = ImmutableSet.of(
28         CapabilityURN.BASE,
29         CapabilityURN.BASE_1_1,
30         CapabilityURN.EXI,
31         CapabilityURN.NOTIFICATION);
32
33     public static final Set<String> DEFAULT_BASE_CAPABILITIES = ImmutableSet.of(
34         CapabilityURN.BASE,
35         CapabilityURN.BASE_1_1);
36
37     public static final Set<YangResource> DEFAULT_YANG_RESOURCES = ImmutableSet.of(
38             new YangResource("ietf-netconf-monitoring", "2010-10-04",
39                     "/META-INF/yang/ietf-netconf-monitoring@2010-10-04.yang"),
40             new YangResource("odl-netconf-monitoring", "2022-07-18",
41                     "/META-INF/yang/odl-netconf-monitoring@2022-07-18.yang"),
42             new YangResource("ietf-yang-types", "2013-07-15",
43                     "/META-INF/yang/ietf-yang-types@2013-07-15.yang"),
44             new YangResource("ietf-inet-types", "2013-07-15",
45                     "/META-INF/yang/ietf-inet-types@2013-07-15.yang")
46     );
47
48     public static final AuthProvider DEFAULT_AUTH_PROVIDER = (username, password) -> {
49         LOG.info("Auth with username and password: {}", username);
50         return true;
51     };
52
53     public static final PublickeyAuthenticator DEFAULT_PUBLIC_KEY_AUTHENTICATOR = (username, key, session) -> {
54         LOG.info("Auth with public key: {}", key);
55         return true;
56     };
57
58     private int generateConfigsTimeout = (int) TimeUnit.MINUTES.toMillis(30);
59     private int threadPoolSize = 8;
60     private int startingPort = 17830;
61     private int deviceCount = 1;
62     private boolean ssh = true;
63     private String ip = "0.0.0.0";
64     private Set<YangResource> defaultYangResources = DEFAULT_YANG_RESOURCES;
65
66     private Set<YangModuleInfo> models;
67     private Set<String> capabilities = DEFAULT_BASE_CAPABILITIES_EXI;
68     private RpcHandler rpcHandler = new RpcHandlerDefault();
69     private OperationsCreator operationsCreator;
70     private AuthProvider authProvider = DEFAULT_AUTH_PROVIDER;
71     private PublickeyAuthenticator publickeyAuthenticator = DEFAULT_PUBLIC_KEY_AUTHENTICATOR;
72
73     @Deprecated
74     private boolean mdSal = false;
75
76     @Deprecated
77     private File rpcConfigFile;
78
79     @Deprecated
80     private File notificationFile;
81
82     @Deprecated
83     private File initialConfigXMLFile;
84
85     @Deprecated
86     private File schemasDir;
87
88     public Configuration() {
89     }
90
91     public PublickeyAuthenticator getPublickeyAuthenticator() {
92         return publickeyAuthenticator;
93     }
94
95     public void setPublickeyAuthenticator(final PublickeyAuthenticator publickeyAuthenticator) {
96         this.publickeyAuthenticator = publickeyAuthenticator;
97     }
98
99     public AuthProvider getAuthProvider() {
100         return authProvider;
101     }
102
103     public void setAuthProvider(final AuthProvider authProvider) {
104         this.authProvider = authProvider;
105     }
106
107     public Set<YangResource> getDefaultYangResources() {
108         return defaultYangResources;
109     }
110
111     public void setDefaultYangResources(final Set<YangResource> defaultYangResources) {
112         this.defaultYangResources = defaultYangResources;
113     }
114
115     public int getThreadPoolSize() {
116         return threadPoolSize;
117     }
118
119     public void setThreadPoolSize(final int threadPoolSize) {
120         this.threadPoolSize = threadPoolSize;
121     }
122
123     public int getStartingPort() {
124         return startingPort;
125     }
126
127     public void setStartingPort(final int startingPort) {
128         this.startingPort = startingPort;
129     }
130
131     public int getDeviceCount() {
132         return deviceCount;
133     }
134
135     public void setDeviceCount(final int deviceCount) {
136         this.deviceCount = deviceCount;
137     }
138
139     public int getGenerateConfigsTimeout() {
140         return generateConfigsTimeout;
141     }
142
143     public void setGenerateConfigsTimeout(final int generateConfigsTimeout) {
144         this.generateConfigsTimeout = generateConfigsTimeout;
145     }
146
147     public boolean isSsh() {
148         return ssh;
149     }
150
151     public void setSsh(final boolean ssh) {
152         this.ssh = ssh;
153     }
154
155     public String getIp() {
156         return ip;
157     }
158
159     public void setIp(final String ip) {
160         this.ip = ip;
161     }
162
163     public Set<YangModuleInfo> getModels() {
164         return models;
165     }
166
167     public void setModels(final Set<YangModuleInfo> models) {
168         this.models = models;
169     }
170
171     public Set<String> getCapabilities() {
172         return capabilities;
173     }
174
175     public void setCapabilities(final Set<String> capabilities) {
176         this.capabilities = capabilities;
177     }
178
179     public RpcHandler getRpcHandler() {
180         return rpcHandler;
181     }
182
183     public void setRpcHandler(final RpcHandler rpcHandler) {
184         this.rpcHandler = rpcHandler;
185     }
186
187     public OperationsCreator getOperationsCreator() {
188         return operationsCreator;
189     }
190
191     public void setOperationsCreator(final OperationsCreator operationsCreator) {
192         this.operationsCreator = operationsCreator;
193     }
194
195     @Deprecated
196     public boolean isMdSal() {
197         return mdSal;
198     }
199
200     @Deprecated
201     public void setMdSal(final boolean mdSal) {
202         this.mdSal = mdSal;
203     }
204
205     @Deprecated
206     public File getRpcConfigFile() {
207         return rpcConfigFile;
208     }
209
210     @Deprecated
211     public void setRpcConfigFile(final File rpcConfigFile) {
212         this.rpcConfigFile = rpcConfigFile;
213     }
214
215     @Deprecated
216     public File getNotificationFile() {
217         return notificationFile;
218     }
219
220     @Deprecated
221     public void setNotificationFile(final File notificationFile) {
222         this.notificationFile = notificationFile;
223     }
224
225     @Deprecated
226     public File getInitialConfigXMLFile() {
227         return initialConfigXMLFile;
228     }
229
230     @Deprecated
231     public void setInitialConfigXMLFile(final File initialConfigXMLFile) {
232         this.initialConfigXMLFile = initialConfigXMLFile;
233     }
234
235     @Deprecated
236     public boolean isXmlConfigurationProvided() {
237         return initialConfigXMLFile != null;
238     }
239
240     @Deprecated
241     public boolean isNotificationsSupported() {
242         return notificationFile != null;
243     }
244
245     @Deprecated
246     public File getSchemasDir() {
247         return schemasDir;
248     }
249
250     @Deprecated
251     public void setSchemasDir(final File schemasDir) {
252         this.schemasDir = schemasDir;
253     }
254 }