public ListIterator<ICFLibAnyObj> enumerateDetails(MssCFGenContext genContext) { final String S_ProcName = "CFAsteriskMssCFIterateTenantTSecGroup.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 ICFAsteriskTenantObj) { Iterator<ICFSecurityTSecGroupObj> elements = ((ICFAsteriskTenantObj) genDef).getOptionalComponentsTSecGroup().iterator(); while (elements.hasNext()) { list.add(elements.next()); } } else { throw CFLib.getDefaultExceptionFactory() .newUnsupportedClassException( getClass(), S_ProcName, "genContext.getGenDef()", genDef, "ICFAsteriskTenantObj"); } return (list.listIterator()); }
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 CFSecurityTenantBuff[] 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 = "exec sp_read_tenant_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<CFSecurityTenantBuff> buffList = new LinkedList<CFSecurityTenantBuff>(); while (resultSet.next()) { CFSecurityTenantBuff buff = unpackTenantResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFSecurityTenantBuff[] retBuff = new CFSecurityTenantBuff[buffList.size()]; Iterator<CFSecurityTenantBuff> 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; } } }