
public class SimpleMulticastAlerter extends Object implements SLAActionInterface
| Constructor and Description |
|---|
SimpleMulticastAlerter() |
| Modifier and Type | Method and Description |
|---|---|
List<PolicyType> |
GetAppliesTo()
Returns a list of service policy types that this plugin can be applied to
use Utility.getAllPolicyTypes() if it applies to everything.
|
String |
GetDisplayName()
end user facing display name
|
String |
GetHtmlFormattedHelp()
returns html formatted help to guide users towards proper usage.
|
List<NameValuePair> |
GetOptionalParameters()
returns a list of optional parameters
|
List<NameValuePair> |
GetRequiredParameters()
returns a list of required parameters
|
void |
ProcessAction(AlertContainer alert,
List<NameValuePair> params)
Process an action.
|
boolean |
ValidateConfiguration(List<NameValuePair> params,
AtomicReference<String> outError)
validates the configuration before saving it.
|
public List<NameValuePair> GetRequiredParameters()
PluginCommonGetRequiredParameters in interface PluginCommonpublic List<NameValuePair> GetOptionalParameters()
PluginCommonGetOptionalParameters in interface PluginCommonpublic boolean ValidateConfiguration(List<NameValuePair> params, AtomicReference<String> outError)
SLAActionInterfaceValidateConfiguration in interface SLAActionInterfacepublic String GetHtmlFormattedHelp()
PluginCommonGetHtmlFormattedHelp in interface PluginCommonpublic String GetDisplayName()
PluginCommonGetDisplayName in interface PluginCommonpublic void ProcessAction(AlertContainer alert, List<NameValuePair> params)
SLAActionInterfaceProcess 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 null
Note: 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) {
}
}
}
ProcessAction in interface SLAActionInterfacealert - 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.AlertContainer,
RuleBaseType,
Utility,
AuditLogger,
DBSettingsLoader,
SLACommon,
SetServicePolicyRequestMsg,
ServicePolicy,
org.miloss.fgsms.services.interfaces.policyconfiguration.SLAActionGeneric,
SLApublic List<PolicyType> GetAppliesTo()
PluginCommonGetAppliesTo in interface PluginCommonCopyright © 2008–2017 MIL-OSS. All rights reserved.