/** * wrapper that sets the policy type to Status * * @param currenstatus * @param name unique name of the thing we are checking * @param s current status message */ public static void TryUpdateStatus(boolean currenstatus, String name, String s, boolean pooled, String domain, String server, FLAGS flag) { TryUpdateStatus(currenstatus, name, s, pooled, PolicyType.STATUS, domain, server, null, flag); }
@Override public void Stop() { SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); SLAProcessorSingleton.setRunning(false); }
/** * Sets the status of an item wrapper, sets policy type to status, machine * name to the current machine name, and domain to unspecified, parent * component to null, policies are auto created * * @param currenstatus * @param name * @param s * @param pooled * @deprecatedwrap */ @Deprecated public static void TryUpdateStatus(boolean currenstatus, String name, String s, boolean pooled) { TryUpdateStatus(currenstatus, name, s, pooled, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName(), null, FLAGS.AUTO_CREATE); }
public static MachinePolicy ProcessMachineLevelSLAs(AddMachineAndProcessDataRequestMsg req, boolean pooled) { MachinePolicy mp = loadMachinePolicyPooled(req.getHostname()); AuxHelper.TryUpdateStatus(req.getMachineData().isOperationalstatus(), req.getMachineData().getUri(), req.getMachineData().getStatusmessage(), pooled, PolicyType.MACHINE, req.getDomainname(), req.getHostname()); processMachineSLAs(req, mp, pooled); return mp; }
/** * * connection must be to the configuration database and be open, remains * open after exiting * * @param uRI * @param con * @param pooled is not used by this function, but is passed along */ public static void CheckStatisticalPolicyAndCreate(String uRI, Connection con, boolean pooled, String domain, String server) { CheckPolicyAndCreate(uRI, con, PolicyType.STATISTICAL, pooled, domain, server, null); } }
@Override public void Start() { SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); SLAProcessorSingleton.setRunning(true); SLAProcessorSingleton.run(); }
@Override public int SizeOfQueue() { SLAProcessorSingleton instance = SLAProcessorSingleton.getInstance(); return SLAProcessorSingleton.GetQueueSize(); } }
public static long GrabInvocationRate(Duration x, String URL) { return GrabInvocationRate(RangeColumnName(x), URL); }
public static long GrabMTBF(Duration x, String URL) { return GrabMTBF(RangeColumnName(x), URL); }
public static long GrabFaultRate(Duration x, String URL) { return GrabFaultRate(RangeColumnName(x), URL); }
private List<ServicePolicy> Load(boolean pooled) { List<ServicePolicy> list = null; list = SLACommon.LoadServicePoliciesPooled(); return list; }
/** * loads a resource from the properties file * * @param key * @return */ public static String getBundleString(String key) { SetupBundle(); return bundle.getString(key); }
public static long GetMemoryUsageOverTime(String pol, Duration timerange, boolean pooled) { return GetMemoryUsageOverTime(pol, Utility.durationToTimeInMS(timerange), pooled); }
/** * * Sets the status of an item wrapper, sets machine name to the current * machine name, and domain to unspecified, parent component to null, * policies are auto created * * @param currenstatus * @param name * @param s * @param pooled * @param p * @deprecated */ @Deprecated public static void TryUpdateStatus(boolean currenstatus, String name, String s, boolean pooled, PolicyType p) { TryUpdateStatus(currenstatus, name, s, pooled, p, AuxHelper.UNSPECIFIED, SLACommon.GetHostName(), null, FLAGS.AUTO_CREATE); }
/** * wrapper that sets the policy type to Status, auto create policy, parent * component is null * * @param currenstatus * @param name unique name of the thing we are checking * @param s current status message */ public static void TryUpdateStatus(boolean currenstatus, String name, String s, boolean pooled, String domain, String server) { TryUpdateStatus(currenstatus, name, s, pooled, PolicyType.STATUS, domain, server, null, FLAGS.AUTO_CREATE); }
/** * wrapper for PolicyType = Status connection must be to the configuration * database and be open, remains open after exiting * * @param uRI * @param con * @param pooled is not used by this function, but is passed along */ @Deprecated public static void CheckPolicyAndCreate(String uRI, Connection con, boolean pooled, String domain, String server) { CheckPolicyAndCreate(uRI, con, PolicyType.STATUS, pooled, domain, server, null); }
/** * Sets the status of an item, if it has changed, SLA alerts are processed * data is recorded in two databases, one with the current status, and one * with all previous status messages name = the URI of the item s = current * status message wrapper, policies are auto created * * @param currenstatus * @param name * @param s * @param pooled * @param p * @param domain * @param server * @param parentcomponent */ public static void TryUpdateStatus(boolean currenstatus, String name, String s, boolean pooled, PolicyType p, String domain, String server, String parentcomponent) { TryUpdateStatus(currenstatus, name, s, pooled, p, domain, server, parentcomponent, FLAGS.AUTO_CREATE); }
/** * Attempts to creates a policy of the given type. Since the database has * unique keys, an error messages are just swallowed up connection must be * to the configuration database and be open, remains open after exiting * * @param uRI * @param con * @param pooled is not used by this function, but is passed along */ @Deprecated public static void CheckPolicyAndCreate(String URL, Connection con, PolicyType p, boolean pooled, String domainname, String hostname) { CheckPolicyAndCreate(URL, con, p, pooled, domainname, hostname, null); }
/** * Sets the status of an item, if it has changed, SLA alerts are processed * data is recorded in two databases, one with the current status, and one * with all previous status messages name = the URI of the item s = current * status message * * @param currenstatus * @param name/uri of the thing we are setting the status on * @param statusMessage message * @param pooled, determines how the database connection will be loaded, * pooled = JNDI lookup * @param polity type * @param domain, if not known, use AuxHelper.UNSPECIFIED * @param server , if not known, use AuxHelper.UNSPECIFIED */ public static void TryUpdateStatus(boolean currenstatus, String name, String statusMessage, boolean pooled, PolicyType policyType, String domain, String server) { TryUpdateStatus(currenstatus, name, statusMessage, pooled, policyType, domain, server, null, FLAGS.AUTO_CREATE); }//PolicyType.STATISTICAL