/**
   * @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 propertyEnum property enumeration
  * @param propertyValue property value
  * @return count of matched instruments
  * @throws InvalidServiceMethodCallException
  * @throws JSONException <br>
  *     Count the matched instruments in RDC. <br>
  *     Refer to the IQM native master service for the details. <br>
  */
 public Long countInstrumentsInRDC(InstrumentVO.AttributesEnum propertyEnum, String propertyValue)
     throws InvalidServiceMethodCallException, JSONException {
   String res =
       (String)
           Utils.callMethod(
               this.getIQMAppService(), //
               "getRDCCheckJSonForInstrument", //
               new Object[] {propertyEnum.getEnumName(), propertyValue});
   DaoResult daoResult = Utils.fromJSON(res);
   if (daoResult.isSucc()) {
     Long cnt = Long.parseLong(daoResult.getKey_value());
     return cnt;
   } else {
     throw new InvalidServiceMethodCallException(daoResult.getMessage());
   }
 }