com.ibm.retail.si.mgmt.monitor
Interface MonitorManagerMBean


public interface MonitorManagerMBean

This MBean is responsible for applying JMX Monitors to agents based on MonitorPolicys added to this MBean. Policies are added/removed using the addMonitorPolicy, removeMonitorPolicy methods. Once MonitorPolicy objects have been added, they can then be mapped or unmapped to a device type or a specific device using oneof the registerMonitor() or deregisterMonitor() methods. When a device is discovered, any applicable policies and their corresponding Monitors will be applied.

The ObjectName of this MBean includes the following attributes, in addition to the SIF attribute of DeviceID:

This management interface includes the following attributes. These attributes are described in more detail in the accessor methods.

The following operations are included in this management interface. These are described in more detail in the corresponding method documentation.

This MBean emits no Notifications, although each instantiated Monitor will emit MonitorNotifications.

Author:
Paul Ruocchio, Kriselie D Rivera, Chris D Arrington

Field Summary
static java.lang.String OBJECT_NAME
           
static java.lang.String SYS_PROP_MONITOR_POLICY_STORE_CLASSNAME
          Property specifying the class name to use for storing monitor policies
 
Method Summary
 boolean addMonitorPolicy(com.ibm.retail.si.mgmt.monitor.MonitorPolicy policy)
          Adds a MonitorPolicy from the registry.
 boolean containsPolicy(com.ibm.retail.si.mgmt.monitor.MonitorPolicy policy)
          Returns true if the supplied MonitorPolicy has been added, otherwise false.
 boolean containsPolicy(java.lang.String policyId)
          Returns true if a policy matching the supplied identifier has been added, otherwise false.
 void deregisterAllMonitors()
          Removes all monitor registrations for all policies
 boolean deregisterMonitor(MonitorPolicyAction action)
          Removes the registration for the supplied MonitorPolicyAction, and, if the action was enabled, unregisters any created MonitorMBeans.
 com.ibm.retail.si.mgmt.monitor.MonitorPolicy[] getAllMonitorPolicies()
          Return an array of all stored monitor policies.
 MonitorPolicyAction[] getAllMonitorPolicyActions()
          Return an array of all stored monitor policy actions.
 com.ibm.retail.si.mgmt.monitor.MonitorPolicy getMonitorPolicy(java.lang.String policyId)
          Retrieves the MonitorPolicy matching the supplied policy identifier, or null if it cannot be found.
 MonitorPolicyAction[] getMonitorPolicyActions(java.lang.String policyId)
          Retrieves all MonitorPolicyAction associated with a matching the supplied policy identifier, or null if it cannot be found.
 void initialize()
          Initializes the MonitorManager.
 boolean isMonitorRegistered(MonitorPolicyAction action)
          Returns whether or not the supplied MonitorPolicyAction is registered
 boolean registerMonitor(MonitorPolicyAction action)
          Registers the supplied MonitorPolicyAction and, if the action is enabled, applies it to all active and newly discovered devices that match the MonitorPolicyAction's target identifier (device type, device id, or system id).
 void removeAllPolicies()
          Removes all MonitorPolicy objects and any registrations
 com.ibm.retail.si.mgmt.monitor.MonitorPolicy removeMonitorPolicy(com.ibm.retail.si.mgmt.monitor.MonitorPolicy policy)
          Removes the MonitorPolicy object equal to that supplied, plus any registrations of those policies.
 com.ibm.retail.si.mgmt.monitor.MonitorPolicy removeMonitorPolicy(java.lang.String policyId)
          Removes the MonitorPolicy matching the supplied policy identifier, and any registrations of that policy.
 void shutdown()
          Shutdown the MBean, attempting to save currently stored policies in persistent storage
 

Field Detail

OBJECT_NAME

public static final java.lang.String OBJECT_NAME
See Also:
Constant Field Values

SYS_PROP_MONITOR_POLICY_STORE_CLASSNAME

public static final java.lang.String SYS_PROP_MONITOR_POLICY_STORE_CLASSNAME
Property specifying the class name to use for storing monitor policies

See Also:
MonitorPolicyRegistry, Constant Field Values
Method Detail

initialize

public void initialize()
                throws MgmtException
Initializes the MonitorManager.

Throws:
MgmtException - Error initializing the MBean

shutdown

public void shutdown()
Shutdown the MBean, attempting to save currently stored policies in persistent storage


addMonitorPolicy

public boolean addMonitorPolicy(com.ibm.retail.si.mgmt.monitor.MonitorPolicy policy)
Adds a MonitorPolicy from the registry. Returns true if the policy was added, or false if the policy has already been added.

Parameters:
policy - MonitorPolicy to add
Returns:
true if the policy was successfully added, or false if the policy has already been added.

removeMonitorPolicy

public com.ibm.retail.si.mgmt.monitor.MonitorPolicy removeMonitorPolicy(com.ibm.retail.si.mgmt.monitor.MonitorPolicy policy)
Removes the MonitorPolicy object equal to that supplied, plus any registrations of those policies. This method returns the MonitorPolicy removed or null if it was not removed.

Parameters:
policy - MonitorPolicy to remove
Returns:
The MonitorPolicy that was removed, or null if it was not removed

removeMonitorPolicy

public com.ibm.retail.si.mgmt.monitor.MonitorPolicy removeMonitorPolicy(java.lang.String policyId)
Removes the MonitorPolicy matching the supplied policy identifier, and any registrations of that policy. This method returns the MonitorPolicy removed, or null if it was not removed.

Parameters:
policyId - Identifier of the MonitorPolicy to remove
Returns:
The MonitorPolicy that was removed, or null if it was not added

removeAllPolicies

public void removeAllPolicies()
Removes all MonitorPolicy objects and any registrations


containsPolicy

public boolean containsPolicy(com.ibm.retail.si.mgmt.monitor.MonitorPolicy policy)
Returns true if the supplied MonitorPolicy has been added, otherwise false.

Parameters:
policy - MonitorPolicy to search for
Returns:
true if a policy matching the supplied policy identifier has been added, false otherwise.

containsPolicy

public boolean containsPolicy(java.lang.String policyId)
Returns true if a policy matching the supplied identifier has been added, otherwise false.

Parameters:
policyId - MonitorPolicy identifier to search for
Returns:
true if a policy matching the supplied policy identifier has been added, false otherwise.

getMonitorPolicy

public com.ibm.retail.si.mgmt.monitor.MonitorPolicy getMonitorPolicy(java.lang.String policyId)
Retrieves the MonitorPolicy matching the supplied policy identifier, or null if it cannot be found.

Parameters:
policyId - Policy identifier of the MonitorPolicy to retrieve
Returns:
MonitorPolicy matching the supplied policy identifier, or null if it cannot be found.

getAllMonitorPolicies

public com.ibm.retail.si.mgmt.monitor.MonitorPolicy[] getAllMonitorPolicies()
Return an array of all stored monitor policies.

Returns:
MonitorPolicy[] An array of monitor policies.

registerMonitor

public boolean registerMonitor(MonitorPolicyAction action)
                        throws MgmtException
Registers the supplied MonitorPolicyAction and, if the action is enabled, applies it to all active and newly discovered devices that match the MonitorPolicyAction's target identifier (device type, device id, or system id).

Parameters:
action - The MonitorPolicyAction to register
Returns:
true if the registration was added and applied successfully, or false if a registration for the supplied action already exists.
Throws:
MgmtException
See Also:
com.ibm.retail.si.mgmt.monitor.MonitorPolicyAction

deregisterAllMonitors

public void deregisterAllMonitors()
Removes all monitor registrations for all policies


deregisterMonitor

public boolean deregisterMonitor(MonitorPolicyAction action)
                          throws MgmtException
Removes the registration for the supplied MonitorPolicyAction, and, if the action was enabled, unregisters any created MonitorMBeans.

Parameters:
action - The MonitorPolicyAction to deregister
Returns:
boolean true if the action was deregistered successfully, false otherwise
Throws:
MgmtException - Error unregistering the general agent's MonitorMBean

getAllMonitorPolicyActions

public MonitorPolicyAction[] getAllMonitorPolicyActions()
Return an array of all stored monitor policy actions.

Returns:
MonitorPolicyAction[] An array of monitor policy actions.

getMonitorPolicyActions

public MonitorPolicyAction[] getMonitorPolicyActions(java.lang.String policyId)
Retrieves all MonitorPolicyAction associated with a matching the supplied policy identifier, or null if it cannot be found.

Parameters:
policyId - Policy identifier of the MonitorPolicy to retrieve
Returns:
MonitorPolicyAction[] containing all actions whose policy matches the supplied policy identifier, or an empty array if none can be found.

isMonitorRegistered

public boolean isMonitorRegistered(MonitorPolicyAction action)
Returns whether or not the supplied MonitorPolicyAction is registered

Parameters:
action - MonitorPolicyAction to search for
Returns:
true if the supplied action is registered, false otherwise


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004