blob: 4777e7141ff21b76ff5c034db9efd57f0fe01218 [file] [log] [blame]
tomf110fff2014-09-26 00:38:18 -07001package org.onlab.onos.foo;
2
tomf7e13b02014-09-26 11:12:25 -07003import org.apache.karaf.shell.commands.Argument;
tomf110fff2014-09-26 00:38:18 -07004import org.apache.karaf.shell.commands.Command;
5import org.onlab.onos.cli.AbstractShellCommand;
6
7import static org.onlab.onos.foo.IOLoopTestServer.startStandalone;
8
tomf110fff2014-09-26 00:38:18 -07009/**
10 * Starts the test IO loop server.
11 */
12@Command(scope = "onos", name = "test-io-server",
13 description = "Starts the test IO loop server")
14public class TestIOServerCommand extends AbstractShellCommand {
15
tomf7e13b02014-09-26 11:12:25 -070016 @Argument(index = 0, name = "serverIp", description = "Server IP address",
17 required = false, multiValued = false)
18 String serverIp = "127.0.0.1";
19
20 @Argument(index = 1, name = "workers", description = "IO workers",
21 required = false, multiValued = false)
22 String workers = "6";
23
24 @Argument(index = 2, name = "messageLength", description = "Message length (bytes)",
25 required = false, multiValued = false)
26 String messageLength = "128";
27
tomf110fff2014-09-26 00:38:18 -070028 @Override
29 protected void execute() {
30 try {
tomf7e13b02014-09-26 11:12:25 -070031 startStandalone(new String[]{serverIp, workers, messageLength});
tomf110fff2014-09-26 00:38:18 -070032 } catch (Exception e) {
33 error("Unable to start server %s", e);
34 }
35 }
36
37}