@Override
  public CommandStatus execCommand(DataBlock command) throws SensorException {
    // associate command data to msg structure definition
    DataChoice commandMsg = (DataChoice) commandData.copy();
    commandMsg.setData(command);

    DataComponent component = ((DataChoiceImpl) commandMsg).getSelectedItem();
    String itemID = component.getName();
    DataBlock data = component.getData();
    String itemValue = data.getStringValue();

    // NOTE: you can use validate() method in DataComponent
    // component.validateData(errorList);  // give it a list so it can store the errors
    // if (errorList != empty)  //then you have an error

    try {
      // set parameter value on camera
      // NOTE: except for "presets", the item IDs are labeled the same as the Axis parameters so
      // just use those in the command
      if (itemID.equals(VideoCamHelper.TASKING_PTZPRESET)) {
        PtzPreset preset = presetsHandler.getPreset(data.getStringValue());

        // pan + tilt + zoom (supported since v2 at least)
        URL optionsURL =
            new URL(
                parentSensor.getHostUrl()
                    + "/com/ptz.cgi?pan="
                    + preset.pan
                    + "&tilt="
                    + preset.tilt
                    + "&zoom="
                    + preset.zoom);
        InputStream is = optionsURL.openStream();
        is.close();

      }

      // Act on full PTZ Position
      else if (itemID.equalsIgnoreCase(VideoCamHelper.TASKING_PTZ_POS)) {

        URL optionsURL =
            new URL(
                parentSensor.getHostUrl()
                    + "/com/ptz.cgi?pan="
                    + data.getStringValue(0)
                    + "&tilt="
                    + data.getStringValue(1)
                    + "&zoom="
                    + data.getStringValue(2));
        InputStream is = optionsURL.openStream();
        is.close();

      } else {
        String cmd = " ";
        if (itemID.equals(VideoCamHelper.TASKING_PAN)) cmd = "pan";
        else if (itemID.equals(VideoCamHelper.TASKING_RPAN)) cmd = "rpan";
        else if (itemID.equals(VideoCamHelper.TASKING_TILT)) cmd = "tilt";
        else if (itemID.equals(VideoCamHelper.TASKING_RTILT)) cmd = "rtilt";
        else if (itemID.equals(VideoCamHelper.TASKING_ZOOM)) cmd = "zoom";
        else if (itemID.equals(VideoCamHelper.TASKING_RZOOM)) cmd = "rzoom";

        URL optionsURL =
            new URL(parentSensor.getHostUrl() + "/com/ptz.cgi?" + cmd + "=" + itemValue);
        InputStream is = optionsURL.openStream();
        is.close();
      }

    } catch (Exception e) {
      throw new SensorException("Error connecting to Axis PTZ control", e);
    }

    CommandStatus cmdStatus = new CommandStatus();
    cmdStatus.status = StatusCode.COMPLETED;
    return cmdStatus;
  }