public void forgetDomainBySubDomIdx(long TenantId, long SubDomainOfId) {
    if (indexBySubDomIdx == null) {
      return;
    }
    CFInternetDomainBySubDomIdxKey key =
        ((ICFBamSchema) schema.getBackingStore()).getFactoryDomain().newSubDomIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredSubDomainOfId(SubDomainOfId);
    if (indexBySubDomIdx.containsKey(key)) {
      Map<CFInternetDomainBasePKey, ICFInternetDomainObj> mapSubDomIdx = indexBySubDomIdx.get(key);
      if (mapSubDomIdx != null) {
        List<ICFInternetDomainObj> toForget = new LinkedList<ICFInternetDomainObj>();
        ICFInternetDomainObj cur = null;
        Iterator<ICFInternetDomainObj> iter = mapSubDomIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexBySubDomIdx.remove(key);
    }
  }
 public void deleteSecDeviceByUserIdx(UUID SecUserId) {
   CFSecuritySecDeviceByUserIdxKey key =
       ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey();
   key.setRequiredSecUserId(SecUserId);
   if (indexByUserIdx == null) {
     indexByUserIdx =
         new HashMap<
             CFSecuritySecDeviceByUserIdxKey,
             Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj>>();
   }
   if (indexByUserIdx.containsKey(key)) {
     Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> dict = indexByUserIdx.get(key);
     ((ICFSecuritySchema) schema.getBackingStore())
         .getTableSecDevice()
         .deleteSecDeviceByUserIdx(schema.getAuthorization(), SecUserId);
     Iterator<ICFSecuritySecDeviceObj> iter = dict.values().iterator();
     ICFSecuritySecDeviceObj obj;
     List<ICFSecuritySecDeviceObj> toForget = new LinkedList<ICFSecuritySecDeviceObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByUserIdx.remove(key);
   } else {
     ((ICFSecuritySchema) schema.getBackingStore())
         .getTableSecDevice()
         .deleteSecDeviceByUserIdx(schema.getAuthorization(), SecUserId);
   }
 }
  public void forgetTaxByTenantIdx(long TenantId) {
    if (indexByTenantIdx == null) {
      return;
    }
    CFAccTaxByTenantIdxKey key =
        ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);
    if (indexByTenantIdx.containsKey(key)) {
      Map<CFAccTaxPKey, ICFAccTaxObj> mapTenantIdx = indexByTenantIdx.get(key);
      if (mapTenantIdx != null) {
        List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>();
        ICFAccTaxObj cur = null;
        Iterator<ICFAccTaxObj> iter = mapTenantIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByTenantIdx.remove(key);
    }
  }
  public void forgetClearTopDepByContTblIdx(long TenantId, long ContTableId) {
    if (indexByContTblIdx == null) {
      return;
    }
    CFBamClearTopDepByContTblIdxKey key =
        schema.getBackingStore().getFactoryClearTopDep().newContTblIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContTableId(ContTableId);
    if (indexByContTblIdx.containsKey(key)) {
      Map<CFBamScopePKey, ICFBamClearTopDepObj> mapContTblIdx = indexByContTblIdx.get(key);
      if (mapContTblIdx != null) {
        List<ICFBamClearTopDepObj> toForget = new LinkedList<ICFBamClearTopDepObj>();
        ICFBamClearTopDepObj cur = null;
        Iterator<ICFBamClearTopDepObj> iter = mapContTblIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByContTblIdx.remove(key);
    }
  }
 public void deleteTaxByTenantIdx(long TenantId) {
   CFAccTaxByTenantIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey();
   key.setRequiredTenantId(TenantId);
   if (indexByTenantIdx == null) {
     indexByTenantIdx = new HashMap<CFAccTaxByTenantIdxKey, Map<CFAccTaxPKey, ICFAccTaxObj>>();
   }
   if (indexByTenantIdx.containsKey(key)) {
     Map<CFAccTaxPKey, ICFAccTaxObj> dict = indexByTenantIdx.get(key);
     ((ICFAccSchema) schema.getBackingStore())
         .getTableTax()
         .deleteTaxByTenantIdx(schema.getAuthorization(), TenantId);
     Iterator<ICFAccTaxObj> iter = dict.values().iterator();
     ICFAccTaxObj obj;
     List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByTenantIdx.remove(key);
   } else {
     ((ICFAccSchema) schema.getBackingStore())
         .getTableTax()
         .deleteTaxByTenantIdx(schema.getAuthorization(), TenantId);
   }
 }
Beispiel #6
0
 private void deleteJsonJobs(ApplicationInfo appInfo, List<CIJob> selectedJobs)
     throws PhrescoException {
   try {
     if (CollectionUtils.isEmpty(selectedJobs)) {
       return;
     }
     Gson gson = new Gson();
     List<CIJob> jobs = getJobs(appInfo);
     if (CollectionUtils.isEmpty(jobs)) {
       return;
     }
     // all values
     Iterator<CIJob> iterator = jobs.iterator();
     // deletable values
     for (CIJob selectedInfo : selectedJobs) {
       while (iterator.hasNext()) {
         CIJob itrCiJob = iterator.next();
         if (itrCiJob.getName().equals(selectedInfo.getName())) {
           iterator.remove();
           break;
         }
       }
     }
     writeJsonJobs(appInfo, jobs, CI_CREATE_NEW_JOBS);
   } catch (Exception e) {
     throw new PhrescoException(e);
   }
 }
 public void deleteClearTopDepByContTblIdx(long TenantId, long ContTableId) {
   CFBamClearTopDepByContTblIdxKey key =
       schema.getBackingStore().getFactoryClearTopDep().newContTblIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContTableId(ContTableId);
   if (indexByContTblIdx == null) {
     indexByContTblIdx =
         new HashMap<CFBamClearTopDepByContTblIdxKey, Map<CFBamScopePKey, ICFBamClearTopDepObj>>();
   }
   if (indexByContTblIdx.containsKey(key)) {
     Map<CFBamScopePKey, ICFBamClearTopDepObj> dict = indexByContTblIdx.get(key);
     schema
         .getBackingStore()
         .getTableClearTopDep()
         .deleteClearTopDepByContTblIdx(schema.getAuthorization(), TenantId, ContTableId);
     Iterator<ICFBamClearTopDepObj> iter = dict.values().iterator();
     ICFBamClearTopDepObj obj;
     List<ICFBamClearTopDepObj> toForget = new LinkedList<ICFBamClearTopDepObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByContTblIdx.remove(key);
   } else {
     schema
         .getBackingStore()
         .getTableClearTopDep()
         .deleteClearTopDepByContTblIdx(schema.getAuthorization(), TenantId, ContTableId);
   }
 }
  public void forgetSecDeviceByUserIdx(UUID SecUserId) {
    if (indexByUserIdx == null) {
      return;
    }
    CFSecuritySecDeviceByUserIdxKey key =
        ((ICFSecuritySchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey();
    key.setRequiredSecUserId(SecUserId);
    if (indexByUserIdx.containsKey(key)) {
      Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> mapUserIdx = indexByUserIdx.get(key);
      if (mapUserIdx != null) {
        List<ICFSecuritySecDeviceObj> toForget = new LinkedList<ICFSecuritySecDeviceObj>();
        ICFSecuritySecDeviceObj cur = null;
        Iterator<ICFSecuritySecDeviceObj> iter = mapUserIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByUserIdx.remove(key);
    }
  }
  public void forgetSecGroupIncludeByIncludeIdx(long ClusterId, int IncludeGroupId) {
    if (indexByIncludeIdx == null) {
      return;
    }
    CFSecuritySecGroupIncludeByIncludeIdxKey key =
        ((ICFInternetSchema) schema.getBackingStore())
            .getFactorySecGroupInclude()
            .newIncludeIdxKey();
    key.setRequiredClusterId(ClusterId);
    key.setRequiredIncludeGroupId(IncludeGroupId);
    if (indexByIncludeIdx.containsKey(key)) {
      Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> mapIncludeIdx =
          indexByIncludeIdx.get(key);
      if (mapIncludeIdx != null) {
        List<ICFSecuritySecGroupIncludeObj> toForget =
            new LinkedList<ICFSecuritySecGroupIncludeObj>();
        ICFSecuritySecGroupIncludeObj cur = null;
        Iterator<ICFSecuritySecGroupIncludeObj> iter = mapIncludeIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByIncludeIdx.remove(key);
    }
  }
 public CFSecuritySecDeviceBuff[] readBuffByUserIdx(
     CFSecurityAuthorization Authorization, UUID SecUserId) {
   final String S_ProcName = "readBuffByUserIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "call "
             + schema.getLowerDbSchemaName()
             + ".sp_read_secdev_by_useridx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + " )";
     if (stmtReadBuffByUserIdx == null) {
       stmtReadBuffByUserIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByUserIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUserIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByUserIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByUserIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUserIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByUserIdx.setString(argIdx++, SecUserId.toString());
     try {
       resultSet = stmtReadBuffByUserIdx.executeQuery();
     } catch (SQLException e) {
       if (e.getErrorCode() != 1329) {
         throw e;
       }
       resultSet = null;
     }
     List<CFSecuritySecDeviceBuff> buffList = new LinkedList<CFSecuritySecDeviceBuff>();
     while ((resultSet != null) && resultSet.next()) {
       CFSecuritySecDeviceBuff buff = unpackSecDeviceResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecuritySecDeviceBuff[] retBuff = new CFSecuritySecDeviceBuff[buffList.size()];
     Iterator<CFSecuritySecDeviceBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
  public void forgetISOCountryCurrencyByCurrencyIdx(short ISOCurrencyId) {
    if (indexByCurrencyIdx == null) {
      return;
    }
    CFSecurityISOCountryCurrencyByCurrencyIdxKey key =
        ((ICFInternetSchema) schema.getBackingStore())
            .getFactoryISOCountryCurrency()
            .newCurrencyIdxKey();
    key.setRequiredISOCurrencyId(ISOCurrencyId);
    if (indexByCurrencyIdx.containsKey(key)) {
      Map<CFSecurityISOCountryCurrencyPKey, ICFSecurityISOCountryCurrencyObj> mapCurrencyIdx =
          indexByCurrencyIdx.get(key);
      if (mapCurrencyIdx != null) {
        List<ICFSecurityISOCountryCurrencyObj> toForget =
            new LinkedList<ICFSecurityISOCountryCurrencyObj>();
        ICFSecurityISOCountryCurrencyObj cur = null;
        Iterator<ICFSecurityISOCountryCurrencyObj> iter = mapCurrencyIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByCurrencyIdx.remove(key);
    }
  }
 public CFSecurityISOCountryLanguageBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "call " + schema.getLowerDbSchemaName() + ".sp_read_iso_cntrylng_all( ?, ?, ?, ?, ? )";
     if (stmtReadAllBuff == null) {
       stmtReadAllBuff = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     try {
       resultSet = stmtReadAllBuff.executeQuery();
     } catch (SQLException e) {
       if (e.getErrorCode() != 1329) {
         throw e;
       }
       resultSet = null;
     }
     List<CFSecurityISOCountryLanguageBuff> buffList =
         new LinkedList<CFSecurityISOCountryLanguageBuff>();
     while ((resultSet != null) && resultSet.next()) {
       CFSecurityISOCountryLanguageBuff buff = unpackISOCountryLanguageResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecurityISOCountryLanguageBuff[] retBuff =
         new CFSecurityISOCountryLanguageBuff[buffList.size()];
     Iterator<CFSecurityISOCountryLanguageBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
Beispiel #13
0
 private void rm(Channel chan) {
   synchronized (chls) {
     for (Iterator<DarkChannel> i = chls.iterator(); i.hasNext(); ) {
       DarkChannel c = i.next();
       if (c.chan == chan) i.remove();
     }
   }
 }
 private boolean calculateWithValidValues() {
   Iterator it = metaProperties.iterator();
   while (it.hasNext()) {
     MetaProperty m = (MetaProperty) it.next();
     if (m.hasValidValues()) return true;
   }
   return false;
 }
 public CFSecurityISOTimezoneBuff[] readBuffByOffsetIdx(
     CFSecurityAuthorization Authorization, short TZHourOffset, short TZMinOffset) {
   final String S_ProcName = "readBuffByOffsetIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "SELECT * FROM "
             + schema.getLowerDbSchemaName()
             + ".sp_read_isotz_by_offsetidx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " )";
     if (stmtReadBuffByOffsetIdx == null) {
       stmtReadBuffByOffsetIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByOffsetIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByOffsetIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByOffsetIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByOffsetIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByOffsetIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByOffsetIdx.setShort(argIdx++, TZHourOffset);
     stmtReadBuffByOffsetIdx.setShort(argIdx++, TZMinOffset);
     resultSet = stmtReadBuffByOffsetIdx.executeQuery();
     List<CFSecurityISOTimezoneBuff> buffList = new LinkedList<CFSecurityISOTimezoneBuff>();
     while (resultSet.next()) {
       CFSecurityISOTimezoneBuff buff = unpackISOTimezoneResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecurityISOTimezoneBuff[] retBuff = new CFSecurityISOTimezoneBuff[buffList.size()];
     Iterator<CFSecurityISOTimezoneBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFCrmMemoDataBuff[] readBuffByMemoDataCtcIdx(
     CFSecurityAuthorization Authorization, long TenantId, long ContactId) {
   final String S_ProcName = "readBuffByMemoDataCtcIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "{ call sp_read_memodata_by_memodatactcidx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + ", "
             + "?"
             + " ) }";
     if (stmtReadBuffByMemoDataCtcIdx == null) {
       stmtReadBuffByMemoDataCtcIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByMemoDataCtcIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByMemoDataCtcIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByMemoDataCtcIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByMemoDataCtcIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByMemoDataCtcIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByMemoDataCtcIdx.setLong(argIdx++, TenantId);
     stmtReadBuffByMemoDataCtcIdx.setLong(argIdx++, ContactId);
     resultSet = stmtReadBuffByMemoDataCtcIdx.executeQuery();
     List<CFCrmMemoDataBuff> buffList = new LinkedList<CFCrmMemoDataBuff>();
     if (resultSet != null) {
       while (resultSet.next()) {
         CFCrmMemoDataBuff buff = unpackMemoDataResultSetToBuff(resultSet);
         buffList.add(buff);
       }
     }
     int idx = 0;
     CFCrmMemoDataBuff[] retBuff = new CFCrmMemoDataBuff[buffList.size()];
     Iterator<CFCrmMemoDataBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 /**
  * Method to replay the frames (pictures) added so far
  *
  * @param sleepTime the amount to sleep in milliseconds between frames
  */
 public void replay(int sleepTime) {
   Picture picture = null;
   Iterator iterator = pictureList.iterator();
   while (iterator.hasNext()) {
     picture = (Picture) iterator.next();
     pictureFrame.setPicture(picture);
     try {
       Thread.sleep(sleepTime);
     } catch (Exception ex) {
     }
   }
 }
Beispiel #18
0
  public List getUserList() {
    List<Map> list = new ArrayList<Map>();

    try {

      /*
      String apiUrl=rallyApiHost+"/user?query="+
      	"((TeamMemberships%20%3D%20https%3A%2F%2Frally1.rallydev.com%2Fslm%2Fwebservice%2F1.34%2Fproject%2F6169133135)%20or%20"+
      	"(TeamMemberships%20%3D%20https%3A%2F%2Frally1.rallydev.com%2Fslm%2Fwebservice%2F1.34%2Fproject%2F6083311244))"+
      	"&fetch=true&order=Name&start=1&pagesize=100";
      */

      String apiUrl =
          rallyApiHost
              + "/user?query=(Disabled%20=%20false)"
              + "&fetch=true&order=Name&start=1&pagesize=100";

      log.info("apiUrl=" + apiUrl);

      String responseXML = getRallyXML(apiUrl);

      org.jdom.input.SAXBuilder bSAX = new org.jdom.input.SAXBuilder();
      org.jdom.Document doc = bSAX.build(new StringReader(responseXML));
      Element root = doc.getRootElement();

      XPath xpath = XPath.newInstance("//Object");
      List xlist = xpath.selectNodes(root);

      Iterator iter = xlist.iterator();
      while (iter.hasNext()) {

        Map map = new HashMap();

        Element item = (Element) iter.next();

        String userRef = item.getAttribute("ref").getValue();
        String userName = item.getAttribute("refObjectName").getValue();
        String userObjectId = item.getChildText("ObjectID");

        map.put("userRef", userRef);
        map.put("userObjectId", userObjectId);
        map.put("userName", userName);

        list.add(map);
      }

    } catch (Exception ex) {
      log.error("", ex);
    }

    return list;
  }
 public CFSecurityTSecGroupBuff[] readBuffByTenantVisIdx(
     CFSecurityAuthorization Authorization, long TenantId, boolean IsVisible) {
   final String S_ProcName = "readBuffByTenantVisIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql = "exec sp_read_tsecgrp_by_tenantvisidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?";
     if (stmtReadBuffByTenantVisIdx == null) {
       stmtReadBuffByTenantVisIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByTenantVisIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByTenantVisIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByTenantVisIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByTenantVisIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByTenantVisIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByTenantVisIdx.setLong(argIdx++, TenantId);
     if (IsVisible) {
       stmtReadBuffByTenantVisIdx.setString(argIdx++, "Y");
     } else {
       stmtReadBuffByTenantVisIdx.setString(argIdx++, "N");
     }
     resultSet = stmtReadBuffByTenantVisIdx.executeQuery();
     List<CFSecurityTSecGroupBuff> buffList = new LinkedList<CFSecurityTSecGroupBuff>();
     while (resultSet.next()) {
       CFSecurityTSecGroupBuff buff = unpackTSecGroupResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecurityTSecGroupBuff[] retBuff = new CFSecurityTSecGroupBuff[buffList.size()];
     Iterator<CFSecurityTSecGroupBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFSecurityISOLanguageBuff[] readBuffByCode2Idx(
     CFSecurityAuthorization Authorization, String ISO6391Code) {
   final String S_ProcName = "readBuffByCode2Idx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_iso_lang_by_code2idx( ?, ?, ?, ?, ?" + ", " + "?" + " )";
     if (stmtReadBuffByCode2Idx == null) {
       stmtReadBuffByCode2Idx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCode2Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByCode2Idx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByCode2Idx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     if (ISO6391Code != null) {
       stmtReadBuffByCode2Idx.setString(argIdx++, ISO6391Code);
     } else {
       stmtReadBuffByCode2Idx.setNull(argIdx++, java.sql.Types.VARCHAR);
     }
     resultSet = stmtReadBuffByCode2Idx.executeQuery();
     List<CFSecurityISOLanguageBuff> buffList = new LinkedList<CFSecurityISOLanguageBuff>();
     while (resultSet.next()) {
       CFSecurityISOLanguageBuff buff = unpackISOLanguageResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecurityISOLanguageBuff[] retBuff = new CFSecurityISOLanguageBuff[buffList.size()];
     Iterator<CFSecurityISOLanguageBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
Beispiel #21
0
 public boolean down() {
   for (Iterator<DarkChannel> i = chls.iterator(); i.hasNext(); ) {
     DarkChannel ch = i.next();
     if (ch.chan == sel) {
       if (i.hasNext()) {
         select(i.next().chan);
         return (true);
       } else {
         return (false);
       }
     }
   }
   return (false);
 }
 public CFBamAccessFrequencyBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql = "CALL sp_read_accfreq_all( ?, ?, ?, ?, ? )";
     if (stmtReadAllBuff == null) {
       stmtReadAllBuff = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadAllBuff.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadAllBuff.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     resultSet = stmtReadAllBuff.executeQuery();
     List<CFBamAccessFrequencyBuff> buffList = new LinkedList<CFBamAccessFrequencyBuff>();
     while (resultSet.next()) {
       CFBamAccessFrequencyBuff buff = unpackAccessFrequencyResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFBamAccessFrequencyBuff[] retBuff = new CFBamAccessFrequencyBuff[buffList.size()];
     Iterator<CFBamAccessFrequencyBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public void minimizeMemory() {
   allSecDevice = null;
   indexByUserIdx = null;
   List<ICFSecuritySecDeviceObj> toForget = new LinkedList<ICFSecuritySecDeviceObj>();
   ICFSecuritySecDeviceObj cur = null;
   Iterator<ICFSecuritySecDeviceObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     toForget.add(cur);
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
 public void minimizeMemory() {
   allTax = null;
   indexByTenantIdx = null;
   indexByUNameIdx = null;
   List<ICFAccTaxObj> toForget = new LinkedList<ICFAccTaxObj>();
   ICFAccTaxObj cur = null;
   Iterator<ICFAccTaxObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     toForget.add(cur);
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
 public void minimizeMemory() {
   allDataScope = null;
   indexByUNameIdx = null;
   List<ICFBamDataScopeObj> toForget = new LinkedList<ICFBamDataScopeObj>();
   ICFBamDataScopeObj cur = null;
   Iterator<ICFBamDataScopeObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
 public void minimizeMemory() {
   allISOCountry = null;
   indexByISOCodeIdx = null;
   indexByNameIdx = null;
   List<ICFSecurityISOCountryObj> toForget = new LinkedList<ICFSecurityISOCountryObj>();
   ICFSecurityISOCountryObj cur = null;
   Iterator<ICFSecurityISOCountryObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
 public void minimizeMemory() {
   allMemo = null;
   indexByTenantIdx = null;
   indexByMemoContactIdx = null;
   indexByUDescrIdx = null;
   List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
   ICFCrmMemoObj cur = null;
   Iterator<ICFCrmMemoObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
Beispiel #28
0
  public List getProjectList() {
    List<Map> list = new ArrayList<Map>();

    try {

      String apiUrl = rallyApiHost + "/project?" + "fetch=true&order=Name&start=1&pagesize=200";

      log.info("rallyApiUrl:" + apiUrl);

      String responseXML = getRallyXML(apiUrl);

      org.jdom.input.SAXBuilder bSAX = new org.jdom.input.SAXBuilder();
      org.jdom.Document doc = bSAX.build(new StringReader(responseXML));
      Element root = doc.getRootElement();

      XPath xpath = XPath.newInstance("//Object");
      List xlist = xpath.selectNodes(root);

      Iterator iter = xlist.iterator();
      while (iter.hasNext()) {

        Map map = new HashMap();

        Element item = (Element) iter.next();
        String objId = item.getChildText("ObjectID");
        String name = item.getChildText("Name");
        String state = item.getChildText("State");

        map.put("objId", objId);
        map.put("name", name);
        map.put("state", state);

        list.add(map);
      }

    } catch (Exception ex) {
      log.error("ERROR: ", ex);
    }

    return list;
  }
 public void minimizeMemory() {
   allSecGroupInclude = null;
   indexByClusterIdx = null;
   indexByGroupIdx = null;
   indexByIncludeIdx = null;
   indexByUIncludeIdx = null;
   List<ICFSecuritySecGroupIncludeObj> toForget = new LinkedList<ICFSecuritySecGroupIncludeObj>();
   ICFSecuritySecGroupIncludeObj cur = null;
   Iterator<ICFSecuritySecGroupIncludeObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
 public void deleteSecGroupIncludeByIncludeIdx(long ClusterId, int IncludeGroupId) {
   CFSecuritySecGroupIncludeByIncludeIdxKey key =
       ((ICFInternetSchema) schema.getBackingStore())
           .getFactorySecGroupInclude()
           .newIncludeIdxKey();
   key.setRequiredClusterId(ClusterId);
   key.setRequiredIncludeGroupId(IncludeGroupId);
   if (indexByIncludeIdx == null) {
     indexByIncludeIdx =
         new HashMap<
             CFSecuritySecGroupIncludeByIncludeIdxKey,
             Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj>>();
   }
   if (indexByIncludeIdx.containsKey(key)) {
     Map<CFSecuritySecGroupIncludePKey, ICFSecuritySecGroupIncludeObj> dict =
         indexByIncludeIdx.get(key);
     ((ICFInternetSchema) schema.getBackingStore())
         .getTableSecGroupInclude()
         .deleteSecGroupIncludeByIncludeIdx(schema.getAuthorization(), ClusterId, IncludeGroupId);
     Iterator<ICFSecuritySecGroupIncludeObj> iter = dict.values().iterator();
     ICFSecuritySecGroupIncludeObj obj;
     List<ICFSecuritySecGroupIncludeObj> toForget =
         new LinkedList<ICFSecuritySecGroupIncludeObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByIncludeIdx.remove(key);
   } else {
     ((ICFInternetSchema) schema.getBackingStore())
         .getTableSecGroupInclude()
         .deleteSecGroupIncludeByIncludeIdx(schema.getAuthorization(), ClusterId, IncludeGroupId);
   }
 }