List of usage examples for java.util ArrayList listIterator
public ListIterator<E> listIterator()
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSybase.CFAsteriskSybaseConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByClusterIdx(CFSecurityAuthorization Authorization, long ClusterId) { final String S_ProcName = "readDerivedByClusterIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w .ja va 2s. co m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_read_conf_file_cc_by_clusteridx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtReadClassCodeByClusterIdx == null) { stmtReadClassCodeByClusterIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByClusterIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByClusterIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, ClusterId); resultSet = stmtReadClassCodeByClusterIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskPgSql.CFAsteriskPgSqlConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByClusterIdx(CFSecurityAuthorization Authorization, long ClusterId) { final String S_ProcName = "readDerivedByClusterIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w . j a v a2 s .c om ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "SELECT * FROM " + schema.getLowerDbSchemaName() + ".sp_read_conf_file_cc_by_clusteridx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadClassCodeByClusterIdx == null) { stmtReadClassCodeByClusterIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByClusterIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByClusterIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, ClusterId); resultSet = stmtReadClassCodeByClusterIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskDb2LUW.CFAsteriskDb2LUWConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByHostIdx(CFSecurityAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//w ww . j av a 2s. c om ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_conf_file_cc_by_hostidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstSybase.CFAstSybaseConfigurationFileTable.java
public CFAstConfigurationFileBuff[] readDerivedByHostIdx(CFAstAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from w w w . ja v a 2s. co m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_read_conf_file_cc_by_hostidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAstConfigurationFileBuff> resultList = new LinkedList<CFAstConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAstConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAstAsteriskConfBuff[] subList = schema.getTableAsteriskConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAstSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAstExtensionsConfBuff[] subList = schema.getTableExtensionsConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAstVoicemailConfBuff[] subList = schema.getTableVoicemailConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAstExtConfigConfBuff[] subList = schema.getTableExtConfigConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAstConfigurationFileBuff[] retBuff = new CFAstConfigurationFileBuff[resultList.size()]; Iterator<CFAstConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_1.CFAstPgSql.CFAstPgSqlConfigurationFileTable.java
public CFAstConfigurationFileBuff[] readDerivedByHostIdx(CFAstAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/* w ww .java2s.c o m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "SELECT * FROM " + schema.getLowerDbSchemaName() + ".sp_read_conf_file_cc_by_hostidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAstConfigurationFileBuff> resultList = new LinkedList<CFAstConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAstConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAstAsteriskConfBuff[] subList = schema.getTableAsteriskConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAstSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAstExtensionsConfBuff[] subList = schema.getTableExtensionsConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAstVoicemailConfBuff[] subList = schema.getTableVoicemailConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAstExtConfigConfBuff[] subList = schema.getTableExtConfigConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAstConfigurationFileBuff[] retBuff = new CFAstConfigurationFileBuff[resultList.size()]; Iterator<CFAstConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstMSSql.CFAstMSSqlConfigurationFileTable.java
public CFAstConfigurationFileBuff[] readDerivedByHostIdx(CFAstAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w . jav a2 s .c om ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "{ call sp_read_conf_file_cc_by_hostidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ) }"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); if (resultSet != null) { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAstConfigurationFileBuff> resultList = new LinkedList<CFAstConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAstConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAstAsteriskConfBuff[] subList = schema.getTableAsteriskConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAstSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAstExtensionsConfBuff[] subList = schema.getTableExtensionsConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAstVoicemailConfBuff[] subList = schema.getTableVoicemailConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAstExtConfigConfBuff[] subList = schema.getTableExtConfigConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAstConfigurationFileBuff[] retBuff = new CFAstConfigurationFileBuff[resultList.size()]; Iterator<CFAstConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMSSql.CFAsteriskMSSqlConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByClusterIdx(CFSecurityAuthorization Authorization, long ClusterId) { final String S_ProcName = "readDerivedByClusterIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*w ww. ja v a 2 s .com*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "{ call sp_read_conf_file_cc_by_clusteridx( ?, ?, ?, ?, ?" + ", " + "?" + " ) }"; if (stmtReadClassCodeByClusterIdx == null) { stmtReadClassCodeByClusterIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByClusterIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByClusterIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByClusterIdx.setLong(argIdx++, ClusterId); resultSet = stmtReadClassCodeByClusterIdx.executeQuery(); if (resultSet != null) { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByClusterIdx(Authorization, ClusterId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSybase.CFAsteriskSybaseConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByHostIdx(CFSecurityAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }//from w w w.j a v a 2s .c o m ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_read_conf_file_cc_by_hostidx ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskPgSql.CFAsteriskPgSqlConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByHostIdx(CFSecurityAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/* w ww. j a v a2 s. c o m*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "SELECT * FROM " + schema.getLowerDbSchemaName() + ".sp_read_conf_file_cc_by_hostidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " )"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskMSSql.CFAsteriskMSSqlConfigurationFileTable.java
public CFAsteriskConfigurationFileBuff[] readDerivedByHostIdx(CFSecurityAuthorization Authorization, long ClusterId, long HostNodeId) { final String S_ProcName = "readDerivedByHostIdx"; if (!schema.isTransactionOpen()) { throw CFLib.getDefaultExceptionFactory().newUsageException(getClass(), S_ProcName, "Transaction not open"); }/*from ww w.ja v a 2 s . com*/ ArrayList<String> classCodeList = new ArrayList<String>(); String classCode; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "{ call sp_read_conf_file_cc_by_hostidx( ?, ?, ?, ?, ?" + ", " + "?" + ", " + "?" + " ) }"; if (stmtReadClassCodeByHostIdx == null) { stmtReadClassCodeByHostIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadClassCodeByHostIdx.setString(argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); stmtReadClassCodeByHostIdx.setLong(argIdx++, ClusterId); stmtReadClassCodeByHostIdx.setLong(argIdx++, HostNodeId); resultSet = stmtReadClassCodeByHostIdx.executeQuery(); if (resultSet != null) { while (resultSet.next()) { classCode = resultSet.getString(1); classCodeList.add(classCode); } } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(getClass(), S_ProcName, e); } finally { if (resultSet != null) { try { resultSet.close(); } catch (SQLException e) { } resultSet = null; } } List<CFAsteriskConfigurationFileBuff> resultList = new LinkedList<CFAsteriskConfigurationFileBuff>(); ListIterator<String> classCodeIter = classCodeList.listIterator(); while (classCodeIter.hasNext()) { classCode = classCodeIter.next(); if (classCode.equals("CONF")) { CFAsteriskConfigurationFileBuff[] subList = readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CASC")) { CFAsteriskAsteriskConfBuff[] subList = schema.getTableAsteriskConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CSIP")) { CFAsteriskSipConfBuff[] subList = schema.getTableSipConf().readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CEXT")) { CFAsteriskExtensionsConfBuff[] subList = schema.getTableExtensionsConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CVOM")) { CFAsteriskVoicemailConfBuff[] subList = schema.getTableVoicemailConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else if (classCode.equals("CECC")) { CFAsteriskExtConfigConfBuff[] subList = schema.getTableExtConfigConf() .readBuffByHostIdx(Authorization, ClusterId, HostNodeId); for (int subListIdx = 0; subListIdx < subList.length; subListIdx++) { resultList.add(subList[subListIdx]); } } else { throw CFLib.getDefaultExceptionFactory().newRuntimeException(getClass(), S_ProcName, "Did not expect ClassCode \"" + classCode + "\""); } } int idx = 0; CFAsteriskConfigurationFileBuff[] retBuff = new CFAsteriskConfigurationFileBuff[resultList.size()]; Iterator<CFAsteriskConfigurationFileBuff> iter = resultList.iterator(); while (iter.hasNext()) { retBuff[idx++] = iter.next(); } return (retBuff); }