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 CFSecurityISOCountryCurrencyBuff[] 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_cntryccy_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<CFSecurityISOCountryCurrencyBuff> buffList = new LinkedList<CFSecurityISOCountryCurrencyBuff>(); if (resultSet != null) { while (resultSet.next()) { CFSecurityISOCountryCurrencyBuff buff = unpackISOCountryCurrencyResultSetToBuff(resultSet); buffList.add(buff); } } int idx = 0; CFSecurityISOCountryCurrencyBuff[] retBuff = new CFSecurityISOCountryCurrencyBuff[buffList.size()]; Iterator<CFSecurityISOCountryCurrencyBuff> 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 CFInternetURLProtocolBuff[] readBuffByIsSecureIdx( CFSecurityAuthorization Authorization, boolean IsSecure) { final String S_ProcName = "readBuffByIsSecureIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); final String sql = "CALL sp_read_urlproto_by_issecureidx( ?, ?, ?, ?, ?" + ", " + "?" + " )"; if (stmtReadBuffByIsSecureIdx == null) { stmtReadBuffByIsSecureIdx = cnx.prepareStatement(sql); } int argIdx = 1; stmtReadBuffByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIsSecureIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecUserId().toString()); stmtReadBuffByIsSecureIdx.setString( argIdx++, (Authorization == null) ? "" : Authorization.getSecSessionId().toString()); stmtReadBuffByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecClusterId()); stmtReadBuffByIsSecureIdx.setLong( argIdx++, (Authorization == null) ? 0 : Authorization.getSecTenantId()); if (IsSecure) { stmtReadBuffByIsSecureIdx.setString(argIdx++, "Y"); } else { stmtReadBuffByIsSecureIdx.setString(argIdx++, "N"); } resultSet = stmtReadBuffByIsSecureIdx.executeQuery(); List<CFInternetURLProtocolBuff> buffList = new LinkedList<CFInternetURLProtocolBuff>(); while (resultSet.next()) { CFInternetURLProtocolBuff buff = unpackURLProtocolResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFInternetURLProtocolBuff[] retBuff = new CFInternetURLProtocolBuff[buffList.size()]; Iterator<CFInternetURLProtocolBuff> 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 CFSecuritySecAppBuff[] readBuffByClusterIdx( CFSecurityAuthorization Authorization, long ClusterId) { final String S_ProcName = "readBuffByClusterIdx"; ResultSet resultSet = null; try { Connection cnx = schema.getCnx(); String sql = "exec sp_read_secapp_by_clusteridx ?, ?, ?, ?, ?" + ", " + "?"; if (stmtReadBuffByClusterIdx == null) { stmtReadBuffByClusterIdx = cnx.prepareStatement(sql); } int argIdx = 1; 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); resultSet = stmtReadBuffByClusterIdx.executeQuery(); List<CFSecuritySecAppBuff> buffList = new LinkedList<CFSecuritySecAppBuff>(); while (resultSet.next()) { CFSecuritySecAppBuff buff = unpackSecAppResultSetToBuff(resultSet); buffList.add(buff); } int idx = 0; CFSecuritySecAppBuff[] retBuff = new CFSecuritySecAppBuff[buffList.size()]; Iterator<CFSecuritySecAppBuff> 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 CFBamDataScopeBuff[] readAllDerived(CFSecurityAuthorization Authorization) { final String S_ProcName = "readAllDerived"; String rqst = CFBamXMsgSchemaMessageFormatter.formatRqstXmlPreamble() + "\n" + "\t" + CFBamXMsgDataScopeMessageFormatter.formatDataScopeRqstReadAll("\n\t\t\t") + "\n" + CFBamXMsgSchemaMessageFormatter.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<ICFBamDataScopeObj> sortedList = (List<ICFBamDataScopeObj>) sortedListObj; int sz = sortedList.size(); CFBamDataScopeBuff arr[] = new CFBamDataScopeBuff[sz]; Iterator<ICFBamDataScopeObj> iter = sortedList.iterator(); ICFBamDataScopeObj cur; for (int idx = 0; idx < sz; idx++) { cur = (ICFBamDataScopeObj) iter.next(); arr[idx] = cur.getDataScopeBuff(); } return (arr); }