org.miloss.fgsms.sla.actions.SLAActionRestart Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fgsms-sla-processor Show documentation
Show all versions of fgsms-sla-processor Show documentation
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.actions;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
import org.miloss.fgsms.common.Logger;;
import org.miloss.fgsms.common.Utility;
import org.miloss.fgsms.plugins.sla.AlertContainer;
import org.miloss.fgsms.plugins.sla.SLAActionInterface;
import org.miloss.fgsms.services.interfaces.common.NameValuePair;
import org.miloss.fgsms.services.interfaces.common.PolicyType;
/**
*
* @author AO
*/
public class SLAActionRestart implements SLAActionInterface {
private static Logger log = Logger.getLogger("fgsms.SLAProcessor");
public static final String RUNAT = "runAtLocation";
@Override
public List GetRequiredParameters() {
return new ArrayList();
}
@Override
public List GetOptionalParameters() {
return new ArrayList();
}
@Override
public boolean ValidateConfiguration(List params, AtomicReference outError) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public String GetHtmlFormattedHelp() {
return "This action will attempt to restart a service (Windows via OS Agent), a computer (via OS Agent), or some other capability as supported by the agent."
+ "Currently, the Apache ServiceMix agent can attempt to start stopped JBI Components. "
+ "
"
+ "Important: In order to use this SLA Action, you must have Global Administrator permissions in fgsms.
"
+ "Required parameters:"
+ ""
+ "- runFrom - the working path to start the command from
"
+ "- command - the command to execute
"
+ "- runAt - either fgsms_SERVER or fgsms_AGENT
"
+ "
";
}
@Override
public String GetDisplayName() {
return "Restart a computer or service";
}
@Override
public void ProcessAction(AlertContainer alert, List params) {
// throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List GetAppliesTo() {
List x = new ArrayList();
x.add(PolicyType.STATISTICAL);
x.add(PolicyType.MACHINE);
x.add(PolicyType.PROCESS);
return x;
}
}