AdventNet Web NMS 4 API Specification

com.adventnet.nms.poll
Class PollingObject

java.lang.Object
  |
  +--com.adventnet.nms.poll.PollingObject
All Implemented Interfaces:
java.io.Serializable

public class PollingObject
extends java.lang.Object
implements java.io.Serializable

This object is for configuring a set of PolledDatas for ManagedObjects based on match criteria specified. In a Polling Object both match criteria and the data collection details have to be given. Whenever a ManagedObject is discovered , it is passed through every Polling Object configured. If the ManagedObject satisfies all the match criteria given for a Polling Object , then, polling for that ManagedObject will be configured as per that Polling Object.

If two or more Polling Objects which satisfy a match criteria for a ManagedObject, then the Polling Object which matches first will be chosen and data collection can be configured based on that PollingObject. This default behaviour can be overriden by using the option PASS_THRO_ALL_POLLING_OBJECTS in WebNMS home/conf/NmsProcessesBE.conf.

At start up Polling Objects are created from Polling.conf.Users can also add Polling Objects at run time using API or through UI.

Since:
2.3
See Also:
Serializable, PollAPI.addPollingObject(PollingObject,boolean), PollAPI.modifyPollingObject(PollingObject,boolean), PollAPI.deletePollingObject(String), PollAPI.setPollingObjectStatus(String,boolean), PollAPI.getPollingObjectStatus(String), Serialized Form

Constructor Summary
PollingObject()
           
 
Method Summary
 java.lang.String getHelpURL()
          Returns the help url of this polling object.
 java.util.Properties getMCProperties()
          Returns the match criteria properties of this Polling Object.
 java.lang.String getName()
          Returns the name of this Polling Object.
 java.lang.String getPollingObjectCustomizer()
          Returns the customizer class of this polling object.
 java.util.Properties getProperties()
          Returns the properties(both data collection details and match criteria) of this polling object.
 boolean getStatus()
          Returns the status of this Polling Object.
 boolean matches(ManagedObject mo)
          Matches the ManagedObject with the match criteria and user classes and returns the status.
 void setMCProperties(java.util.Properties p)
          Sets the match criteria properties of this Polling Object.
 void setName(java.lang.String str)
          Sets a unique name to this Polling Object.
 void setProperties(java.util.Properties p)
          Sets the data collection criteria for this Polling Object.
 void setStatus(boolean stat)
          Set the status of this Polling Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PollingObject

public PollingObject()
Method Detail

setName

public void setName(java.lang.String str)
Sets a unique name to this Polling Object.
Parameters:
str - the name of this Polling Object.

getName

public java.lang.String getName()
Returns the name of this Polling Object.
Returns:
name of this Polling Object.

setStatus

public void setStatus(boolean stat)
Set the status of this Polling Object. If the status is false , polling for all PolledDatas configured under this Polling Object will be disabled.(i.e., the Active field of PolledDatas will be set to false.) Once disbled,Polling can be resumed by setting the status to true.
Parameters:
stat - a boolean value indicating status of this Polling Object.

getStatus

public boolean getStatus()
Returns the status of this Polling Object.
Returns:
a boolean value

setMCProperties

public void setMCProperties(java.util.Properties p)
Sets the match criteria properties of this Polling Object. The format of the properties should be like this.
 "Compare"  Vector of Compare Objects
 "Class"    Vector of user class names
 
Either one user class or one .Compare object is the minimum requirement for creating this Polling Object. The user classes must implement the CheckMOProperties interface.
Note:While setting properties of a PollingObject, match criteria properties must be set using this method before setting data collection criteria using setProperties(Properties). Match criteria properties can be set only when a PollingObject is added.i.e.,it cannot be modified by modifying the PollingObject.
Parameters:
p - Properties to be set.
See Also:
CheckMOProperties, Compare, NumericCompare, StringCompare

getMCProperties

public java.util.Properties getMCProperties()
Returns the match criteria properties of this Polling Object. It contains
  "Compare" vector of Compare objects
  "Class"   vector of strings representing user classes.
  
Returns:
match criteria properties

matches

public boolean matches(ManagedObject mo)
Matches the ManagedObject with the match criteria and user classes and returns the status.
Parameters:
mo - a ManagedObject to be compared.
Returns:
a boolean status of the operation.

setProperties

public void setProperties(java.util.Properties p)
Sets the data collection criteria for this Polling Object. The properties should have the following format.


Note:While setting properties of a PollingObject, match criteria properties must be set using setMCProperties(Properties) before setting data collection properties.
Parameters:
p - Properties to be set.
See Also:
PollFilters

getProperties

public java.util.Properties getProperties()
Returns the properties(both data collection details and match criteria) of this polling object.
Returns:
Properties of this polling object

getPollingObjectCustomizer

public java.lang.String getPollingObjectCustomizer()
Returns the customizer class of this polling object. This is used in client to invoke used specified UI class for manipulating PollingObject. The customized class can be specified in WebNMS home/conf/NmsProcessesBE.conf under Collector process as,
 
 PROCESS		com.adventnet.nms.poll.Collector
 ARGS		POLLING_POLICY_CUSTOMIZER classname
 
 
If no customized class is specified , the name of default class is returned.
Returns:
fully qualified name of the customizer class if specified in NmsProcessesBE.conf , else returns "com.adventnet.nms.pollui.PollUIFrame"(name of the default class)

getHelpURL

public java.lang.String getHelpURL()
Returns the help url of this polling object. The string being relative to the help directory. Since this Polling Object has a customizer, specifying help string has no effect because everything is handled by the customizer.
Returns:
url as string.

AdventNet Web NMS 4 API Specification