/** * * 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); }
/** * 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 void run() { System.out.println("Control-C caught. Shutting down..."); running = false; while (!done) { try { Thread.sleep(1000); } catch (InterruptedException ex) { } } closeLock(); deleteFile(); if (!noloop) { AuxHelper.TryUpdateStatus(false, "urn:fgsms:Bueller:" + Utility.getHostName(), "Stopped", false, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); } } }
public void run() { System.out.println("Control-C caught. Shutting down..."); running = false; while (!done) { try { Thread.sleep(1000); } catch (InterruptedException ex) { } } closeLock(); deleteFile(); if (!noloop) { AuxHelper.TryUpdateStatus(false, "urn:fgsms:DataPruner:" + Utility.getHostName(), "Stopped", false, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); } } }
public void run() { System.out.println("Control-C caught. Shutting down..."); running = false; while (!done) { try { Thread.sleep(1000); } catch (InterruptedException ex) { } } closeLock(); deleteFile(); if (urls != null) { for (int i = 0; i < urls.length; i++) { AuxHelper.TryUpdateStatus(false, IpAddressUtility.modifyURL(urls[i], true), "Agent Stopped", false, PolicyType.STATISTICAL, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); } } } }
@Override public void run() { try { String s = reference.sendGetRequest(pooled, url,0); Boolean currenstatus = s.equalsIgnoreCase("ok"); //log.log(Level.INFO, (i + 1) + "/" + urls.size() + " " + urls.get(i) + " status is " + s); if (!currenstatus) { List<String> alts = reference.GetAlternateUrls(url, pooled); for (int k = 0; k < alts.size(); k++) { if (currenstatus) { break; } s = reference.sendGetRequest(pooled, alts.get(k),0); currenstatus = s.equalsIgnoreCase("ok"); reference.log.log(Level.INFO, url + " via alternate URL " + alts.get(k) + " status is " + s); } } reference.log.log(Level.INFO, url + " status is " + s); AuxHelper.TryUpdateStatus(currenstatus, url, s, pooled, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); } catch (Exception ex) { reference.log.log(Level.ERROR, "error setting status in config db for uri " + url + ex.getLocalizedMessage(), ex); } } }
log.log(Level.ERROR, null, ex); AuxHelper.TryUpdateStatus(false, "urn:fgsms:DataPruner:" + Utility.getHostName(), "ERROR", pooled, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName());
protected Credentials transformCredentials(String[] info) { if (info.length == 2) { return new UsernamePasswordCredentials(info[0], Utility.DE(info[1])); } if (info.length == 3) { TransportAuthenticationStyle tas = TransportAuthenticationStyle.valueOf(info[2]); switch (tas) { case HTTP_NTLM: String data = info[0]; String[] t = data.split("\\\\"); String username = t[1]; String domain = t[0]; return new NTCredentials(username, Utility.DE(info[1]), SLACommon.GetHostName(), domain); case HTTP_DIGEST: case HTTP_BASIC: default: return new UsernamePasswordCredentials(info[0], Utility.DE(info[1])); } } return null; }
AuxHelper.TryUpdateStatus(true, "urn:fgsms:DataPruner:" + Utility.getHostName(), "OK", pooled, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); lastUpdateAt = System.currentTimeMillis(); AuxHelper.TryUpdateStatus(true, "urn:fgsms:DataPruner:" + Utility.getHostName(), "OK", pooled, PolicyType.STATUS, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); log.log(Level.INFO, "fgsms Data Pruner is purging old records..."); Purge(false);
Fire(false); AuxHelper.TryUpdateStatus(true, "urn:fgsms:Bueller:" + Utility.getHostName(), "OK, took " + (System.currentTimeMillis() - lastRanAt) + "ms to process.", false, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); AuxHelper.TryUpdateStatus(false, "urn:fgsms:Bueller:" + Utility.getHostName(), "Running but possible database error" + (System.currentTimeMillis() - lastRanAt) + "ms to process.", false, AuxHelper.UNSPECIFIED, SLACommon.GetHostName());
try { Connection con = Utility.getConfigurationDB_NONPOOLED_Connection(); AuxHelper.CheckStatisticalPolicyAndCreate(url, con, false, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); con.close(); } catch (Exception ex) {
try { c = JMXConnectorFactory.connect(u, m); AuxHelper.TryUpdateStatus(true, modifiedurl, status, pooled, PolicyType.STATISTICAL, AuxHelper.UNSPECIFIED, SLACommon.GetHostName()); } catch (Exception ex) { AuxHelper.TryUpdateStatus(false, modifiedurl, ex.getLocalizedMessage(), pooled, PolicyType.STATISTICAL, AuxHelper.UNSPECIFIED, SLACommon.GetHostName());
AuxHelper.TryUpdateStatus(currenstatus, urls.get(i), s, pooled, AuxHelper.UNSPECIFIED, SLACommon.GetHostName(), AuxHelper.FLAGS.NO_AUTO_CREATE);