Package de.mnl.srcpd4cu.util

Examples of de.mnl.srcpd4cu.util.CommandExecutionException


                easyControl.executeCommand("GO", 1000);
            } else {
                easyControl.executeCommand("STOP", 1000);
            }
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
        // Store state for comparison when polling
        updateStoredState(state);
    }
View Full Code Here


                updateStoredState(curState);
                fireStateChange(Cause.OTHER);
            }
            return curState;
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
    }
View Full Code Here

    @Override
    public void reset() throws CommandExecutionException {
        // enter resetting mode, prohibit other resets
        synchronized (this) {
            if (resetting) {
                throw new CommandExecutionException
                    (Command.ERROR_TEMPORARILY_PROHIBITED);
            }
            resetting = true;
        }
        fireStateChange(Cause.OTHER);
View Full Code Here

    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);
        }
    }
View Full Code Here

            throws CommandExecutionException {
        List<String> argsList
            = new ArrayList<String>(Arrays.asList(args.split(" ")));
        long arg = CommandUtil.consumeNumber(argsList);
        if (arg < 0 || arg >= Drivemode.values().length) {
            throw new CommandExecutionException(Command.ERROR_WRONG_VALUE);
        }
        Drivemode drivemode = Drivemode.values()[(int)arg];
        int speed = (int)CommandUtil.consumeNumber(argsList);
        int maxSpeed = (int)CommandUtil.consumeNumber(argsList);
        boolean[] flags = new boolean[argsList.size()];
View Full Code Here

                    }
                    setReportedPortValue(port, 0);
                }
            }, delay);
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
    }
View Full Code Here

            }
            return stateFromResponse
                (easyControl.executeCommand(command, 1000),
                 state.getMaxSpeed());
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
    }
View Full Code Here

                            + e.getMessage());
                return getStoredState();
            }
            return curState;
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
    }
View Full Code Here

                easyControl.executeCommand("GO", 1000);
            } else {
                easyControl.executeCommand("STOP", 1000);
            }
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
        // Store state for comparison when polling
        updateStoredState(state);
    }
View Full Code Here

                updateStoredState(curState);
                fireStateChange(Cause.OTHER);
            }
            return curState;
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
    }
View Full Code Here

TOP

Related Classes of de.mnl.srcpd4cu.util.CommandExecutionException

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.