Examples of SbiThresholdValue


Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

   *
   * @throws EMFUserError
   */
  private void importThresholdValue(boolean overwrite) throws EMFUserError {
    logger.debug("IN");
    SbiThresholdValue exportedThValue = null;
    try {
      List exportedThValues = importer.getAllExportedSbiObjects(sessionExpDB, "SbiThresholdValue", null);
      Iterator iterSbiThValues = exportedThValues.iterator();
      while (iterSbiThValues.hasNext()) {
        exportedThValue = (SbiThresholdValue) iterSbiThValues.next();
        Integer oldId = exportedThValue.getIdThresholdValue();
        Integer existingThValueId = null;
        Map thValuesIdAss = metaAss.getTresholdValueIDAssociation();
        Set thValuesIdAssSet = thValuesIdAss.keySet();
        if (thValuesIdAssSet.contains(oldId) && !overwrite) {        // it could have been already inserted
          metaLog.log("Exported threshold values " + exportedThValue.getLabel() + " not inserted"
              + " because it has the same label of an existing threshold value");
          continue;
        } else {
          existingThValueId = (Integer) thValuesIdAss.get(oldId);
        }
        if (existingThValueId != null) {
          logger.info("The threshold value with id:[" + exportedThValue.getIdThresholdValue() + "] is just present. It will be updated.");
          metaLog.log("The threshold value with code = [" + exportedThValue.getLabel() + "] will be updated.");
          SbiThresholdValue existingThValue = ImportUtilities.modifyExistingSbiThresholdValue(exportedThValue, sessionCurrDB, existingThValueId, metaAss,importer);
          sessionCurrDB.update(existingThValue);
        } else {
          SbiThresholdValue newThresholdValue = ImportUtilities.makeNewSbiThresholdValue(exportedThValue, sessionCurrDB, metaAss,importer);
          sessionCurrDB.save(newThresholdValue);
          metaLog.log("Inserted new Threshold Value " + newThresholdValue.getLabel());
          Integer newId = newThresholdValue.getIdThresholdValue();
          metaAss.insertCoupleThresholdValue(oldId, newId);
        }

      }
    } catch (Exception e) {
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      if(!oldThrType.getValueCd().equalsIgnoreCase(newThresholdType.getValueCd())){
        //If the type of threshold is changed all old threshold need to be deleted
        Set set = sbiThreshold.getSbiThresholdValues();
        ArrayList thValues=new ArrayList();
        for (Iterator iterator = set.iterator(); iterator.hasNext();) {
          SbiThresholdValue sbiThValue = (SbiThresholdValue) iterator.next();
          //look up for alarms
          String hql = "from SbiAlarm a where a.sbiThresholdValue.idThresholdValue = :id";
          Query hqlQuery = aSession.createQuery(hql);
          hqlQuery.setInteger("id", sbiThValue.getIdThresholdValue());
          List <SbiAlarm> alarms = hqlQuery.list();
          if(alarms != null && !alarms.isEmpty()){
            throw new EMFUserError(EMFErrorSeverity.ERROR, 10119);
          }
          aSession.delete(sbiThValue);
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

    // get all the threshold Values
    IThresholdValueDAO thValuesDao=(IThresholdValueDAO)DAOFactory.getThresholdValueDAO();
    Set set=t.getSbiThresholdValues();
    ArrayList thValues=new ArrayList();
    for (Iterator iterator = set.iterator(); iterator.hasNext();) {
      SbiThresholdValue sbiThValue = (SbiThresholdValue) iterator.next();
      thValues.add(thValuesDao.toThresholdValue(sbiThValue));
    }
    toReturn.setThresholdValues(thValues);
   
    logger.debug("OUT");
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      if(kpiInstId != null){
        SbiKpiInstance sbiKpiInstance = DAOFactory.getKpiInstanceDAO().loadSbiKpiInstanceById(kpiInstId);
        alarm.setSbiKpiInstance(sbiKpiInstance);
      }
      if(thresholdId != null){
        SbiThresholdValue sbiThresholdValue = DAOFactory.getThresholdValueDAO().loadSbiThresholdValueById(thresholdId);
        alarm.setSbiThresholdValue(sbiThresholdValue);
      }
     
      if(id != null && !id.equals("") && !id.equals("0")){ 
        alarm.setId(Integer.valueOf(id));
View Full Code Here

Examples of it.eng.spagobi.kpi.threshold.metadata.SbiThresholdValue

      if(t!=null){
        Set thresholdValues = t.getSbiThresholdValues();
        Iterator it = thresholdValues.iterator();
        while (it.hasNext()) {
          SbiThresholdValue val = (SbiThresholdValue) it.next();
          // TODO mettere a posto
          IThresholdDAO thDao=(IThresholdDAO)DAOFactory.getThresholdDAO();
          Threshold tr = thDao.toThreshold(null);
          logger.debug("Added threshold with label " + tr.getName());
          thresholds.add(tr);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.