Package de.mnl.srcpd4cu.srcp

Examples of de.mnl.srcpd4cu.srcp.Command


                log.finer("Request: " + cmdLine);
                // Find command, first choose map according to state
                Map<String, Command> commandMap = COMMAND_MAPS.get(session
                        .getMode());
                // set to found command
                Command command = null;
                for (Map.Entry<String, Command> entry : commandMap.entrySet()) {
                    if (cmdLine.startsWith(entry.getKey() + " ")) {
                        command = entry.getValue();
                        // shorten command line to arguments
                        cmdLine = cmdLine
                                .substring(entry.getKey().length() + 1);
                        break;
                    }
                    if (cmdLine.equals(entry.getKey())) {
                        command = entry.getValue();
                        cmdLine = "";
                        break;
                    }
                }
                // if command found, execute
                if (command != null) {
                    Command.Response resp
                        = command.execute(session, cmdLine.trim());
                    respond(resp.getCode(), resp.getMessage());
                    continue;
                }
                respond(410, "ERROR unknown command");
            }
View Full Code Here

TOP

Related Classes of de.mnl.srcpd4cu.srcp.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.