public List<ICFAccTaxObj> readAllTax(boolean forceRead) {
   final String S_ProcName = "readAllTax";
   if ((allTax == null) || forceRead) {
     Map<CFAccTaxPKey, ICFAccTaxObj> map = new HashMap<CFAccTaxPKey, ICFAccTaxObj>();
     allTax = map;
     CFAccTaxBuff[] buffList =
         ((ICFAccSchema) schema.getBackingStore())
             .getTableTax()
             .readAllDerived(schema.getAuthorization());
     CFAccTaxBuff buff;
     ICFAccTaxObj obj;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = newInstance();
       obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newPKey());
       obj.setBuff(buff);
       ICFAccTaxObj realized = (ICFAccTaxObj) obj.realize();
     }
   }
   Comparator<ICFAccTaxObj> cmp =
       new Comparator<ICFAccTaxObj>() {
         public int compare(ICFAccTaxObj lhs, ICFAccTaxObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFAccTaxPKey lhsPKey = lhs.getPKey();
             CFAccTaxPKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = allTax.size();
   ICFAccTaxObj arr[] = new ICFAccTaxObj[len];
   Iterator<ICFAccTaxObj> valIter = allTax.values().iterator();
   int idx = 0;
   while ((idx < len) && valIter.hasNext()) {
     arr[idx++] = valIter.next();
   }
   if (idx < len) {
     throw CFLib.getDefaultExceptionFactory()
         .newArgumentUnderflowException(getClass(), S_ProcName, 0, "idx", idx, len);
   } else if (valIter.hasNext()) {
     throw CFLib.getDefaultExceptionFactory()
         .newArgumentOverflowException(getClass(), S_ProcName, 0, "idx", idx, len);
   }
   Arrays.sort(arr, cmp);
   ArrayList<ICFAccTaxObj> arrayList = new ArrayList<ICFAccTaxObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFAccTaxObj> sortedList = arrayList;
   return (sortedList);
 }
  public void forgetTSecGroupMemberByUserIdx(UUID SecUserId) {
    if (indexByUserIdx == null) {
      return;
    }
    CFSecurityTSecGroupMemberByUserIdxKey key =
        ((ICFCrmSchema) schema.getBackingStore()).getFactoryTSecGroupMember().newUserIdxKey();
    key.setRequiredSecUserId(SecUserId);
    if (indexByUserIdx.containsKey(key)) {
      Map<CFSecurityTSecGroupMemberPKey, ICFSecurityTSecGroupMemberObj> mapUserIdx =
          indexByUserIdx.get(key);
      if (mapUserIdx != null) {
        List<ICFSecurityTSecGroupMemberObj> toForget =
            new LinkedList<ICFSecurityTSecGroupMemberObj>();
        ICFSecurityTSecGroupMemberObj cur = null;
        Iterator<ICFSecurityTSecGroupMemberObj> 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 deleteSecDeviceByUserIdx(UUID SecUserId) {
   CFSecuritySecDeviceByUserIdxKey key =
       ((ICFAsteriskSchema) 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);
     ((ICFAsteriskSchema) 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 {
     ((ICFAsteriskSchema) schema.getBackingStore())
         .getTableSecDevice()
         .deleteSecDeviceByUserIdx(schema.getAuthorization(), SecUserId);
   }
 }
  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 forgetSecAppByClusterIdx(long ClusterId) {
    if (indexByClusterIdx == null) {
      return;
    }
    CFSecuritySecAppByClusterIdxKey key =
        ((ICFCrmSchema) schema.getBackingStore()).getFactorySecApp().newClusterIdxKey();
    key.setRequiredClusterId(ClusterId);
    if (indexByClusterIdx.containsKey(key)) {
      Map<CFSecuritySecAppPKey, ICFSecuritySecAppObj> mapClusterIdx = indexByClusterIdx.get(key);
      if (mapClusterIdx != null) {
        List<ICFSecuritySecAppObj> toForget = new LinkedList<ICFSecuritySecAppObj>();
        ICFSecuritySecAppObj cur = null;
        Iterator<ICFSecuritySecAppObj> iter = mapClusterIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByClusterIdx.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);
   }
 }
  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 ListIterator<ICFLibAnyObj> enumerateDetails(MssCFGenContext genContext) {
    final String S_ProcName = "CFFreeSwitchMssCFIterateFSSFConferenceProfile.enumerateDetails() ";

    if (genContext == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), S_ProcName, 1, "genContext");
    }

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), S_ProcName, 1, "genContext.getGenDef()");
    }

    List<ICFLibAnyObj> list = new LinkedList<ICFLibAnyObj>();

    if (genDef instanceof ICFFreeSwitchFSSFConferenceObj) {
      Iterator<ICFFreeSwitchFSSFConferenceProfileObj> elements =
          ((ICFFreeSwitchFSSFConferenceObj) genDef).getOptionalComponentsProfile().iterator();
      while (elements.hasNext()) {
        list.add(elements.next());
      }
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newUnsupportedClassException(
              getClass(),
              S_ProcName,
              "genContext.getGenDef()",
              genDef,
              "ICFFreeSwitchFSSFConferenceObj");
    }

    return (list.listIterator());
  }
  public CFSecuritySecGroupMemberBuff[] readDerivedByGroupIdx(
      CFSecurityAuthorization Authorization, long ClusterId, int SecGroupId) {
    final String S_ProcName = "CFFreeSwitchRamSecGroupMember.readDerivedByGroupIdx";
    CFSecuritySecGroupMemberByGroupIdxKey key = schema.getFactorySecGroupMember().newGroupIdxKey();
    key.setRequiredClusterId(ClusterId);
    key.setRequiredSecGroupId(SecGroupId);

    CFSecuritySecGroupMemberBuff[] recArray;
    if (dictByGroupIdx.containsKey(key)) {
      Map<CFSecuritySecGroupMemberPKey, CFSecuritySecGroupMemberBuff> subdictGroupIdx =
          dictByGroupIdx.get(key);
      recArray = new CFSecuritySecGroupMemberBuff[subdictGroupIdx.size()];
      Iterator<CFSecuritySecGroupMemberBuff> iter = subdictGroupIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFSecuritySecGroupMemberPKey, CFSecuritySecGroupMemberBuff> subdictGroupIdx =
          new HashMap<CFSecuritySecGroupMemberPKey, CFSecuritySecGroupMemberBuff>();
      dictByGroupIdx.put(key, subdictGroupIdx);
      recArray = new CFSecuritySecGroupMemberBuff[0];
    }
    return (recArray);
  }
  public ListIterator<ICFLibAnyObj> enumerateDetails(MssCFGenContext genContext) {
    final String S_ProcName = "CFInternetMssCFIterateSecUserSecProxy.enumerateDetails() ";

    if (genContext == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), S_ProcName, 1, "genContext");
    }

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), S_ProcName, 1, "genContext.getGenDef()");
    }

    List<ICFLibAnyObj> list = new LinkedList<ICFLibAnyObj>();

    if (genDef instanceof ICFInternetSecUserObj) {
      Iterator<ICFSecuritySecSessionObj> elements =
          ((ICFInternetSecUserObj) genDef).getOptionalChildrenSecProxy().iterator();
      while (elements.hasNext()) {
        list.add(elements.next());
      }
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newUnsupportedClassException(
              getClass(), S_ProcName, "genContext.getGenDef()", genDef, "ICFInternetSecUserObj");
    }

    return (list.listIterator());
  }
 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;
     }
   }
 }
 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;
     }
   }
 }
 public CFAccFeeBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFAccRamFee.readAllDerived";
   CFAccFeeBuff[] retList = new CFAccFeeBuff[dictByPKey.values().size()];
   Iterator<CFAccFeeBuff> iter = dictByPKey.values().iterator();
   int idx = 0;
   while (iter.hasNext()) {
     retList[idx++] = iter.next();
   }
   return (retList);
 }
 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;
     }
   }
 }
 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 setJavaFXDataCollection(Collection<ICFAccFeeObj> value) {
   final String S_ProcName = "setJavaFXDataCollection";
   javafxDataCollection = value;
   observableListOfFee = FXCollections.observableArrayList();
   if (javafxDataCollection != null) {
     Iterator<ICFAccFeeObj> iter = javafxDataCollection.iterator();
     while (iter.hasNext()) {
       observableListOfFee.add(iter.next());
     }
     observableListOfFee.sort(compareFeeByQualName);
   }
   if (dataTable != null) {
     dataTable.setItems(observableListOfFee);
     // Hack from stackoverflow to fix JavaFX TableView refresh issue
     ((TableColumn) dataTable.getColumns().get(0)).setVisible(false);
     ((TableColumn) dataTable.getColumns().get(0)).setVisible(true);
   }
 }
 public void deleteUuidDefByContPrevIdx(
     CFSecurityAuthorization Authorization, CFBamValueByContPrevIdxKey argKey) {
   final String S_ProcName = "deleteUuidDefByContPrevIdx";
   CFBamUuidDefBuff cur;
   LinkedList<CFBamUuidDefBuff> matchSet = new LinkedList<CFBamUuidDefBuff>();
   Iterator<CFBamUuidDefBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFBamUuidDefBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     String subClassCode = cur.getClassCode();
     if ("UIDD".equals(subClassCode)) {
       schema.getTableUuidDef().deleteUuidDef(Authorization, cur);
     } else if ("UIDC".equals(subClassCode)) {
       schema.getTableUuidCol().deleteUuidCol(Authorization, (CFBamUuidColBuff) cur);
     } else if ("UIDT".equals(subClassCode)) {
       schema.getTableUuidType().deleteUuidType(Authorization, (CFBamUuidTypeBuff) cur);
     } else if ("IGUU".equals(subClassCode)) {
       schema.getTableUuidGen().deleteUuidGen(Authorization, (CFBamUuidGenBuff) cur);
     } else {
       throw CFLib.getDefaultExceptionFactory()
           .newUnsupportedClassException(
               getClass(),
               S_ProcName,
               "subClassCode",
               cur,
               "Instance of or subclass of UuidDef must not be \"" + subClassCode + "\"");
     }
   }
 }
  public CFAccFeeBuff[] readDerivedByTenantIdx(
      CFSecurityAuthorization Authorization, long TenantId) {
    final String S_ProcName = "CFAccRamFee.readDerivedByTenantIdx";
    CFAccFeeByTenantIdxKey key = schema.getFactoryFee().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);

    CFAccFeeBuff[] recArray;
    if (dictByTenantIdx.containsKey(key)) {
      Map<CFAccFeePKey, CFAccFeeBuff> subdictTenantIdx = dictByTenantIdx.get(key);
      recArray = new CFAccFeeBuff[subdictTenantIdx.size()];
      Iterator<CFAccFeeBuff> iter = subdictTenantIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFAccFeePKey, CFAccFeeBuff> subdictTenantIdx = new HashMap<CFAccFeePKey, CFAccFeeBuff>();
      dictByTenantIdx.put(key, subdictTenantIdx);
      recArray = new CFAccFeeBuff[0];
    }
    return (recArray);
  }
  public CFSecuritySecDeviceBuff[] readDerivedByUserIdx(
      CFSecurityAuthorization Authorization, UUID SecUserId) {
    final String S_ProcName = "CFAsteriskRamSecDevice.readDerivedByUserIdx";
    CFSecuritySecDeviceByUserIdxKey key = schema.getFactorySecDevice().newUserIdxKey();
    key.setRequiredSecUserId(SecUserId);

    CFSecuritySecDeviceBuff[] recArray;
    if (dictByUserIdx.containsKey(key)) {
      Map<CFSecuritySecDevicePKey, CFSecuritySecDeviceBuff> subdictUserIdx = dictByUserIdx.get(key);
      recArray = new CFSecuritySecDeviceBuff[subdictUserIdx.size()];
      Iterator<CFSecuritySecDeviceBuff> iter = subdictUserIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFSecuritySecDevicePKey, CFSecuritySecDeviceBuff> subdictUserIdx =
          new HashMap<CFSecuritySecDevicePKey, CFSecuritySecDeviceBuff>();
      dictByUserIdx.put(key, subdictUserIdx);
      recArray = new CFSecuritySecDeviceBuff[0];
    }
    return (recArray);
  }
  public CFSecurityISOLanguageBuff[] readDerivedByCode2Idx(
      CFSecurityAuthorization Authorization, String ISO6391Code) {
    final String S_ProcName = "CFInternetRamISOLanguage.readDerivedByCode2Idx";
    CFSecurityISOLanguageByCode2IdxKey key = schema.getFactoryISOLanguage().newCode2IdxKey();
    key.setOptionalISO6391Code(ISO6391Code);

    CFSecurityISOLanguageBuff[] recArray;
    if (dictByCode2Idx.containsKey(key)) {
      Map<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff> subdictCode2Idx =
          dictByCode2Idx.get(key);
      recArray = new CFSecurityISOLanguageBuff[subdictCode2Idx.size()];
      Iterator<CFSecurityISOLanguageBuff> iter = subdictCode2Idx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff> subdictCode2Idx =
          new HashMap<CFSecurityISOLanguagePKey, CFSecurityISOLanguageBuff>();
      dictByCode2Idx.put(key, subdictCode2Idx);
      recArray = new CFSecurityISOLanguageBuff[0];
    }
    return (recArray);
  }
 public void deleteFeeByIdIdx(CFSecurityAuthorization Authorization, CFAccFeePKey argKey) {
   CFAccFeeBuff cur;
   LinkedList<CFAccFeeBuff> matchSet = new LinkedList<CFAccFeeBuff>();
   Iterator<CFAccFeeBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFAccFeeBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     deleteFee(Authorization, cur);
   }
 }
 public void deleteLoaderBehaviourByUNameIdx(
     CFSecurityAuthorization Authorization, CFDbTestLoaderBehaviourByUNameIdxKey argKey) {
   CFDbTestLoaderBehaviourBuff cur;
   LinkedList<CFDbTestLoaderBehaviourBuff> matchSet =
       new LinkedList<CFDbTestLoaderBehaviourBuff>();
   Iterator<CFDbTestLoaderBehaviourBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFDbTestLoaderBehaviourBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     deleteLoaderBehaviour(Authorization, cur);
   }
 }
 public List<ICFAccTaxObj> readTaxByTenantIdx(long TenantId, boolean forceRead) {
   final String S_ProcName = "readTaxByTenantIdx";
   CFAccTaxByTenantIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newTenantIdxKey();
   key.setRequiredTenantId(TenantId);
   Map<CFAccTaxPKey, ICFAccTaxObj> dict;
   if (indexByTenantIdx == null) {
     indexByTenantIdx = new HashMap<CFAccTaxByTenantIdxKey, Map<CFAccTaxPKey, ICFAccTaxObj>>();
   }
   if ((!forceRead) && indexByTenantIdx.containsKey(key)) {
     dict = indexByTenantIdx.get(key);
   } else {
     dict = new HashMap<CFAccTaxPKey, ICFAccTaxObj>();
     // Allow other threads to dirty-read while we're loading
     indexByTenantIdx.put(key, dict);
     ICFAccTaxObj obj;
     CFAccTaxBuff[] buffList =
         ((ICFAccSchema) schema.getBackingStore())
             .getTableTax()
             .readDerivedByTenantIdx(schema.getAuthorization(), TenantId);
     CFAccTaxBuff buff;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = schema.getTaxTableObj().newInstance();
       obj.setPKey(((ICFAccSchema) schema.getBackingStore()).getFactoryTax().newPKey());
       obj.setBuff(buff);
       ICFAccTaxObj realized = (ICFAccTaxObj) obj.realize();
     }
   }
   Comparator<ICFAccTaxObj> cmp =
       new Comparator<ICFAccTaxObj>() {
         public int compare(ICFAccTaxObj lhs, ICFAccTaxObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFAccTaxPKey lhsPKey = lhs.getPKey();
             CFAccTaxPKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = dict.size();
   ICFAccTaxObj arr[] = new ICFAccTaxObj[len];
   Iterator<ICFAccTaxObj> valIter = dict.values().iterator();
   int idx = 0;
   while ((idx < len) && valIter.hasNext()) {
     arr[idx++] = valIter.next();
   }
   if (idx < len) {
     throw CFLib.getDefaultExceptionFactory()
         .newArgumentUnderflowException(getClass(), S_ProcName, 0, "idx", idx, len);
   } else if (valIter.hasNext()) {
     throw CFLib.getDefaultExceptionFactory()
         .newArgumentOverflowException(getClass(), S_ProcName, 0, "idx", idx, len);
   }
   Arrays.sort(arr, cmp);
   ArrayList<ICFAccTaxObj> arrayList = new ArrayList<ICFAccTaxObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFAccTaxObj> sortedList = arrayList;
   return (sortedList);
 }
 public CFAccFeeDetailBuff[] readBuffByFeeIdx(
     CFSecurityAuthorization Authorization, long TenantId, long FeeId) {
   final String S_ProcName = "readBuffByFeeIdx";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadBuffByFeeIdx = null;
   List<CFAccFeeDetailBuff> buffList = new LinkedList<CFAccFeeDetailBuff>();
   try {
     stmtReadBuffByFeeIdx =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_feedtlbyfeeidx( ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtReadBuffByFeeIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtReadBuffByFeeIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByFeeIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByFeeIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByFeeIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByFeeIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByFeeIdx.setLong(argIdx++, TenantId);
     stmtReadBuffByFeeIdx.setLong(argIdx++, FeeId);
     stmtReadBuffByFeeIdx.execute();
     resultSet = (ResultSet) stmtReadBuffByFeeIdx.getObject(1);
     if (resultSet != null) {
       try {
         while (resultSet.next()) {
           CFAccFeeDetailBuff buff = unpackFeeDetailResultSetToBuff(resultSet);
           buffList.add(buff);
         }
         try {
           resultSet.close();
         } catch (SQLException e) {
         }
         resultSet = null;
       } catch (SQLException e) {
       }
     }
     int idx = 0;
     CFAccFeeDetailBuff[] retBuff = new CFAccFeeDetailBuff[buffList.size()];
     Iterator<CFAccFeeDetailBuff> 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;
     }
     if (stmtReadBuffByFeeIdx != null) {
       try {
         stmtReadBuffByFeeIdx.close();
       } catch (SQLException e) {
       }
       stmtReadBuffByFeeIdx = null;
     }
   }
 }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFBamXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstTZTimeTypeReadAll");

      CFBamXMsgRqstHandler xmsgRqstHandler = (CFBamXMsgRqstHandler) getParser();
      if (xmsgRqstHandler == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()");
      }

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFBamSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
      if (schemaObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()");
      }

      // Extract Attributes
      numAttrs = attrs.getLength();
      for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
        attrLocalName = attrs.getLocalName(idxAttr);
        if (attrLocalName.equals("Id")) {
          if (attrId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("schemaLocation")) {
          // ignored
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newUnrecognizedAttributeException(
                  getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName);
        }
      }

      // Save named attributes to context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Read the objects and prepare the response XML
      List<ICFBamTZTimeTypeObj> list = schemaObj.getTZTimeTypeTableObj().readAllTZTimeType(true);
      String responseOpening =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgTZTimeTypeMessageFormatter.formatTZTimeTypeRspnListOpenTag();
      xmsgRqstHandler.appendResponse(responseOpening);
      Iterator<ICFBamTZTimeTypeObj> iter = list.iterator();
      ICFBamTZTimeTypeObj cur;
      String subxml;
      while (iter.hasNext()) {
        cur = iter.next();
        subxml =
            CFBamXMsgTZTimeTypeMessageFormatter.formatTZTimeTypeRspnDerivedRec(
                "\n\t\t", cur.getTZTimeTypeBuff());
        xmsgRqstHandler.appendResponse(subxml);
      }
      String responseClosing =
          "\n"
              + "\t"
              + CFBamXMsgTZTimeTypeMessageFormatter.formatTZTimeTypeRspnListCloseTag()
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFBamXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      String attrTenantId = null;
      String attrScopeId = null;
      String attrPrevId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstNmTokenTypeReadByContPrevIdx");

      CFBamXMsgRqstHandler xmsgRqstHandler = (CFBamXMsgRqstHandler) getParser();
      if (xmsgRqstHandler == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser()");
      }

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFBamSchemaObj schemaObj = xmsgRqstHandler.getSchemaObj();
      if (schemaObj == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "getParser().getSchemaObj()");
      }

      // Extract Attributes
      numAttrs = attrs.getLength();
      for (idxAttr = 0; idxAttr < numAttrs; idxAttr++) {
        attrLocalName = attrs.getLocalName(idxAttr);
        if (attrLocalName.equals("Id")) {
          if (attrId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("TenantId")) {
          if (attrTenantId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrTenantId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("ScopeId")) {
          if (attrScopeId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrScopeId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("PrevId")) {
          if (attrPrevId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrPrevId = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("schemaLocation")) {
          // ignored
        } else {
          throw CFLib.getDefaultExceptionFactory()
              .newUnrecognizedAttributeException(
                  getClass(), S_ProcName, getParser().getLocationInfo(), attrLocalName);
        }
      }

      // Ensure that required attributes have values
      if ((attrTenantId == null) || (attrTenantId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "TenantId");
      }
      if ((attrScopeId == null) || (attrScopeId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "ScopeId");
      }

      // Save named attributes to context
      CFLibXmlCoreContext curContext = getParser().getCurContext();
      // Convert string attributes to native Java types
      // and apply the converted attributes to the editBuff.

      long natTenantId;
      natTenantId = Long.parseLong(attrTenantId);

      long natScopeId;
      natScopeId = Long.parseLong(attrScopeId);

      Long natPrevId;
      if ((attrPrevId == null) || (attrPrevId.length() <= 0)) {
        natPrevId = null;
      } else {
        natPrevId = new Long(Long.parseLong(attrPrevId));
      }

      // Read the objects
      List<ICFBamNmTokenTypeObj> list =
          schemaObj
              .getNmTokenTypeTableObj()
              .readNmTokenTypeByContPrevIdx(natTenantId, natScopeId, natPrevId);
      String responseOpening =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgValueMessageFormatter.formatValueRspnListOpenTag();
      xmsgRqstHandler.appendResponse(responseOpening);
      Iterator<ICFBamNmTokenTypeObj> iter = list.iterator();
      ICFBamNmTokenTypeObj cur;
      String subxml;
      while (iter.hasNext()) {
        cur = iter.next();
        subxml =
            CFBamXMsgValueMessageFormatter.formatValueRspnDerivedRec("\n\t\t", cur.getValueBuff());
        xmsgRqstHandler.appendResponse(subxml);
      }
      String responseClosing =
          "\n"
              + "\t"
              + CFBamXMsgValueMessageFormatter.formatValueRspnListCloseTag()
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFBamXMsgRqstHandler xmsgRqstHandler = ((CFBamXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFBamXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }
 public CFSecurityAuditActionBuff[] readAllBuff(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "readAllBuff";
   if (!schema.isTransactionOpen()) {
     throw CFLib.getDefaultExceptionFactory()
         .newUsageException(getClass(), S_ProcName, "Transaction not open");
   }
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadAllBuff = null;
   try {
     CFSecurityAuditActionBuff buff = null;
     List<CFSecurityAuditActionBuff> buffList = new LinkedList<CFSecurityAuditActionBuff>();
     stmtReadAllBuff =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_auditactionall( ?, ?, ?, ?, ?, ? ) ); end;");
     int argIdx = 1;
     stmtReadAllBuff.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     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());
     stmtReadAllBuff.execute();
     resultSet = (ResultSet) stmtReadAllBuff.getObject(1);
     if (resultSet != null) {
       try {
         while (resultSet.next()) {
           buff = unpackAuditActionResultSetToBuff(resultSet);
           buffList.add(buff);
         }
       } catch (SQLException e) {
         // Oracle may return an invalid resultSet if the rowset is empty
       }
     }
     int idx = 0;
     CFSecurityAuditActionBuff[] retBuff = new CFSecurityAuditActionBuff[buffList.size()];
     Iterator<CFSecurityAuditActionBuff> 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;
     }
     if (stmtReadAllBuff != null) {
       try {
         stmtReadAllBuff.close();
       } catch (SQLException e) {
       }
       stmtReadAllBuff = null;
     }
   }
 }