@Test public void testConfiguration() { Dictionary<String, String> properties = new Hashtable<>(); properties.put("openflowPorts", "1,2,3,4,5"); properties.put("workerThreads", "5"); controller.setConfigParams(properties); IntStream.rangeClosed(1, 5) .forEach(i -> assertThat(controller.openFlowPorts, hasItem(i))); assertThat(controller.workerThreads, is(5)); }
public void setConfigParams(Dictionary<?, ?> properties) { String ports = get(properties, "openflowPorts"); if (!Strings.isNullOrEmpty(ports)) { this.openFlowPorts = Stream.of(ports.split(",")) .map(s -> Integer.parseInt(s)) .collect(Collectors.toList()); } log.debug("OpenFlow ports set to {}", this.openFlowPorts); String threads = get(properties, "workerThreads"); if (!Strings.isNullOrEmpty(threads)) { this.workerThreads = Integer.parseInt(threads); } log.debug("Number of worker threads set to {}", this.workerThreads); }
Controller { public void setConfigParams(Dictionary<?, ?> properties) { String ports = get(properties, "openflowPorts"); if (!Strings.isNullOrEmpty(ports)) { this.openFlowPorts = Stream.of(ports.split(",")) .map(s -> Integer.parseInt(s)) .collect(Collectors.toList()); } log.debug("OpenFlow ports set to {}", this.openFlowPorts); String threads = get(properties, "workerThreads"); if (!Strings.isNullOrEmpty(threads)) { this.workerThreads = Integer.parseInt(threads); } log.debug("Number of worker threads set to {}", this.workerThreads); } }
Controller { public void setConfigParams(Dictionary<?, ?> properties) { String ports = get(properties, "openflowPorts"); if (!Strings.isNullOrEmpty(ports)) { this.openFlowPorts = Stream.of(ports.split(",")) .map(s -> Integer.parseInt(s)) .collect(Collectors.toList()); } log.debug("OpenFlow ports set to {}", this.openFlowPorts); String threads = get(properties, "workerThreads"); if (!Strings.isNullOrEmpty(threads)) { this.workerThreads = Integer.parseInt(threads); } log.debug("Number of worker threads set to {}", this.workerThreads); }  }
Controller { public void setConfigParams(Dictionary<?, ?> properties) { String ports = get(properties, "openflowPorts"); if (!Strings.isNullOrEmpty(ports)) { this.openFlowPorts = Stream.of(ports.split(",")) .map(s -> Integer.parseInt(s)) .collect(Collectors.toList()); } log.debug("OpenFlow ports set to {}", this.openFlowPorts); String threads = get(properties, "workerThreads"); if (!Strings.isNullOrEmpty(threads)) { this.workerThreads = Integer.parseInt(threads); } log.debug("Number of worker threads set to {}", this.workerThreads); }  OFFactory getOFMessageFactory10(); OFFactory getOFMessageFactory13(); void run(); void setConfigParams(Dictionary<?, ?> properties); void init(); Map<String, Long> getMemory(); Long getSystemUptime(); long getSystemStartTime(); void start(OpenFlowAgent ag, DriverService driverService); void stop(); }
Controller { public void setConfigParams(Dictionary<?, ?> properties) { String ports = get(properties, "openflowPorts"); if (!Strings.isNullOrEmpty(ports)) { this.openFlowPorts = Stream.of(ports.split(",")) .map(s -> Integer.parseInt(s)) .collect(Collectors.toList()); } log.debug("OpenFlow ports set to {}", this.openFlowPorts); String threads = get(properties, "workerThreads"); if (!Strings.isNullOrEmpty(threads)) { this.workerThreads = Integer.parseInt(threads); } log.debug("Number of worker threads set to {}", this.workerThreads); }  OFFactory getOFMessageFactory10(); OFFactory getOFMessageFactory13(); void run(); void setConfigParams(Dictionary<?, ?> properties); void init(); Map<String, Long> getMemory(); Long getSystemUptime(); long getSystemStartTime(); void start(OpenFlowAgent ag, DriverService driverService); void stop();  }