blob: 17b25864b7b41fb0fd06b1596078f59c865f58c9 [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 */
pankajea0acef2014-10-07 15:01:47 -070012@Command(scope = "onos", name = "simple-netty-server",
pankajf49b45e2014-10-07 14:24:22 -070013 description = "Starts the simple netty server")
14public class SimpleNettyServerCommand extends AbstractShellCommand {
15
pankajea0acef2014-10-07 15:01:47 -070016 //FIXME: Replace these with parameters for
pankajf49b45e2014-10-07 14:24:22 -070017 @Argument(index = 0, name = "serverIp", description = "Server IP address",
18 required = false, multiValued = false)
19 String serverIp = "127.0.0.1";
20
21 @Argument(index = 1, name = "workers", description = "IO workers",
22 required = false, multiValued = false)
23 String workers = "6";
24
25 @Argument(index = 2, name = "messageLength", description = "Message length (bytes)",
26 required = false, multiValued = false)
27 String messageLength = "128";
28
29 @Override
30 protected void execute() {
31 try {
32 startStandalone(new String[]{serverIp, workers, messageLength});
33 } catch (Exception e) {
34 error("Unable to start server %s", e);
35 }
36 }
37
38}