private static boolean containsChangeInStatus(RuleBaseType b) { if (b == null) { return false; } if (b instanceof SLARuleGeneric) { { SLARuleGeneric asd = (SLARuleGeneric) b; if (asd.getClassName().equalsIgnoreCase(ChangeInAvailabilityStatus.class.getCanonicalName())) { return true; } } } if (b instanceof AndOrNot) { AndOrNot x = (AndOrNot) b; if (x.getFlag() == JoiningType.AND) { return containsChangeInStatus(x.getLHS()) && containsChangeInStatus(x.getRHS()); } if (x.getFlag() == JoiningType.OR) { return containsChangeInStatus(x.getLHS()) || containsChangeInStatus(x.getRHS()); } } return false; }
/** * Create an instance of {@link AndOrNot } * */ public AndOrNot createAndOrNot() { return new AndOrNot(); }
/** * recursive used to determine if we need to record the request/response * pair * * @param rule * @return */ protected boolean doesSLARuleContainXpath(RuleBaseType rule) { if (rule == null) { return false; } if (rule instanceof SLARuleGeneric) { SLARuleGeneric r = (SLARuleGeneric) rule; if (r.getClassName().equalsIgnoreCase("org.miloss.fgsms.sla.rules.XPathExpression")) { return true; } } if (rule instanceof AndOrNot) { AndOrNot t1 = (AndOrNot) rule; return doesSLARuleContainXpath(t1.getLHS()) || doesSLARuleContainXpath(t1.getRHS()); } return false; }
switch (aon.getFlag()) { case AND: return processProcessSLAsRecursive(machineData, pol, pooled, rule, outFaultMsg) && processProcessSLAsRecursive(machineData, pol, pooled, rule, outFaultMsg);
switch (aon.getFlag()) { case AND: return processMachineSLAsRecursive(req, rule, pol, pooled, outFaultmsg) && processMachineSLAsRecursive(req, rule, pol, pooled, outFaultmsg);
if (x.getFlag() == JoiningType.AND) { return "(" + ToFriendylName(x.getLHS(), pcs, c) + " and " + ToFriendylName(x.getRHS(), pcs, c) + ")"; if (x.getFlag() == JoiningType.OR) { return "(" + ToFriendylName(x.getLHS(), pcs, c) + " or " + ToFriendylName(x.getRHS(), pcs, c) + ")"; if (x.getFlag() == JoiningType.NOT) { return "not " + ToFriendylName(x.getLHS(), pcs, c);
private static boolean processStatisticalSLARulesRecursive(AddStatisticalDataRequestMsg req, boolean pooled, RuleBaseType rule, AtomicReference<String> outFaultMsg, AtomicReference<AlertType> alertType) { if (rule instanceof AndOrNot) { AndOrNot aon = (AndOrNot) rule; switch (aon.getFlag()) { case AND: return processStatisticalSLARulesRecursive(req, pooled, rule, outFaultMsg, alertType) && processStatisticalSLARulesRecursive(req, pooled, rule, outFaultMsg, alertType);
if (x.getFlag() == JoiningType.AND) { return "(" + BuildSLARuleData(x.getLHS(), rule_plugins) + " and " + BuildSLARuleData(x.getRHS(), rule_plugins) + ")"; if (x.getFlag() == JoiningType.OR) { return "(" + BuildSLARuleData(x.getLHS(), rule_plugins) + " or " + BuildSLARuleData(x.getRHS(), rule_plugins) + ")"; if (x.getFlag() == JoiningType.NOT) { return "not " + BuildSLARuleData(x.getLHS(), rule_plugins);
if (x.getFlag() == JoiningType.AND) { return "(" + RenderSLAParametersForEditing(x.getLHS()) + " and " + RenderSLAParametersForEditing(x.getRHS()) + ")"; if (x.getFlag() == JoiningType.OR) { return "(" + RenderSLAParametersForEditing(x.getLHS()) + " or " + RenderSLAParametersForEditing(x.getRHS()) + ")"; if (x.getFlag() == JoiningType.NOT) { return "not " + RenderSLAParametersForEditing(x.getLHS());
switch (aon.getFlag()) { case AND: return validateRulesRecursive(pol, ref, aon.getLHS()) && validateRulesRecursive(pol, ref, aon.getRHS()); case NOT: return !validateRulesRecursive(pol, ref, aon.getLHS()); case OR: return validateRulesRecursive(pol, ref, aon.getLHS()) || validateRulesRecursive(pol, ref, aon.getRHS());
if (rule instanceof AndOrNot) { AndOrNot x = (AndOrNot) rule; if (x.getFlag() == JoiningType.AND) { return ProcessRules(get, faultMsg, x.getLHS()) && ProcessRules(get, faultMsg, x.getRHS()); if (x.getFlag() == JoiningType.OR) { return ProcessRules(get, faultMsg, x.getLHS()) || ProcessRules(get, faultMsg, x.getRHS()); if (x.getFlag() == JoiningType.NOT) { return !ProcessRules(get, faultMsg, x.getLHS());
switch (aon.getFlag()) { case AND: return ProcessNonTransactionalRules(faultMsg, aon.getLHS(), pol, pooled, p) && ProcessNonTransactionalRules(faultMsg, aon.getRHS(), pol, pooled, p); case OR: return ProcessNonTransactionalRules(faultMsg, aon.getLHS(), pol, pooled, p) || ProcessNonTransactionalRules(faultMsg, aon.getRHS(), pol, pooled, p); case NOT: return !ProcessNonTransactionalRules(faultMsg, aon.getLHS(), pol, pooled, p);