All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.miloss.fgsms.sla.rules.ChangeInAvailabilityStatus Maven / Gradle / Ivy

Go to download

The SLA processor handles rules and actions invocations based on service owner defined rules

The newest version!
/**
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * If it is not possible or desirable to put the notice in a particular
 * file, then You may include the notice in a location (such as a LICENSE
 * file in a relevant directory) where a recipient would be likely to look
 * for such a notice.

 * 
 */
 
/*  ---------------------------------------------------------------------------
 *  U.S. Government, Department of the Army
 *  Army Materiel Command
 *  Research Development Engineering Command
 *  Communications Electronics Research Development and Engineering Center
 *  ---------------------------------------------------------------------------
 */
package org.miloss.fgsms.sla.rules;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import org.miloss.fgsms.common.Utility;
import org.miloss.fgsms.plugins.sla.AlertType;
import org.miloss.fgsms.plugins.sla.SLARuleInterface;
import org.miloss.fgsms.services.interfaces.common.MachinePerformanceData;
import org.miloss.fgsms.services.interfaces.common.NameValuePair;
import org.miloss.fgsms.services.interfaces.common.PolicyType;
import org.miloss.fgsms.services.interfaces.common.ProcessPerformanceData;
import org.miloss.fgsms.services.interfaces.datacollector.AddDataRequestMsg;
import org.miloss.fgsms.services.interfaces.datacollector.BrokerData;
import org.miloss.fgsms.services.interfaces.policyconfiguration.ServicePolicy;
import org.miloss.fgsms.services.interfaces.status.SetStatusRequestMsg;

/**
 *Note, this rule is triggered from other functions
 * @author AO
 */
public class ChangeInAvailabilityStatus implements SLARuleInterface {

    @Override
    public boolean CheckTransactionalRule(SetStatusRequestMsg req, List params, AtomicReference nullableFaultMsg) {
        return false;
    }

    @Override
    public boolean CheckTransactionalRule(ProcessPerformanceData req, List params, AtomicReference nullableFaultMsg) {
        return false;
    }

    @Override
    public boolean CheckTransactionalRule(MachinePerformanceData req, List params, AtomicReference nullableFaultMsg) {
        return false;
    }

    @Override
    public boolean CheckTransactionalRule(AddDataRequestMsg req, List params, AtomicReference nullableFaultMsg) {
        return false;
    }

    @Override
    public boolean CheckTransactionalRule(String url, List data, List params, AtomicReference nullableFaultMsg) {
        return false;
    }

    @Override
    public boolean CheckNonTransactionalRule(ServicePolicy pol, List params, AtomicReference nullableFaultMsg, boolean pooled) {
        return false;
    }

    @Override
    public String GetDisplayName() {
        return "Change in Availability Status";
    }

    @Override
    public String GetHtmlFormattedHelp() {
        return "This rule triggers every time a service's status changes from up to down or down to up. This applies to all policy types.";
    }

    @Override
    public List GetRequiredParameters() {
        return new ArrayList();
    }

    @Override
    public List GetOptionalParameters() {
        return new ArrayList();
    }

    @Override
    public boolean ValidateConfiguration(List params, AtomicReference outError, ServicePolicy policy) {
        return true;
    }

    @Override
    public AlertType GetType() {
        return AlertType.Status;
    }

    @Override
    public String GetHtmlFormattedDisplay(List params) {

        return Utility.encodeHTML(GetDisplayName());
    }
    
     @Override
    public List GetAppliesTo() {
     return Utility.getAllPolicyTypes();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy