Interface RemoteAlertSender
-
public interface RemoteAlertSenderThe RemoteAlertSender can be used to send notifications to (remote) entities identified by principal names. This service is provided by Protocol Adapters, and is used by theNotificationServicewhen sending alerts. Implementations of this interface have to be able to connect and send alerts to one or more management servers in a protocol specific way.The properties of the service registration should specify a list of destinations (principals) where the service is capable of sending alerts. This can be done by providing a
Stringarray of principal names in theprincipalsregistration property. If this property is not registered, the service will be treated as the default sender. The default alert sender is only used when a more specific alert sender cannot be found.The
principalsregistration property is used when theNotificationService.sendNotification(String, int, String, AlertItem[])method is called, to find the properRemoteAlertSenderfor the given destination. If the caller does not specify a principal, the alert is only sent if the Notification Sender finds a default alert sender, or if the choice is unambiguous for some other reason (for example if only one alert sender is registered).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidsendAlert(java.lang.String principal, int code, java.lang.String correlator, AlertItem[] items)Sends an alert to a server identified by its principal name.
-
-
-
Method Detail
-
sendAlert
void sendAlert(java.lang.String principal, int code, java.lang.String correlator, AlertItem[] items) throws java.lang.ExceptionSends an alert to a server identified by its principal name. In case the alert is sent in response to a previousexecutecommand, a correlation identifier can be specified to provide the association between the execute and the alert.The
principalparameter specifies which server the alert should be sent to. This parameter can benullif the client does not know the name of the destination. The alert should still be delivered if possible; for example if the alert sender is only connected to one destination.Any exception thrown on this method will be propagated to the original sender of the event, wrapped in a
DmtExceptionwith the codeREMOTE_ERROR.Since sending the alert and receiving acknowledgment for it is potentially a very time-consuming operation, alerts are sent asynchronously. This method should attempt to ensure that the alert can be sent successfully, and should throw an exception if it detects any problems. If the method returns without error, the alert is accepted for sending and the implementation must make a best-effort attempt to deliver it.
- Parameters:
principal- the name identifying the server where the alert should be sent, can benullcode- the alert code, can be 0 if not neededcorrelator- the correlation identifier of an associated EXEC command, ornullif there is no associated EXECitems- the data of the alert items carried in this alert, can be empty ornullif no alert items are needed- Throws:
java.lang.Exception- if the alert can not be sent to the server
-
-