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 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 void deleteDomainBySubDomIdx(long TenantId, long SubDomainOfId) {
   CFInternetDomainBySubDomIdxKey key =
       ((ICFBamSchema) schema.getBackingStore()).getFactoryDomain().newSubDomIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredSubDomainOfId(SubDomainOfId);
   if (indexBySubDomIdx == null) {
     indexBySubDomIdx =
         new HashMap<
             CFInternetDomainBySubDomIdxKey,
             Map<CFInternetDomainBasePKey, ICFInternetDomainObj>>();
   }
   if (indexBySubDomIdx.containsKey(key)) {
     Map<CFInternetDomainBasePKey, ICFInternetDomainObj> dict = indexBySubDomIdx.get(key);
     ((ICFBamSchema) schema.getBackingStore())
         .getTableDomain()
         .deleteDomainBySubDomIdx(schema.getAuthorization(), TenantId, SubDomainOfId);
     Iterator<ICFInternetDomainObj> iter = dict.values().iterator();
     ICFInternetDomainObj obj;
     List<ICFInternetDomainObj> toForget = new LinkedList<ICFInternetDomainObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexBySubDomIdx.remove(key);
   } else {
     ((ICFBamSchema) schema.getBackingStore())
         .getTableDomain()
         .deleteDomainBySubDomIdx(schema.getAuthorization(), TenantId, SubDomainOfId);
   }
 }
 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 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 void forgetSecDeviceByUserIdx(UUID SecUserId) {
    if (indexByUserIdx == null) {
      return;
    }
    CFSecuritySecDeviceByUserIdxKey key =
        ((ICFAsteriskSchema) 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 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 CFSecurityISOLanguageBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFInternetRamISOLanguage.readAllDerived";
   CFSecurityISOLanguageBuff[] retList = new CFSecurityISOLanguageBuff[dictByPKey.values().size()];
   Iterator<CFSecurityISOLanguageBuff> iter = dictByPKey.values().iterator();
   int idx = 0;
   while (iter.hasNext()) {
     retList[idx++] = iter.next();
   }
   return (retList);
 }
 public CFSecuritySecGroupMemberBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFFreeSwitchRamSecGroupMember.readAllDerived";
   CFSecuritySecGroupMemberBuff[] retList =
       new CFSecuritySecGroupMemberBuff[dictByPKey.values().size()];
   Iterator<CFSecuritySecGroupMemberBuff> iter = dictByPKey.values().iterator();
   int idx = 0;
   while (iter.hasNext()) {
     retList[idx++] = iter.next();
   }
   return (retList);
 }
 public CFDbTestLoaderBehaviourBuff[] readAllDerived(CFSecurityAuthorization Authorization) {
   final String S_ProcName = "CFDbTestRamLoaderBehaviour.readAllDerived";
   CFDbTestLoaderBehaviourBuff[] retList =
       new CFDbTestLoaderBehaviourBuff[dictByPKey.values().size()];
   Iterator<CFDbTestLoaderBehaviourBuff> iter = dictByPKey.values().iterator();
   int idx = 0;
   while (iter.hasNext()) {
     retList[idx++] = iter.next();
   }
   return (retList);
 }
 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 =
         "SELECT * FROM "
             + 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());
     resultSet = stmtReadAllBuff.executeQuery();
     List<CFSecurityISOCountryLanguageBuff> buffList =
         new LinkedList<CFSecurityISOCountryLanguageBuff>();
     while (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 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 CFInternetTopDomainBuff[] readBuffByTldIdx(
     CFSecurityAuthorization Authorization, long TenantId, long TldId) {
   final String S_ProcName = "readBuffByTldIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     final String sql =
         "CALL sp_read_tdomdef_by_tldidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )";
     if (stmtReadBuffByTldIdx == null) {
       stmtReadBuffByTldIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByTldIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByTldIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByTldIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByTldIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByTldIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByTldIdx.setLong(argIdx++, TenantId);
     stmtReadBuffByTldIdx.setLong(argIdx++, TldId);
     resultSet = stmtReadBuffByTldIdx.executeQuery();
     List<CFInternetTopDomainBuff> buffList = new LinkedList<CFInternetTopDomainBuff>();
     while (resultSet.next()) {
       CFInternetTopDomainBuff buff = unpackTopDomainResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFInternetTopDomainBuff[] retBuff = new CFInternetTopDomainBuff[buffList.size()];
     Iterator<CFInternetTopDomainBuff> 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 setJavaFXDataCollection(Collection<ICFInternetTopDomainObj> value) {
   final String S_ProcName = "setJavaFXDataCollection";
   javafxDataCollection = value;
   observableListOfTopDomain = FXCollections.observableArrayList();
   if (javafxDataCollection != null) {
     Iterator<ICFInternetTopDomainObj> iter = javafxDataCollection.iterator();
     while (iter.hasNext()) {
       observableListOfTopDomain.add(iter.next());
     }
     observableListOfTopDomain.sort(compareTopDomainByQualName);
   }
   if (dataTable != null) {
     dataTable.setItems(observableListOfTopDomain);
     // 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 CFSecurityServiceBuff[] readDerivedByTypeIdx(
      CFSecurityAuthorization Authorization, int ServiceTypeId) {
    final String S_ProcName = "CFBamRamService.readDerivedByTypeIdx";
    CFSecurityServiceByTypeIdxKey key = schema.getFactoryService().newTypeIdxKey();
    key.setRequiredServiceTypeId(ServiceTypeId);

    CFSecurityServiceBuff[] recArray;
    if (dictByTypeIdx.containsKey(key)) {
      Map<CFSecurityServicePKey, CFSecurityServiceBuff> subdictTypeIdx = dictByTypeIdx.get(key);
      recArray = new CFSecurityServiceBuff[subdictTypeIdx.size()];
      Iterator<CFSecurityServiceBuff> iter = subdictTypeIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFSecurityServicePKey, CFSecurityServiceBuff> subdictTypeIdx =
          new HashMap<CFSecurityServicePKey, CFSecurityServiceBuff>();
      dictByTypeIdx.put(key, subdictTypeIdx);
      recArray = new CFSecurityServiceBuff[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 CFDbTestOptFullRangeBuff[] readDerivedByTenantIdx(
      CFSecurityAuthorization Authorization, long TenantId) {
    final String S_ProcName = "CFDbTestRamOptFullRange.readDerivedByTenantIdx";
    CFDbTestOptFullRangeByTenantIdxKey key = schema.getFactoryOptFullRange().newTenantIdxKey();
    key.setRequiredTenantId(TenantId);

    CFDbTestOptFullRangeBuff[] recArray;
    if (dictByTenantIdx.containsKey(key)) {
      Map<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff> subdictTenantIdx =
          dictByTenantIdx.get(key);
      recArray = new CFDbTestOptFullRangeBuff[subdictTenantIdx.size()];
      Iterator<CFDbTestOptFullRangeBuff> iter = subdictTenantIdx.values().iterator();
      int idx = 0;
      while (iter.hasNext()) {
        recArray[idx++] = iter.next();
      }
    } else {
      Map<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff> subdictTenantIdx =
          new HashMap<CFDbTestOptFullRangePKey, CFDbTestOptFullRangeBuff>();
      dictByTenantIdx.put(key, subdictTenantIdx);
      recArray = new CFDbTestOptFullRangeBuff[0];
    }
    return (recArray);
  }
 public void deleteISOLanguageByCode2Idx(
     CFSecurityAuthorization Authorization, CFSecurityISOLanguageByCode2IdxKey argKey) {
   CFSecurityISOLanguageBuff cur;
   LinkedList<CFSecurityISOLanguageBuff> matchSet = new LinkedList<CFSecurityISOLanguageBuff>();
   Iterator<CFSecurityISOLanguageBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFSecurityISOLanguageBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     deleteISOLanguage(Authorization, cur);
   }
 }
 public void deleteLoaderBehaviourByIdIdx(
     CFSecurityAuthorization Authorization, CFDbTestLoaderBehaviourPKey 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 void deleteSecGroupMemberByUUserIdx(
     CFSecurityAuthorization Authorization, CFSecuritySecGroupMemberByUUserIdxKey argKey) {
   CFSecuritySecGroupMemberBuff cur;
   LinkedList<CFSecuritySecGroupMemberBuff> matchSet =
       new LinkedList<CFSecuritySecGroupMemberBuff>();
   Iterator<CFSecuritySecGroupMemberBuff> values = dictByPKey.values().iterator();
   while (values.hasNext()) {
     cur = values.next();
     if (argKey.equals(cur)) {
       matchSet.add(cur);
     }
   }
   Iterator<CFSecuritySecGroupMemberBuff> iterMatch = matchSet.iterator();
   while (iterMatch.hasNext()) {
     cur = iterMatch.next();
     deleteSecGroupMember(Authorization, cur);
   }
 }
  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;
     }
   }
 }
  /**
   * The core evaluation of ColumnInOwnerRelation is also to determine if an index definition is in
   * an owner relation.
   *
   * <p>WORKING: Yes, I know. This should be a business method instead of copying the code in
   * ICFBamIndexObj and MSIsaGenBindColumnInOwnerRelation.
   *
   * @param genDef to be considered
   * @return True if the column participates in an owner relation.
   */
  public Boolean isColumnInOwnerRelation() {

    ICFLibAnyObj focusDef;
    ICFBamTableObj tableDef;
    final String S_ProcName = "isColumnInOwnerRelation() ";

    if (this instanceof ICFBamAtomObj) {
      ICFBamAtomObj atomDef = (ICFBamAtomObj) this;
      ICFLibAnyObj atomScopeDef = atomDef.getObjScope();
      tableDef = (ICFBamTableObj) atomScopeDef;
      focusDef = this;
    } else if (this instanceof ICFBamTableColObj) {
      ICFBamTableColObj tableColDef = (ICFBamTableColObj) this;
      ICFLibAnyObj tableColScopeDef = tableColDef.getObjScope();
      tableDef = (ICFBamTableObj) tableColScopeDef;
      focusDef = this;
    } else if (this instanceof ICFBamIndexColObj) {
      ICFBamIndexColObj indexColDef = (ICFBamIndexColObj) this;
      focusDef = indexColDef.getRequiredLookupColumn();
      if (focusDef instanceof ICFBamAtomObj) {
        tableDef = (ICFBamTableObj) ((ICFBamAtomObj) focusDef).getObjScope();
      } else if (focusDef instanceof ICFBamTableColObj) {
        tableDef = (ICFBamTableObj) ((ICFBamTableColObj) focusDef).getObjScope();
      } else {
        throw new RuntimeException(
            S_ProcName
                + "genContext.getGenDef().getColumnDef() for a ICFBamIndexColObj did not return a ICFBamAtomObj"
                + " nor a ICFBamTableColObj");
      }
    } else if (this instanceof ICFBamRelationColObj) {
      ICFBamRelationColObj relColDef = (ICFBamRelationColObj) this;
      ICFLibAnyObj columnDef = relColDef.getRequiredLookupFromCol();
      if (columnDef instanceof ICFBamAtomObj) {
        focusDef = columnDef;
        tableDef = (ICFBamTableObj) columnDef.getObjScope();
      } else if (columnDef instanceof ICFBamTableColObj) {
        focusDef = columnDef;
        tableDef = (ICFBamTableObj) columnDef.getObjScope();
      } else {
        throw new RuntimeException(
            S_ProcName
                + "genContext.getGenDef().getFromColumnDef() for a ICFBamIndexColObj did not return a ICFBamAtomObj"
                + " nor a ICFBamTableColObj");
      }
    } else {
      throw new RuntimeException(
          S_ProcName
              + "genContext.getGenDef() did not return a ICFBamAtomObj, ICFBamTableColObj, nor ICFBamIndexColObj instance");
    }

    List<ICFBamRelationObj> ownerRelations = tableDef.getContainerOwnerRelations();
    if ((ownerRelations == null) || ((ownerRelations != null) && (ownerRelations.size() == 0))) {
      return (false);
    }

    ListIterator<ICFBamRelationObj> ownerEnumerator = ownerRelations.listIterator();

    ICFBamRelationObj ownerRelation;
    ICFBamRelationColObj ownerRelationCol;
    Iterator<ICFBamRelationColObj> ownerRelationCols;

    while (ownerEnumerator.hasNext()) {

      ownerRelation = ownerEnumerator.next();
      ownerRelationCols = ownerRelation.getOptionalComponentsColumns().iterator();

      while (ownerRelationCols.hasNext()) {
        ownerRelationCol = ownerRelationCols.next();
        if (ownerRelationCol.getRequiredLookupFromCol() == focusDef) {
          return (true);
        }
      }
    }

    return (false);
  }
 public List<ICFSecuritySecDeviceObj> readSecDeviceByUserIdx(UUID SecUserId, boolean forceRead) {
   final String S_ProcName = "readSecDeviceByUserIdx";
   CFSecuritySecDeviceByUserIdxKey key =
       ((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newUserIdxKey();
   key.setRequiredSecUserId(SecUserId);
   Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> dict;
   if (indexByUserIdx == null) {
     indexByUserIdx =
         new HashMap<
             CFSecuritySecDeviceByUserIdxKey,
             Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj>>();
   }
   if ((!forceRead) && indexByUserIdx.containsKey(key)) {
     dict = indexByUserIdx.get(key);
   } else {
     dict = new HashMap<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj>();
     // Allow other threads to dirty-read while we're loading
     indexByUserIdx.put(key, dict);
     ICFSecuritySecDeviceObj obj;
     CFSecuritySecDeviceBuff[] buffList =
         ((ICFAsteriskSchema) schema.getBackingStore())
             .getTableSecDevice()
             .readDerivedByUserIdx(schema.getAuthorization(), SecUserId);
     CFSecuritySecDeviceBuff buff;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = schema.getSecDeviceTableObj().newInstance();
       obj.setPKey(((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newPKey());
       obj.setBuff(buff);
       ICFSecuritySecDeviceObj realized = (ICFSecuritySecDeviceObj) obj.realize();
     }
   }
   Comparator<ICFSecuritySecDeviceObj> cmp =
       new Comparator<ICFSecuritySecDeviceObj>() {
         public int compare(ICFSecuritySecDeviceObj lhs, ICFSecuritySecDeviceObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFSecuritySecDevicePKey lhsPKey = lhs.getPKey();
             CFSecuritySecDevicePKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = dict.size();
   ICFSecuritySecDeviceObj arr[] = new ICFSecuritySecDeviceObj[len];
   Iterator<ICFSecuritySecDeviceObj> 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<ICFSecuritySecDeviceObj> arrayList = new ArrayList<ICFSecuritySecDeviceObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFSecuritySecDeviceObj> sortedList = arrayList;
   return (sortedList);
 }
 public CFFreeSwitchFSSFProfileDomainBuff[] readDerivedByUNameIdx(
     CFSecurityAuthorization Authorization,
     long argTenantId,
     long argFSSFProfileId,
     String argName) {
   final String S_ProcName = "readDerivedByUNameIdx";
   String rqst =
       CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPreamble()
           + "\n"
           + "\t"
           + CFFreeSwitchXMsgFSSFProfileDomainMessageFormatter
               .formatFSSFProfileDomainRqstReadByUNameIdx(
                   "\n\t\t\t", argTenantId, argFSSFProfileId, argName)
           + "\n"
           + CFFreeSwitchXMsgSchemaMessageFormatter.formatRqstXmlPostamble();
   try {
     schema.getCFTipClientHandler().issueAppRequest(rqst);
   } catch (BadPaddingException e) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(), S_ProcName, "Caught BadPaddingException - " + e.getMessage(), e);
   } catch (IllegalBlockSizeException e) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(), S_ProcName, "Caught IllegalBlockSizeException - " + e.getMessage(), e);
   } catch (InvalidKeyException e) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(), S_ProcName, "Caught InvalidKeyException - " + e.getMessage(), e);
   } catch (NoSuchAlgorithmException e) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(), S_ProcName, "Caught NoSuchAlgorithmException - " + e.getMessage(), e);
   } catch (InvalidAlgorithmParameterException e) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(),
             S_ProcName,
             "Caught InvalidAlgorithmParameterException - " + e.getMessage(),
             e);
   } catch (NoSuchPaddingException e) {
     throw CFLib.getDefaultExceptionFactory()
         .newRuntimeException(
             getClass(), S_ProcName, "Caught NoSuchPaddingException - " + e.getMessage(), e);
   }
   ICFTipResponseHandler responseHandler = schema.getCFTipClientHandler().getResponseHandler();
   CFLibRuntimeException exceptionRaised = responseHandler.getExceptionRaised();
   if (exceptionRaised != null) {
     throw exceptionRaised;
   }
   Object sortedListObj = responseHandler.getListOfObjects();
   @SuppressWarnings("unchecked")
   List<ICFFreeSwitchFSSFProfileDomainObj> sortedList =
       (List<ICFFreeSwitchFSSFProfileDomainObj>) sortedListObj;
   CFFreeSwitchFSSFProfileDomainBuff arr[];
   if (sortedList != null) {
     int sz = sortedList.size();
     arr = new CFFreeSwitchFSSFProfileDomainBuff[sz];
     Iterator<ICFFreeSwitchFSSFProfileDomainObj> iter = sortedList.iterator();
     ICFFreeSwitchFSSFProfileDomainObj cur;
     for (int idx = 0; idx < sz; idx++) {
       cur = (ICFFreeSwitchFSSFProfileDomainObj) iter.next();
       arr[idx] = cur.getFSSFProfileDomainBuff();
     }
   } else {
     arr = new CFFreeSwitchFSSFProfileDomainBuff[0];
   }
   return (arr);
 }
  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 List<ICFSecuritySecDeviceObj> readAllSecDevice(boolean forceRead) {
   final String S_ProcName = "readAllSecDevice";
   if ((allSecDevice == null) || forceRead) {
     Map<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj> map =
         new HashMap<CFSecuritySecDevicePKey, ICFSecuritySecDeviceObj>();
     allSecDevice = map;
     CFSecuritySecDeviceBuff[] buffList =
         ((ICFAsteriskSchema) schema.getBackingStore())
             .getTableSecDevice()
             .readAllDerived(schema.getAuthorization());
     CFSecuritySecDeviceBuff buff;
     ICFSecuritySecDeviceObj obj;
     for (int idx = 0; idx < buffList.length; idx++) {
       buff = buffList[idx];
       obj = newInstance();
       obj.setPKey(((ICFAsteriskSchema) schema.getBackingStore()).getFactorySecDevice().newPKey());
       obj.setBuff(buff);
       ICFSecuritySecDeviceObj realized = (ICFSecuritySecDeviceObj) obj.realize();
     }
   }
   Comparator<ICFSecuritySecDeviceObj> cmp =
       new Comparator<ICFSecuritySecDeviceObj>() {
         public int compare(ICFSecuritySecDeviceObj lhs, ICFSecuritySecDeviceObj rhs) {
           if (lhs == null) {
             if (rhs == null) {
               return (0);
             } else {
               return (-1);
             }
           } else if (rhs == null) {
             return (1);
           } else {
             CFSecuritySecDevicePKey lhsPKey = lhs.getPKey();
             CFSecuritySecDevicePKey rhsPKey = rhs.getPKey();
             int ret = lhsPKey.compareTo(rhsPKey);
             return (ret);
           }
         }
       };
   int len = allSecDevice.size();
   ICFSecuritySecDeviceObj arr[] = new ICFSecuritySecDeviceObj[len];
   Iterator<ICFSecuritySecDeviceObj> valIter = allSecDevice.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<ICFSecuritySecDeviceObj> arrayList = new ArrayList<ICFSecuritySecDeviceObj>(len);
   for (idx = 0; idx < len; idx++) {
     arrayList.add(arr[idx]);
   }
   List<ICFSecuritySecDeviceObj> sortedList = arrayList;
   return (sortedList);
 }