private List<String> getProcessListByHostname(String hostname, String domainName) { List<String> r = new ArrayList<String>(); Connection con = Utility.getConfigurationDBConnection(); PreparedStatement com = null; ResultSet rs = null; try { com = con.prepareStatement("select uri from servicepolicies where hostname=? and domaincol=? and policytype=?;"); com.setString(1, hostname); com.setString(2, domainName); com.setInt(3, PolicyType.PROCESS.ordinal()); rs = com.executeQuery(); while (rs.next()) { r.add(rs.getString(1)); } } catch (Exception ex) { log.log(Level.ERROR, null, ex); } finally { DBUtils.safeClose(rs); DBUtils.safeClose(com); DBUtils.safeClose(con); } return r; }
com.setInt(1, PolicyType.STATUS.ordinal()); ResultSet rs = com.executeQuery(); while (rs.next()) { //for each service
com.setInt(1, PolicyType.MACHINE.ordinal()); com.setInt(2, PolicyType.PROCESS.ordinal()); rs = com.executeQuery(); while (rs.next()) { //for each service up.setLong(5, getAvgMem(rs.getString("uri"), periods.get(i), PerfCon)); up.setLong(6, getAvgThread(rs.getString("uri"), periods.get(i), PerfCon)); if (rs.getInt("policytype") == PolicyType.PROCESS.ordinal()) { up.setLong(7, getAvgFile(rs.getString("uri"), periods.get(i), PerfCon)); } else {
com.setLong(2, 500000); com.setBoolean(3, true); com.setInt(4, PolicyType.TRANSACTIONAL.ordinal()); TransactionalWebServicePolicy twp = new TransactionalWebServicePolicy(); twp.setURL(uri);
com.setInt(1, PolicyType.STATISTICAL.ordinal()); rs = com.executeQuery(); while (rs.next()) { //for each service
comm.setInt(1, PolicyType.PROCESS.ordinal()); comm.setString(2, hostname);
comm.setInt(1, PolicyType.MACHINE.ordinal()); comm.setString(2, hostname);
com.setInt(1, PolicyType.TRANSACTIONAL.ordinal()); rs = com.executeQuery(); while (rs.next()) {
com.setInt(1, PolicyType.TRANSACTIONAL.ordinal()); rs = com.executeQuery();
comm.setInt(6, policy.getPolicyType().ordinal()); if (policy instanceof TransactionalWebServicePolicy) { TransactionalWebServicePolicy tp = (TransactionalWebServicePolicy) policy;
com.setInt(1, PolicyType.MACHINE.ordinal()); com.setString(2, request.getDomain());