/** * loads a resource from the properties file * * @param key * @return */ public static String getBundleString(String key) { SetupBundle(); return bundle.getString(key); }
public static String GenerateSubscriptionLink(String property) { SetupBundle(); return String.format(bundle.getString("AlertingSettings"), property); //return "You are currently subscribed to receive email alerts for this service. <a href=\"" + property + "/alertingSettings.jsp\">Click here</a> to manage your subscriptions."; }
public static String GenerateManageLink(String uri, String baseurl) { SetupBundle(); return String.format(bundle.getString("ManageLink"), baseurl, URLEncoder.encode(uri)); //"<a href=\"" + baseurl + "/manage.jsp?url=" + URLEncoder.encode(uri) + "\">Manage this policy</a>"; }
@Deprecated public static InternetAddress[] GetAllfgsmsAdminsEmailAddressNotPooled() { SetupBundle(); Connection con = Utility.getConfigurationDB_NONPOOLED_Connection(); InternetAddress[] sp = getAllfgsmsAdminsEmailAddress(con); DBUtils.safeClose(con); return sp; }
/** * used by qpid agents * * @param uRI * @return */ @Deprecated public static ServicePolicy LoadPolicyNotPooled(String uRI) { SetupBundle(); Connection con = Utility.getConfigurationDB_NONPOOLED_Connection(); ServicePolicy sp = loadPolicy(con, uRI); DBUtils.safeClose(con); return sp; }
/** * Loads a policy using a caching mechanism, used by DCS and DAS if the * policy does not exist, it will NOT be created * * @param uRI * @return */ public static ServicePolicy LoadPolicyPooled(String uRI) { SetupBundle(); Connection con = Utility.getConfigurationDBConnection(); ServicePolicy sp = loadPolicy(con, uRI); try { con.close(); } catch (SQLException ex) { log.log(Level.WARN, bundle.getString("ErrorClosingDB"), ex); } return sp; }
/** * This function loads all of the Email properties from the database * * @param config * @return */ private static Properties loadSLAProperties(Connection config) { SetupBundle(); Properties p = new Properties(); PreparedStatement com = null; ResultSet rs = null; try { if (config == null) { return p; } com = config.prepareStatement("Select * from mail;"); rs = com.executeQuery(); while (rs.next()) { p.put(rs.getString("property"), rs.getString("valuecol")); } } catch (SQLException ex) { log.log(Level.WARN, bundle.getString("ErrorLoadingSendMailSettings"), ex); } catch (Exception ex) { log.log(Level.WARN, bundle.getString("ErrorUncaughtException"), ex); } finally { DBUtils.safeClose(rs); DBUtils.safeClose(com); } return p; }
/** * Returns a list of user's email addresses that are subscribed to a * specific SLA with email actions * * @param guid * @return */ @Deprecated public static InternetAddress[] GetSubscribersNotPooled(String guid) { SetupBundle(); Connection con = Utility.getConfigurationDB_NONPOOLED_Connection(); InternetAddress[] sp = getSubscribers(con, guid); DBUtils.safeClose(con); return sp; }
public static InternetAddress[] GetAllfgsmsAdminsEmailAddressPooled() { SetupBundle(); Connection con = Utility.getConfigurationDBConnection(); InternetAddress[] sp = getAllfgsmsAdminsEmailAddress(con); DBUtils.safeClose(con); return sp; }
SetupBundle(); PreparedStatement cmd =null; ResultSet rs = null;
public static void AlertUserSLASubscribed(String subscribersUsername, List<String> subscribersEmail, SetAlertRegistrationsRequestMsg request, boolean pooled) { SetupBundle(); try {
/** * Returns a list of user's email addresses that are subscribed to a * specific SLA with email actions * * @param guid * @return */ public static InternetAddress[] GetSubscribersPooled(String guid) { SetupBundle(); Connection con = Utility.getConfigurationDBConnection(); InternetAddress[] sp = getSubscribers(con, guid); DBUtils.safeClose(con); return sp; }
/** * used by NT SLA for web services * * @return either an empty list, or a list containing service policies that * contain SLA's */ public static List<ServicePolicy> LoadServicePoliciesPooled() { SetupBundle(); Connection con = Utility.getConfigurationDBConnection(); List<ServicePolicy> r = null; try { r = loadServicePolicies(con); } catch (Exception ex) { log.log(Level.ERROR, bundle.getString("ErrorLoadingPolicy"), ex); } finally { DBUtils.safeClose(con); } if (r == null) { r = new ArrayList<ServicePolicy>(); } return r; }
/** * used by NT SLA for web services * * @return */ public static List<ServicePolicy> LoadServicePoliciesNotPooled() { Connection con = Utility.getConfigurationDB_NONPOOLED_Connection(); SetupBundle(); List<ServicePolicy> r = null; try { r = loadServicePolicies(con); } catch (Exception ex) { log.log(Level.ERROR, bundle.getString("ErrorLoadingPolicy"), ex); } finally { DBUtils.safeClose(con); } if (r == null) { r = new ArrayList<ServicePolicy>(); } return r; }
/** * used by Federation Scheduler for publication * * @return either an empty list, or a list containing service policies that * contain SLA's */ public static List<ServicePolicy> LoadFederationServicePoliciesPooled() { SetupBundle(); Connection con = Utility.getConfigurationDBConnection(); List<ServicePolicy> r = null; try { r = loadServicePoliciesWithFederation(con); } catch (Exception ex) { log.log(Level.ERROR, bundle.getString("ErrorLoadingPolicy"), ex); } finally { DBUtils.safeClose(con); } if (r == null) { r = new ArrayList<ServicePolicy>(); } return r; }
return; SetupBundle(); ProcessPolicy pp = locateRecord(pol, machineData.getUri()); if (pp == null) {
SetupBundle(); ServicePolicy pol = SLACommon.getPolicy(uri, pooled); if (pol == null || pol.getServiceLevelAggrements() == null
String incidentid, boolean pooled, boolean sendtoAdminsOnly, List<SLAAction> slaActionBaseType, String SLAID, ServicePolicy t, AlertType at) { SetupBundle(); if (slaActionBaseType == null || slaActionBaseType.isEmpty()) { log.log(Level.WARN, bundle.getString("ErrorNullSLAAlert"));
SetupBundle(); if (pooled) { pol = LoadPolicyPooled(req.getBrokerURI());