public ListIterator<ICFLibAnyObj> enumerateDetails(MssCFGenContext genContext) {
    final String S_ProcName = "CFCrmMssCFIterateTenantCtcList.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 ICFCrmTenantObj) {
      Iterator<ICFCrmContactListObj> elements =
          ((ICFCrmTenantObj) genDef).getOptionalComponentsCtcList().iterator();
      while (elements.hasNext()) {
        list.add(elements.next());
      }
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newUnsupportedClassException(
              getClass(), S_ProcName, "genContext.getGenDef()", genDef, "ICFCrmTenantObj");
    }

    return (list.listIterator());
  }
 public void deleteMemoByMemoContactIdx(long TenantId, long ContactId) {
   CFCrmMemoByMemoContactIdxKey key =
       ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
   key.setRequiredTenantId(TenantId);
   key.setRequiredContactId(ContactId);
   if (indexByMemoContactIdx == null) {
     indexByMemoContactIdx =
         new HashMap<CFCrmMemoByMemoContactIdxKey, Map<CFCrmMemoPKey, ICFCrmMemoObj>>();
   }
   if (indexByMemoContactIdx.containsKey(key)) {
     Map<CFCrmMemoPKey, ICFCrmMemoObj> dict = indexByMemoContactIdx.get(key);
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByMemoContactIdx(schema.getAuthorization(), TenantId, ContactId);
     Iterator<ICFCrmMemoObj> iter = dict.values().iterator();
     ICFCrmMemoObj obj;
     List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
     while (iter.hasNext()) {
       obj = iter.next();
       toForget.add(obj);
     }
     iter = toForget.iterator();
     while (iter.hasNext()) {
       obj = iter.next();
       obj.forget(true);
     }
     indexByMemoContactIdx.remove(key);
   } else {
     ((ICFAccSchema) schema.getBackingStore())
         .getTableMemo()
         .deleteMemoByMemoContactIdx(schema.getAuthorization(), TenantId, ContactId);
   }
 }
  public void forgetMemoByMemoContactIdx(long TenantId, long ContactId) {
    if (indexByMemoContactIdx == null) {
      return;
    }
    CFCrmMemoByMemoContactIdxKey key =
        ((ICFAccSchema) schema.getBackingStore()).getFactoryMemo().newMemoContactIdxKey();
    key.setRequiredTenantId(TenantId);
    key.setRequiredContactId(ContactId);
    if (indexByMemoContactIdx.containsKey(key)) {
      Map<CFCrmMemoPKey, ICFCrmMemoObj> mapMemoContactIdx = indexByMemoContactIdx.get(key);
      if (mapMemoContactIdx != null) {
        List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
        ICFCrmMemoObj cur = null;
        Iterator<ICFCrmMemoObj> iter = mapMemoContactIdx.values().iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          toForget.add(cur);
        }
        iter = toForget.iterator();
        while (iter.hasNext()) {
          cur = iter.next();
          cur.forget(true);
        }
      }

      indexByMemoContactIdx.remove(key);
    }
  }
 public CFSecuritySecDeviceBuff[] readBuffByUserIdx(
     CFSecurityAuthorization Authorization, UUID SecUserId) {
   final String S_ProcName = "readBuffByUserIdx";
   ResultSet resultSet = null;
   try {
     Connection cnx = schema.getCnx();
     String sql =
         "SELECT * FROM "
             + schema.getLowerDbSchemaName()
             + ".sp_read_secdev_by_useridx( ?, ?, ?, ?, ?"
             + ", "
             + "?"
             + " )";
     if (stmtReadBuffByUserIdx == null) {
       stmtReadBuffByUserIdx = cnx.prepareStatement(sql);
     }
     int argIdx = 1;
     stmtReadBuffByUserIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUserIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByUserIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByUserIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByUserIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByUserIdx.setString(argIdx++, SecUserId.toString());
     resultSet = stmtReadBuffByUserIdx.executeQuery();
     List<CFSecuritySecDeviceBuff> buffList = new LinkedList<CFSecuritySecDeviceBuff>();
     while (resultSet.next()) {
       CFSecuritySecDeviceBuff buff = unpackSecDeviceResultSetToBuff(resultSet);
       buffList.add(buff);
     }
     int idx = 0;
     CFSecuritySecDeviceBuff[] retBuff = new CFSecuritySecDeviceBuff[buffList.size()];
     Iterator<CFSecuritySecDeviceBuff> iter = buffList.iterator();
     while (iter.hasNext()) {
       retBuff[idx++] = iter.next();
     }
     return (retBuff);
   } catch (SQLException e) {
     throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e);
   } finally {
     if (resultSet != null) {
       try {
         resultSet.close();
       } catch (SQLException e) {
       }
       resultSet = null;
     }
   }
 }
 public CFSecurityISOCountryBuff[] 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 sp_read_iso_cntry_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<CFSecurityISOCountryBuff> buffList = new LinkedList<CFSecurityISOCountryBuff>();
     if (resultSet != null) {
       while (resultSet.next()) {
         CFSecurityISOCountryBuff buff = unpackISOCountryResultSetToBuff(resultSet);
         buffList.add(buff);
       }
     }
     int idx = 0;
     CFSecurityISOCountryBuff[] retBuff = new CFSecurityISOCountryBuff[buffList.size()];
     Iterator<CFSecurityISOCountryBuff> 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 =
         "{ call 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>();
     if (resultSet != null) {
       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 void minimizeMemory() {
   allMemo = null;
   indexByTenantIdx = null;
   indexByMemoContactIdx = null;
   indexByUDescrIdx = null;
   List<ICFCrmMemoObj> toForget = new LinkedList<ICFCrmMemoObj>();
   ICFCrmMemoObj cur = null;
   Iterator<ICFCrmMemoObj> iter = members.values().iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     if (cur.getEdit() == null) {
       toForget.add(cur);
     }
   }
   iter = toForget.iterator();
   while (iter.hasNext()) {
     cur = iter.next();
     cur.forget();
   }
 }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFAccXMsgSchemaMessageFormatter 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("RqstProjectBaseReadAll");

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

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFAccSchemaObj 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<ICFInternetProjectBaseObj> list =
          schemaObj.getProjectBaseTableObj().readAllProjectBase(true);
      String responseOpening =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFAccXMsgProjectBaseMessageFormatter.formatProjectBaseRspnListOpenTag();
      xmsgRqstHandler.appendResponse(responseOpening);
      Iterator<ICFInternetProjectBaseObj> iter = list.iterator();
      ICFInternetProjectBaseObj cur;
      String subxml;
      while (iter.hasNext()) {
        cur = iter.next();
        subxml =
            CFAccXMsgProjectBaseMessageFormatter.formatProjectBaseRspnDerivedRec(
                "\n\t\t", cur.getProjectBaseBuff());
        xmsgRqstHandler.appendResponse(subxml);
      }
      String responseClosing =
          "\n"
              + "\t"
              + CFAccXMsgProjectBaseMessageFormatter.formatProjectBaseRspnListCloseTag()
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
      CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFAccXMsgRqstHandler xmsgRqstHandler = ((CFAccXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFAccXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }
 public CFSecuritySecGroupBuff[] readBuffByClusterIdx(
     CFSecurityAuthorization Authorization, long ClusterId) {
   final String S_ProcName = "readBuffByClusterIdx";
   ResultSet resultSet = null;
   Connection cnx = schema.getCnx();
   CallableStatement stmtReadBuffByClusterIdx = null;
   List<CFSecuritySecGroupBuff> buffList = new LinkedList<CFSecuritySecGroupBuff>();
   try {
     stmtReadBuffByClusterIdx =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_secgrpbyclusteridx( ?, ?, ?, ?, ?, ?"
                 + ", "
                 + "?"
                 + " ); end;");
     int argIdx = 1;
     stmtReadBuffByClusterIdx.registerOutParameter(argIdx++, OracleTypes.CURSOR);
     stmtReadBuffByClusterIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByClusterIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString());
     stmtReadBuffByClusterIdx.setString(
         argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString());
     stmtReadBuffByClusterIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId());
     stmtReadBuffByClusterIdx.setLong(
         argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId());
     stmtReadBuffByClusterIdx.setLong(argIdx++, ClusterId);
     stmtReadBuffByClusterIdx.execute();
     resultSet = (ResultSet) stmtReadBuffByClusterIdx.getObject(1);
     if (resultSet != null) {
       try {
         while (resultSet.next()) {
           CFSecuritySecGroupBuff buff = unpackSecGroupResultSetToBuff(resultSet);
           buffList.add(buff);
         }
         try {
           resultSet.close();
         } catch (SQLException e) {
         }
         resultSet = null;
       } catch (SQLException e) {
       }
     }
     int idx = 0;
     CFSecuritySecGroupBuff[] retBuff = new CFSecuritySecGroupBuff[buffList.size()];
     Iterator<CFSecuritySecGroupBuff> 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 (stmtReadBuffByClusterIdx != null) {
       try {
         stmtReadBuffByClusterIdx.close();
       } catch (SQLException e) {
       }
       stmtReadBuffByClusterIdx = null;
     }
   }
 }
 public CFSecuritySecGroupBuff[] 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 {
     CFSecuritySecGroupBuff buff = null;
     List<CFSecuritySecGroupBuff> buffList = new LinkedList<CFSecuritySecGroupBuff>();
     stmtReadAllBuff =
         cnx.prepareCall(
             "begin "
                 + schema.getLowerDbSchemaName()
                 + ".rd_secgrpall( ?, ?, ?, ?, ?, ? ) ); 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 = unpackSecGroupResultSetToBuff(resultSet);
           buffList.add(buff);
         }
       } catch (SQLException e) {
         // Oracle may return an invalid resultSet if the rowset is empty
       }
     }
     int idx = 0;
     CFSecuritySecGroupBuff[] retBuff = new CFSecuritySecGroupBuff[buffList.size()];
     Iterator<CFSecuritySecGroupBuff> 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;
     }
   }
 }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    try {
      // Common XML Attributes
      String attrId = null;
      String attrRevision = null;
      // ContactList Attributes
      String attrContactListId = null;
      String attrTenantId = null;
      String attrDescription = null;
      String attrStripDigits = null;
      String attrCreatedAt = null;
      String attrCreatedBy = null;
      String attrUpdatedAt = null;
      String attrUpdatedBy = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("ContactList");

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

      ICFAccSchemaObj schemaObj = xmsgRspnHandler.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("Revision")) {
          if (attrRevision != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrRevision = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("CreatedAt")) {
          if (attrCreatedAt != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrCreatedAt = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("CreatedBy")) {
          if (attrCreatedBy != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrCreatedBy = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("UpdatedAt")) {
          if (attrUpdatedAt != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrUpdatedAt = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("UpdatedBy")) {
          if (attrUpdatedBy != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrUpdatedBy = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("ContactListId")) {
          if (attrContactListId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrContactListId = 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("Description")) {
          if (attrDescription != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrDescription = attrs.getValue(idxAttr);
        } else if (attrLocalName.equals("StripDigits")) {
          if (attrStripDigits != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrStripDigits = 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 ((attrContactListId == null) || (attrContactListId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "ContactListId");
      }
      if ((attrTenantId == null) || (attrTenantId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "TenantId");
      }
      if (attrDescription == null) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "Description");
      }

      // Save named attributes to context
      CFLibXmlCoreContext curContext = xmsgRspnHandler.getCurContext();

      // Convert string attributes to native Java types

      long natContactListId = Long.parseLong(attrContactListId);

      long natTenantId = Long.parseLong(attrTenantId);

      String natDescription = attrDescription;

      Integer natStripDigits;
      if ((attrStripDigits == null) || (attrStripDigits.length() <= 0)) {
        natStripDigits = null;
      } else {
        natStripDigits = new Integer(Integer.parseInt(attrStripDigits));
      }

      int natRevision = Integer.parseInt(attrRevision);
      UUID createdBy = null;
      if (attrCreatedBy != null) {
        createdBy = UUID.fromString(attrCreatedBy);
      }
      Calendar createdAt = null;
      if (attrCreatedAt != null) {
        createdAt = CFLibXmlUtil.parseTimestamp(attrCreatedAt);
      }
      UUID updatedBy = null;
      if (attrUpdatedBy != null) {
        updatedBy = UUID.fromString(attrUpdatedBy);
      }
      Calendar updatedAt = null;
      if (attrUpdatedAt != null) {
        updatedAt = CFLibXmlUtil.parseTimestamp(attrUpdatedAt);
      }
      // Get the parent context
      CFLibXmlCoreContext parentContext = curContext.getPrevContext();
      // Instantiate a buffer for the parsed information
      ICFAccContactListObj obj =
          (ICFAccContactListObj) (schemaObj.getContactListTableObj().newInstance());
      CFCrmContactListBuff dataBuff = obj.getContactListBuff();
      dataBuff.setRequiredContactListId(natContactListId);
      dataBuff.setRequiredTenantId(natTenantId);
      dataBuff.setRequiredDescription(natDescription);
      dataBuff.setOptionalStripDigits(natStripDigits);
      dataBuff.setRequiredRevision(natRevision);
      if (createdBy != null) {
        dataBuff.setCreatedByUserId(createdBy);
      }
      if (createdAt != null) {
        dataBuff.setCreatedAt(createdAt);
      }
      if (updatedBy != null) {
        dataBuff.setUpdatedByUserId(updatedBy);
      }
      if (updatedAt != null) {
        dataBuff.setUpdatedAt(updatedAt);
      }
      obj.copyBuffToPKey();
      @SuppressWarnings("unchecked")
      List<ICFCrmContactListObj> list =
          (List<ICFCrmContactListObj>) xmsgRspnHandler.getListOfObjects();
      ICFCrmContactListObj realized = (ICFCrmContactListObj) obj.realize();
      xmsgRspnHandler.setLastObjectProcessed(realized);
      if (list != null) {
        list.add(realized);
      }
    } catch (RuntimeException e) {
      throw new RuntimeException(
          "Near "
              + getParser().getLocationInfo()
              + ": Caught and rethrew "
              + e.getClass().getName()
              + " - "
              + e.getMessage(),
          e);
    } catch (Error e) {
      throw new Error(
          "Near "
              + getParser().getLocationInfo()
              + ": Caught and rethrew "
              + e.getClass().getName()
              + " - "
              + e.getMessage(),
          e);
    }
  }
 public CFInternetRealProjectBuff[] readDerivedByTenantIdx(
     CFSecurityAuthorization Authorization, long argTenantId) {
   final String S_ProcName = "readDerivedByTenantIdx";
   String rqst =
       CFAccXMsgSchemaMessageFormatter.formatRqstXmlPreamble()
           + "\n"
           + "\t"
           + CFAccXMsgRealProjectMessageFormatter.formatRealProjectRqstReadByTenantIdx(
               "\n\t\t\t", argTenantId)
           + "\n"
           + CFAccXMsgSchemaMessageFormatter.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();
   if (sortedListObj == null) {
     throw CFLib.getDefaultExceptionFactory()
         .newNullArgumentException(getClass(), S_ProcName, 0, "responseHandler.getListOfObjects");
   }
   @SuppressWarnings("unchecked")
   List<ICFInternetDomainBaseObj> sortedList = (List<ICFInternetDomainBaseObj>) sortedListObj;
   int sz = sortedList.size();
   CFInternetRealProjectBuff arr[] = new CFInternetRealProjectBuff[sz];
   Iterator<ICFInternetDomainBaseObj> iter = sortedList.iterator();
   ICFInternetRealProjectObj cur;
   for (int idx = 0; idx < sz; idx++) {
     cur = (ICFInternetRealProjectObj) iter.next();
     arr[idx] = cur.getRealProjectBuff();
   }
   return (arr);
 }
  public void startElement(String uri, String localName, String qName, Attributes attrs)
      throws SAXException {
    CFCrmXMsgSchemaMessageFormatter schemaFormatter = null;
    try {
      // Common XML Attributes
      String attrId = null;
      String attrClusterId = null;
      // Attribute Extraction
      String attrLocalName;
      int numAttrs;
      int idxAttr;
      final String S_ProcName = "startElement";
      final String S_LocalName = "LocalName";

      assert qName.equals("RqstSecGroupReadByClusterIdx");

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

      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();

      ICFCrmSchemaObj 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("ClusterId")) {
          if (attrClusterId != null) {
            throw CFLib.getDefaultExceptionFactory()
                .newUniqueIndexViolationException(
                    getClass(), S_ProcName, S_LocalName, attrLocalName);
          }
          attrClusterId = 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 ((attrClusterId == null) || (attrClusterId.length() <= 0)) {
        throw CFLib.getDefaultExceptionFactory()
            .newNullArgumentException(getClass(), S_ProcName, 0, "ClusterId");
      }

      // 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 natClusterId;
      natClusterId = Long.parseLong(attrClusterId);

      // Read the objects
      List<ICFSecuritySecGroupObj> list =
          schemaObj.getSecGroupTableObj().readSecGroupByClusterIdx(natClusterId);
      String responseOpening =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFCrmXMsgSecGroupMessageFormatter.formatSecGroupRspnListOpenTag();
      xmsgRqstHandler.appendResponse(responseOpening);
      Iterator<ICFSecuritySecGroupObj> iter = list.iterator();
      ICFSecuritySecGroupObj cur;
      String subxml;
      while (iter.hasNext()) {
        cur = iter.next();
        subxml =
            CFCrmXMsgSecGroupMessageFormatter.formatSecGroupRspnDerivedRec(
                "\n\t\t", cur.getSecGroupBuff());
        xmsgRqstHandler.appendResponse(subxml);
      }
      String responseClosing =
          "\n"
              + "\t"
              + CFCrmXMsgSecGroupMessageFormatter.formatSecGroupRspnListCloseTag()
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.appendResponse(responseClosing);
    } catch (RuntimeException e) {
      CFCrmXMsgRqstHandler xmsgRqstHandler = ((CFCrmXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFCrmXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    } catch (Error e) {
      CFCrmXMsgRqstHandler xmsgRqstHandler = ((CFCrmXMsgRqstHandler) getParser());
      schemaFormatter = xmsgRqstHandler.getSchemaMessageFormatter();
      String response =
          schemaFormatter.formatRspnXmlPreamble()
              + "\n"
              + "\t"
              + CFCrmXMsgSchemaMessageFormatter.formatRspnException("\n\t\t\t", e)
              + "\n"
              + schemaFormatter.formatRspnXmlPostamble();
      xmsgRqstHandler.resetResponse();
      xmsgRqstHandler.appendResponse(response);
      xmsgRqstHandler.setCaughtException(true);
    }
  }