blob: 2f82da0cb73e9f80e0d679e957f13fd0cf5940ed [file] [log] [blame]
pankajf49b45e2014-10-07 14:24:22 -07001package org.onlab.onos.foo;
2
3import static org.onlab.onos.foo.SimpleNettyServer.startStandalone;
4
5import org.apache.karaf.shell.commands.Argument;
6import org.apache.karaf.shell.commands.Command;
7import org.onlab.onos.cli.AbstractShellCommand;
8
9/**
10 * Starts the Simple Netty server.
11 */
12@Command(scope = "onos", name = "test-netty-server",
13 description = "Starts the simple netty server")
14public class SimpleNettyServerCommand extends AbstractShellCommand {
15
16 @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
28 @Override
29 protected void execute() {
30 try {
31 startStandalone(new String[]{serverIp, workers, messageLength});
32 } catch (Exception e) {
33 error("Unable to start server %s", e);
34 }
35 }
36
37}