2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.netconf.test.tool.config;
10 import com.google.common.collect.ImmutableSet;
13 import java.util.concurrent.TimeUnit;
14 import org.opendaylight.netconf.api.xml.XmlNetconfConstants;
15 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandler;
16 import org.opendaylight.netconf.test.tool.rpchandler.RpcHandlerDefault;
19 public class Configuration {
21 public static final Set<String> DEFAULT_BASE_CAPABILITIES_EXI = ImmutableSet.of(
22 XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_0,
23 XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1,
24 XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_CAPABILITY_EXI_1_0
27 public static final Set<String> DEFAULT_BASE_CAPABILITIES = ImmutableSet.of(
28 XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_0,
29 XmlNetconfConstants.URN_IETF_PARAMS_NETCONF_BASE_1_1
32 private int generateConfigsTimeout = (int) TimeUnit.MINUTES.toMillis(30);
33 private int threadPoolSize = 8;
34 private int startingPort = 17830;
35 private int deviceCount = 1;
36 private boolean ssh = true;
37 private String ip = "0.0.0.0";
39 private Set<String> models;
40 private Set<String> capabilities = DEFAULT_BASE_CAPABILITIES_EXI;
41 private RpcHandler rpcHandler = new RpcHandlerDefault();
44 private boolean mdSal = false;
47 private File rpcConfigFile;
50 private File notificationFile;
53 private File initialConfigXMLFile;
56 private File schemasDir;
58 public Configuration() {
61 public int getThreadPoolSize() {
62 return threadPoolSize;
65 public void setThreadPoolSize(int threadPoolSize) {
66 this.threadPoolSize = threadPoolSize;
69 public int getStartingPort() {
73 public void setStartingPort(int startingPort) {
74 this.startingPort = startingPort;
77 public int getDeviceCount() {
81 public void setDeviceCount(int deviceCount) {
82 this.deviceCount = deviceCount;
85 public int getGenerateConfigsTimeout() {
86 return generateConfigsTimeout;
89 public void setGenerateConfigsTimeout(int generateConfigsTimeout) {
90 this.generateConfigsTimeout = generateConfigsTimeout;
93 public boolean isSsh() {
97 public void setSsh(boolean ssh) {
101 public String getIp() {
105 public void setIp(String ip) {
109 public Set<String> getModels() {
113 public void setModels(Set<String> models) {
114 this.models = models;
117 public Set<String> getCapabilities() {
121 public void setCapabilities(Set<String> capabilities) {
122 this.capabilities = capabilities;
125 public RpcHandler getRpcHandler() {
129 public void setRpcHandler(RpcHandler rpcHandler) {
130 this.rpcHandler = rpcHandler;
134 public boolean isMdSal() {
139 public void setMdSal(boolean mdSal) {
144 public File getRpcConfigFile() {
145 return rpcConfigFile;
149 public void setRpcConfigFile(File rpcConfigFile) {
150 this.rpcConfigFile = rpcConfigFile;
154 public File getNotificationFile() {
155 return notificationFile;
159 public void setNotificationFile(File notificationFile) {
160 this.notificationFile = notificationFile;
164 public File getInitialConfigXMLFile() {
165 return initialConfigXMLFile;
169 public void setInitialConfigXMLFile(File initialConfigXMLFile) {
170 this.initialConfigXMLFile = initialConfigXMLFile;
174 public boolean isXmlConfigurationProvided() {
175 return initialConfigXMLFile != null && notificationFile != null;
179 public File getSchemasDir() {
184 public void setSchemasDir(File schemasDir) {
185 this.schemasDir = schemasDir;