public interface SLAActionInterface extends PluginCommon
All implementations should be stateless
Note: SLA Actions can be processed at the fgsms server or at the Agent.
PCS
,
SLARuleGeneric
,
SLARuleInterface
,
SLAAction
Modifier and Type | Method and Description |
---|---|
void |
ProcessAction(AlertContainer alert,
List<NameValuePair> params)
Process an action.
|
boolean |
ValidateConfiguration(List<NameValuePair> params,
AtomicReference<String> outError)
validates the configuration before saving it.
|
GetAppliesTo, GetDisplayName, GetHtmlFormattedHelp, GetOptionalParameters, GetRequiredParameters
void ProcessAction(AlertContainer alert, List<NameValuePair> params)
Process an action. This could do anything you want it to do. Such as call a web service, send an email, an SMS or a JMS message.
This function should never throw an unhandled exception. Please do your best.
Here's a few useful examples for getting configuration settings from fgsms that you'll probably need that aren't provided with the parameters to this interface.
As a developer, you have two choices for getting access to properties that can be used to accomplish your tasks.
String val=null; KeyNameValueEnc setting = DBSettingsLoader.GetPropertiesFromDB(true, "MyPlugin", "MyName"); if (setting!=null && setting.getKeyNameValue()!=null) { val=setting.getKeyNameValue().getPropertyValue(); } //use val for something, log if it's nullNote: The value could be encrypted.
String val=Utility.DE(val);
AuditLogger.LogItem(this.getClass().getCanonicalName(), "CheckRule", "system", "my message", new SecurityWrapper(), null);
SLACommon.GetCurrentStatus((boolean pooled, String policyurl, Boolean out_status, Long out_timestamp, String out_message);
Connection con = Utility.GetPerformanceDBConnection(); //or use Utility.ConfigurationDBConnection(); for the configuration database try { // do something } catch (Exception ex) { // log some message } finally { if (con != null) { try { con.close(); } catch (Exception e) { } } }
alert
- This alert container has a reference to the policy. Do not
make modifications to it, unpredictable results may occur. Also provided
is a human readable fault message, the actual Rule(s)
that caused the trigger to occur, (note: this may be another plugin) and
various other parameters. The AlertContainer should never be null.params
- AlertContainer
,
RuleBaseType
,
Utility
,
AuditLogger
,
DBSettingsLoader
,
SLACommon
,
SetServicePolicyRequestMsg
,
ServicePolicy
,
org.miloss.fgsms.services.interfaces.policyconfiguration.SLAActionGeneric
,
SLA
boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError)
params
- outError
- Copyright © 2008–2017 MIL-OSS. All rights reserved.