public void init
(SessionDevice session, DeviceGroup deviceGroup, String args)
throws CommandExecutionException {
String[] stdArgs = args.split(" ");
if (stdArgs.length < 1) {
throw new CommandExecutionException(Command.ERROR_LIST_TOO_SHORT);
}
try {
protocol = stdArgs[0];
if (!protocol.matches("^[AFLMNPSZ]$")) {
throw new CommandExecutionException(Command.ERROR_WRONG_VALUE);
}
if (protocol.equals("M") || protocol.equals("N")) {
if (stdArgs.length < 4) {
throw new CommandExecutionException
(Command.ERROR_LIST_TOO_SHORT);
}
init(deviceGroup, protocol, Integer.parseInt(stdArgs[1]),
Integer.parseInt(stdArgs[2]),
Integer.parseInt(stdArgs[3]));
} else {
init(deviceGroup, protocol, 0, 0, 0);
}
} catch (NumberFormatException e) {
throw new CommandExecutionException(Command.ERROR_WRONG_VALUE);
}
}