Java CAPS Management and Monitoring APIs

AlertNotificationService

The Alert Notification Service notifies the client, such as Groovy, of an event. However, for the client to receive notifications it must subscribe using the Alert Notification Service API. There is a noticeable change between prior releases and Release 6 regarding reliable and non-reliable clients. With Release 5.1.x, the client was reliable, meaning that no events could be removed until their delivery was confirmed. With Release 6, a client can be non-reliable, which means there is no guarantee the client will receive every event. In Release 6, the last client set as “reliable” makes all clients before it unreliable.

Alerts Notification Service API

/**
     * request to the event management system to get an events that satisfy the
     * filter provided. The method will validate the call-back object for the 
     * call-back method name and parameter (see below for more information).
     * This method allow the caller to register multiple time with diffrent
     * filtering,target and call-back parameters.
     * 
     * @param filter - the filter that will be applied to the events prior to 
     *                 forwarding them to this client. the valid keys for the map
     *                 are defined in  {@link com.sun.caps.management.api.alerts.
     *                 AlertNotificationFilterElementType}.
     *                 For the ALERTSEVERITY type the valid value are define in
     *                 {@link com.sun.caps.management.api.alerts.AlertLevelType#}.
     *                 
     * @param targetNames - the server instances that is subscription will initially be
     *                      filtered on. if targetNames is/are defined it/they have 
     *                      precedence over the servername element in the filter 
     *                      mentioned above.
     *                  
     * @param CallbackObject an instance of the client object that contain the 
     *                       call back method to be called when event received 
     *                       from the server.
     * @param methodName the method name to be invoke when event received from the 
     *                       server.
     *       IMPORTANT: THE METHOD MUST HAVE ONE PARAMETER OF TYPE 
     *                      {@link com.sun.caps.management.api.alerts.Alert"} ALERT.
     * 
     * @param requireReliableDelivery - true mean this client request that all events 
     *                       should be delivered to him reliably otherwise the client 
     *                       may miss event.
     *       IMPORTANT: THE SYSTEM ALLOW ONLY ONE RELIABLE CLIENT. THE  LAST CLIENT
     *                       TO SET IT TO TRUE TAKES OVER THE RELIABLE DELIVERY. IT 
     *                       WILL AFFECT ALL THE SUBSCRIPTIONS DONE BY THE CLIENT IN 
     *                       THE CURRENT APPLICATION SESSION.
     *                  
     * @param exceptionCallBack an instance of the client object that contain the call 
     *                       back method to be called when an connectivity exception 
     *                       is generated by this service.
     * 
     * @param exceptionMethodName the method name to be invoke when an exception is 
     *                       generated by this service.
     *       IMPORTANT: THE METHOD MUST HAVE ONE PARAMETER OF TYPE 
     *                       {@link java.lang.Exception} EXCEPTION. 
     *       
     *       NOTE: the exception call be should be the same for all subscriptions 
     *                       calls otherwise the last the exception call back 
     *                       defined by the last subscription will be used.
     *     
     * @return Unique identification string that need to be used in the un-subscribe 
     *                       operation.
     *                             
     * @throws ManagementRemoteException 
     *         1. if fail to communicate with the event management system 
     *         2. unable to invoke call back method because of invalid parameter.
     */
    public String subscribe(Map filter,String[] targetName,Object CallbackObject,String
     *          methodName, Boolean requireReliableDelivery,Object exceptionCallBack,
                String exceptionMethodName) throws ManagementRemoteException;
    
    /**
     * request the event management system to stop forwarding events to this client 
     * based on the subscription the caller made using the subscribe method.
     * once all the caller unsubscribe all the IDs any events that are waiting 
     * to be delivered to this client will be discarded.
     * 
     * @param - subscriptionIDs A list of IDs return by the subscribe call/s  that the
     *          caller wish to unsubscribe from.
     *                 
     * @throws ManagementRemoteException if fail to communicate with the Domain server.
     */
    public void unsubscribe(String[] subscriptionIDs) throws ManagementRemoteException;
    
    /**
     * utility method that returns the parameters the client used to subscribe for 
     * alerts for the given subscription ID.
     * 
     * @param - subscriptionIDs list return by the subscribe call/s.
     *          
     * return a map keyed IDs on the provided as a parameter and values as 
     *        SubcriptionInformationinstances.
     *        @see com.sun.caps.management.api.alerts.SubcriptionInformation 
     * @throws ManagementRemoteException if fail to communicate with the Domain server.
     */
    public Map getSubscriptionInformation(String[] subscriptionIDs);