/**
   * @param permId instrument perm id
   * @param attributeEnum instrument attribute enumeration
   * @param effectiveFrom effective from
   * @param effectiveTo effective to
   * @return instrumentVO with the history of the required attribute within the specified period;
   *     return valid object with no attributes if no data found
   * @throws JSONException
   * @throws InvalidRawValueException
   * @throws InvalidServiceMethodCallException
   */
  public InstrumentVO getHistoryAttributeOfInstrumentByPermId(
      Long permId,
      InstrumentVO.AttributesEnum attributeEnum, //
      Date effectiveFrom,
      Date effectiveTo)
      throws JSONException, InvalidRawValueException, InvalidServiceMethodCallException {
    String entityVOStr =
        (String)
            Utils.callMethod( //
                this.getIQMNonTemporalAppModuleService(), //
                "getHistoryEntityVOJSONByAttributeNameAndDateRange", //
                new Object[] {
                  InstrumentVO.entityLevel,
                  permId.toString(),
                  attributeEnum.getEnumName(),
                  Utils.convertToString(effectiveFrom),
                  Utils.convertToString(effectiveTo)
                });

    InstrumentVO instrumentVO = (InstrumentVO) Utils.getEntityVOFromJSON(entityVOStr);
    if (instrumentVO != null) {
      instrumentVO.setIsNormalized(null);
      AttributeConverter.convertEntityVO(instrumentVO, false);
    }
    return instrumentVO;
  }
  /**
   * @param permId instrument perm id
   * @param effectiveFromDate effective from
   * @param effectiveToDate effective to
   * @return InstrumentVO with all the info of the requested instrument.
   * @throws JSONException
   * @throws InvalidRawValueException
   * @throws InvalidServiceMethodCallException <br>
   *     Only perm ids will be provided for all the associated quotes). <br>
   *     All attributes will have denormalized values instead of ids. <br>
   *     E.g. "Published" (TRCS name) will be provided for ADMIN_STATUS instead of 1010003 (TRCS
   *     perm id).
   */
  public InstrumentVO getInstrumentVOByPermId(
      Long permId, Date effectiveFromDate, Date effectiveToDate)
      throws JSONException, InvalidRawValueException, InvalidServiceMethodCallException {

    String entityVOStr =
        (String)
            Utils.callMethod(
                this.getIQMAppService(), //
                "getInstrumentVOJSONByPermId", //
                new Object[] { //
                  permId.toString(), //
                  Utils.convertToString(effectiveFromDate), //
                  Utils.convertToString(effectiveToDate) //
                });

    InstrumentVO entityVO = (InstrumentVO) Utils.getEntityVOFromJSON(entityVOStr);
    if (entityVO != null) {
      entityVO.setIsNormalized(null);

      AttributeConverter.convertEntityVO(entityVO, false);
    }
    return entityVO;
  }