/** * Create an instance of {@link ArrayOfSLAActionBaseType } * */ public ArrayOfSLAActionBaseType createArrayOfSLAActionBaseType() { return new ArrayOfSLAActionBaseType(); }
/** * does this action list contain an email SLA * * @param pc * @return */ public static boolean hasEmailSLA(ArrayOfSLAActionBaseType pc) { if (pc == null) { return false; } if (pc.getSLAAction().isEmpty()) { return false; } for (int i = 0; i < pc.getSLAAction().size(); i++) { if (pc.getSLAAction().get(i).getImplementingClassName().equals("org.miloss.fgsms.sla.actions.EmailAlerter")) { return true; } } return false; }
s.setAction(new ArrayOfSLAActionBaseType()); s.getAction().getSLAAction().add(e); ret.getServiceLevelAggrements().getSLA().add(s); s.setAction(new ArrayOfSLAActionBaseType()); SLAAction e = Utility.newEmailAction(null, "Stale Data Alert for " + Utility.encodeHTML(ret.getURL()), "Stale Data Alert for " + Utility.encodeHTML(ret.getURL()) + ". This is the default alert that indicates that either a server or agent is offline. This alert can be changed by changing the policy for this service."); s.getAction().getSLAAction().add(e); ret.getServiceLevelAggrements().getSLA().add(s);
SLA stemp = new SLA(); stemp.setGuid(bits[1]); stemp.setAction(new ArrayOfSLAActionBaseType()); stemp.setRule(new SLARuleGeneric()); slaCache.put(bits[1], stemp); if (postAppend.containsKey(t)) { List<SLAAction> n = (List<SLAAction>) postAppend.get(t); t.getAction().getSLAAction().addAll(n);
/** * does this policy have an email sla action? * * @param pc * @return */ public static boolean hasEmailSLA(ServicePolicy pc) { if (pc == null) { return false; } if (pc.getServiceLevelAggrements() == null || pc.getServiceLevelAggrements().getSLA().isEmpty()) { return false; } for (int i = 0; i < pc.getServiceLevelAggrements().getSLA().size(); i++) { if (pc.getServiceLevelAggrements().getSLA().get(i).getAction() != null && !pc.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction().isEmpty()) { for (int k = 0; k < pc.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction().size(); k++) { if (pc.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction().get(k).getImplementingClassName().equals("org.miloss.fgsms.sla.actions.EmailAlerter")) { return true; } } } } return false; }
/** * does process specific SLA processing, scope: just right now * * @param processData * @param pooled */ private static void processMachineSLAs(AddMachineAndProcessDataRequestMsg req, MachinePolicy pol, boolean pooled) { if (pol == null || pol.getServiceLevelAggrements() == null) { return; } for (int i = 0; i < pol.getServiceLevelAggrements().getSLA().size(); i++) { RuleBaseType rule = pol.getServiceLevelAggrements().getSLA().get(i).getRule(); AtomicReference<String> msg = new AtomicReference<String>(); if (processMachineSLAsRecursive(req, rule, pol, pooled, msg)) { String id = UUID.randomUUID().toString(); RecordSLAFault(new AtomicReference<String>(msg.get()), pol.getURL(), req.getMachineData().getId(), System.currentTimeMillis(), id, pooled); ProcessAlerts(msg.get(), "<h2" + Utility.encodeHTML(msg.get()) + "</h2>", pol.getURL(), req.getMachineData().getId(), System.currentTimeMillis(), id, pooled, false, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pol.getServiceLevelAggrements().getSLA().get(i).getGuid(), pol, AlertType.Performance); } } }
incident, ispooled, false, servicePolicyQueue.get(k).getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), servicePolicyQueue.get(k).getServiceLevelAggrements().getSLA().get(i).getGuid(), servicePolicyQueue.get(k), AlertType.Performance);
|| pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction().isEmpty()) { outmsg.set("Each SLA must have at least one Action. " + outmsg.get()); valid = false; } else { valid = valid && validateActions(pol, outmsg, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction());
RecordSLAFault(new AtomicReference<String>(fault.get()), pp.getURL(), machineData.getId(), System.currentTimeMillis(), id, pooled); ProcessAlerts((fault.get()), "<h2>" + Utility.encodeHTML(fault.get()) + "</h2>", pp.getURL(), machineData.getId(), System.currentTimeMillis(), id, pooled, false, pp.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pp.getServiceLevelAggrements().getSLA().get(i).getGuid(), pp, AlertType.Performance);
false, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pol.getServiceLevelAggrements().getSLA().get(i).getGuid(), pol, AlertType.Status);
RecordSLAFault(new AtomicReference<String>(ref.get()), req.getBrokerURI(), null, System.currentTimeMillis(), id, pooled); ProcessAlerts(ref.get(), Utility.encodeHTML(ref.get()), req.getBrokerURI(), null, System.currentTimeMillis(), id, pooled, false, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pol.getServiceLevelAggrements().getSLA().get(i).getGuid(), pol, alertType.get());
SLACommon.RecordSLAFault(ref, pol.getURL(), transactionid, time, incident, true); SLACommon.ProcessAlerts(ref.get(), ref.get() + "<br>" + GenerateLink(props.getProperty("fgsms.GUI.URL"), pol.getURL(), transactionid), pol.getURL(), transactionid, time, incident, true, false, pol.getServiceLevelAggrements().getSLA().get(i).getAction().getSLAAction(), pol.getServiceLevelAggrements().getSLA().get(i).getGuid(), pol, AlertType.Performance);