AdventNet Web NMS 4 API Specification

This class is for internal purpose only and is subjected to change. Developers are recommended not to use this API


com.adventnet.nms.fe.perf
Class PollAPIProxyImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--com.adventnet.nms.fe.perf.PollAPIProxyImpl
All Implemented Interfaces:
BEFailOverListener, CommonAPI, CommonModuleAPI, PollAPI, PollObserver, PollUnitObserver, java.rmi.Remote, java.io.Serializable, ShutDownObserver

public class PollAPIProxyImpl
extends java.rmi.server.UnicastRemoteObject
implements PollAPI, PollUnitObserver, PollObserver, BEFailOverListener, ShutDownObserver

Proxy implementation of PollAPI for accessing, adding, modifying and deleting PolledData objects in the database. This API is accessible either through RMI or directly from the same JVM. When RMI is enabled, i.e. by runninng RMI registry before NMS server is started, the PollAPI can be accessed remotely via RMI. It is published with RMI handle /PollAPI on the server.

See Also:
Serialized Form

Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
PollAPIProxyImpl()
          Obtains the handle of PollAPI.
 
Method Summary
 void addCreateSchema(java.lang.String tableName, java.lang.String schema)
          This method adds a new table and a respective schema to create that table.When this table name is given for the PolledData the table will be created and the Collected Data will be stored in this table.
 void addPoll(PolledData pdata)
          Adds a PolledData into the database.
 void addPoll(PolledData pdata, boolean kickoff)
          Deprecated. as of WebNMS2.1 use addPoll(PolledData) instead.
 void addPolledData(PolledData pd, boolean passthrofilters)
          Adds a PolledData into the database.
 void addPolledDataForMO(ManagedObject mo)
          Adds PolledData to the Polling Engine for the ManagedObject which is passed as a parameter.
 void addPollFilter(java.lang.String className)
          Adds a new poll filter to the Polling Engine.
 void addPollingObject(PollingObject po, boolean updateOldMOs)
          Adds a new PollingObject to the Polling Engine.
 void addProtocolProvider(java.lang.String protocol, ProtocolProvider prov)
          Adds a new ProtocolProvider class for the protocol provided.
 void addReport(ReportObject ro)
          Adds a new report to the Polling Engine.
 boolean addThresholdObject(ThresholdObject obj)
          Adds a ThresholdObject in to the system.
 PolledData checkOut(java.lang.String key)
          Newly added methods of PollAPI for Object Locking support !!
 PolledData checkOut(java.lang.String key, int timeOut)
          Checks out the PolledData with the given key from the database for writing, with a write lock.
 PolledData checkOutIfAvailable(java.lang.String key)
          Checks out the PolledData with the given key from the database for writing, with a write lock.
 boolean checkWritePermission(PolledData obj)
          Checks whether this instance of the PolledData can be written to the database.
 void clearLockForObject(java.lang.String name, int lockType)
          Releases the specified lock type unconditionally for the PolledData with the given name.
 void createTable(java.lang.String tableName)
          This method creates the table that is given as the paranmeter.
 void dataUpdate(CollectedInfo colinfo)
          Called when intimation about data collection has to be done for all PolledData objects of an agent as a set or for all data, i.e., when the observer has registered for all PolledData objects of a particular agent or registered for all data.
 void dataUpdate(java.lang.String pollkey, long time, long value)
          This is the method called in case of the collected data being a numeric.
 void dataUpdate(java.lang.String pollkey, long time, java.lang.String value)
          This is the method called in case of the collected data being a String.
 void deletePoll(java.lang.String nodename)
          Stops data collection for all the PolledData whose agent name matches the name passed as parameter and removes the PolledData from the database .
 void deletePollFilter(java.lang.String className)
          Deletes an existing poll filter from Poll Engine whose name is passed as an argument.
 void deletePollingObject(java.lang.String name)
          Deletes the PollingObject whose name is passed as a parameter from Polling Engine.
 void deletePropForPollingObject(java.lang.String name, java.lang.String key)
          Deletes a single oid from the PollingObject whose name is passed as a parameter.
 void deleteProtocolProvider(java.lang.String protocol)
          Deletes the Provider Class defined for this protocol.
 void deleteReport(java.lang.String name)
          Deletes an existing report with the class name, whose name is passed as a parameter.
 boolean deleteThresholdObject(java.lang.String name)
          Deletes the ThresholdObject with the name name from the system.
 void deRegister(PollUnitObserver pdObs)
          Deregisters this observer from getting the notifications whenever a PolledData is added/modified/deleted.
 void deregisterForAllData(PollObserver pollob)
          Deregisters the specified pollObserver from being notified when a data is collected.
 void deregisterForData(java.lang.String key, PollObserver pollob)
          Deregisters the specified PollObserver from being notified when the data is collected for the PolledData whose key corresponds to the key passed as argument.
 void deregisterForDataFromAgent(java.lang.String agent, PollObserver pollob)
          Deregisters the PollObserver from being notified of the data collected from the agent whose name is passed as parameter.
 java.util.Vector fetchPollerSpecificPolldata(java.lang.String name)
          To get all the PolledDatas for the PollerName given as a parameter.
 java.util.Vector getActivePollers()
          Fetches the names of the active pollers at that time.
 java.util.Vector getAllThresholdObjects()
          Returns all the available ThresholdObjects.
 CollectedData getCollectedData(java.lang.String key, java.util.Date date)
          Returns the data collected for the PolledData object on a given date, whose key matches with the key passed.
 java.util.Vector getCollectedData(java.lang.String key, long timeStart)
          Deprecated. as of WebNMS2.2 use getColletedValues(String,long)
 java.util.Vector getCollectedData(java.lang.String key, long timeStart, long timeEnd)
          Deprecated. as of WebNMS2.2 use getColletedValues(String,long,long)
 java.util.Vector getCollectedData(java.lang.String key, java.lang.String date)
          Deprecated. as of WebNMS2.2 use getColletedData(String, Date)
 CollectedData getCollectedData(java.lang.String instance, java.lang.String key, java.util.Date date)
          Returns the data collected for the PolledData whose key corresponds to the key specified as argument and for the specified instance on the specified date.
 CollectedData getCollectedData(java.lang.String instance, java.lang.String key, long timeStart)
          To get the data of the PolledData object whose key corresponds to the the key specified as argument and for the specified instance and form the given time till current time.
 CollectedData getCollectedData(java.lang.String index, java.lang.String key, long starttime, long endtime)
          Returns the data collected for the PolledData object whose key matches with the key passed, which is collected between the specified time, and for the specified instance.
 CollectedData getCollectedValues(java.lang.String key, long timeStart)
          Returns the data collected for the given PolledData object whose key is given and between the start time specified till the current time .
 CollectedData getCollectedValues(java.lang.String key, long timeStart, long timeEnd)
          Returns the data collected for the PolledData object whose key matches with the key passed, and is collected between the specified time.
 java.util.Vector getCompleteList()
          Returns key of all the PolledData objects.
 java.lang.String getCreateSchema(java.lang.String tableName)
          This method returns the schema that is used for creating the table that is specified.
 int getCurrentLockType(PolledData obj)
          Gets the type oflock currently held by the specified instance of the PolledData.
 java.util.Vector getInstances(MultiplePolledData mpd)
          Returns all the instances of the PolledData when the type of the PolledData is multiple or else returns one element with the value -1.
 java.util.Vector getList()
          Deprecated. as of version WebNMS2.0 use getCompleteList() instead.
 int getNumPollObjects()
          Returns the total number of PolledData objects currently present in the Polling engine.
 java.util.Vector getObjectNamesWithProps(java.util.Properties p)
          Returns all the objects whose properties match with the given Properties.
 java.util.Vector getObjects(java.lang.String classname, java.util.Properties match)
          Returns the Vector of PolledData objects matching the given properties.
 PolledData getPolledData(java.lang.String key)
          Returns the PolledData details for the key passed as parameter.
 boolean getPolledDataConsistent(java.lang.String groupname, java.lang.String key)
          Checks whether all the nodes in the group has PolledData with same name and oid.
 java.util.Vector getPolledDataForGroup(java.lang.String group)
          Returns the PolledData objects for nodes that belong to the groupname given.
 java.util.Vector getPolledDataForNode(java.lang.String ipaddr)
          Returns all the PolledData objects configured for Node with the given IPAddresss.
 java.util.Vector getPolledDataForNodes(java.lang.String[] ipaddrlist)
          Returns the PolledData objects for all the nodes whose IPAddress matches the IPAddress in the given list.
 java.util.Vector getPolledDataForNodes(java.lang.String startip, java.lang.String endip, java.lang.String netmask)
          Returns all the PolledData objects of the nodes whose IPAddress falls between startip and endip.
 PollingObject getPollingObject(java.lang.String name)
          Returns the PollingObject whose name is passed as a parameter.
 java.util.Vector getPollingObjects()
          Returns a Vector of all PollingObjects in Polling Engine.
 boolean getPollingObjectStatus(java.lang.String name)
          returns the status of the PollingObject,whose name is passed as a parameter to this method.
 java.util.Vector getPollsForAgent(java.lang.String agentname)
          Returns the keys of all the PolledData objects configured for an agent.
 java.util.Properties getPropertiesOfObject(java.lang.String objectname)
          Returns the Properties of the object passed.
 java.util.Vector getTableNames()
          Returns a Vector of tables specific to this poller.
 java.util.Hashtable getThreshHashOfOid()
          Returns a Hashtable containing names of ThresholdObjects associated with oids.
 boolean isInitialized()
          Returns boolean value to indicate whether the PollAPI has been initialized or not.
 boolean isPollerActive(java.lang.String pollerName)
          Returns the status of the poller identified by the name given as argument.
 PolledData lock(PolledData obj, int lock_type, int timeout)
          Applies the specified lock to the PolledData.
 void modifyPoll(PolledData pdata)
          Modify a PolledData object whose key matches with the key of PolledData passed as parameter.
 void modifyPoll(PolledData pdata, boolean dealWithLocks)
          Modify a PolledData element whose key matches with the key of PolledData passed as as a parameter .
 void modifyPollingObject(PollingObject po, boolean updateOldMOs)
          Modifies an existing PollingObject.
 void modifyPropForPollingObject(java.lang.String name, java.util.Properties prop, boolean updateMOs)
          modifies properties of a single oid or adds a new oid in the data collection criteria of PollingObject whose of name passed as a parameter.
 boolean modifyThresholdObject(ThresholdObject obj)
          Modifies the ThresholdObject which has been added already.
 void postBEFailOverNotification(BEFailOverEvent beEvent)
          Indicates that the FE server has successfully switched over its connection to the current primary BE server.
 void preBEFailOverNotification(BEFailOverEvent event)
          Indicates that the BE server, to which the FE server is connected, has failed and the FE server is going to try to connect to the standby BE server.
 void register(PollUnitObserver pdObs)
          Registers for getting the notifications whenever a PolledData is added/modified/deleted.
 void registerForAllData(PollObserver pollob)
          Register for all data which is collected by the Poll Engine.
 void registerForData(java.lang.String key, PollObserver pollob)
          Registers for data collection done for the PolledData whose key corresponds to the key passed as argument.This PollObserver will be notified whenever data is collected for that PolledData.
 void registerForDataFromAgent(java.lang.String agent, PollObserver pollob)
          Register for data collection whenever the data is collected for the agent whose name is passed as parameter.
 boolean registerPoller(com.adventnet.nms.fe.perf.RemotePoller rp, java.lang.String name)
          Registers the Poller with the Poll engine.
 boolean removePoll(PolledData pd, boolean dealWithLocks)
          Stops the Snmp Poll identified by the key and also deletes the corresponding PolledData object from the polling engine database.
 boolean removePoll(java.lang.String key)
          Stops the data collection for the PolledData object identified by the key and deletes the corresponding PolledData object from the database.
 boolean removePolledDataForGroup(java.lang.String group, java.lang.String key)
          Removes the PolledData for each and every node that belongs to the group.
 boolean removePolledDataForNode(java.lang.String ipaddr, java.lang.String key)
          Removes the PolledData for the node with the given IpAddress.
 boolean removePolledDataForNodes(java.lang.String[] ipaddrlist, java.lang.String key)
          Removes the PolledData for all the nodes whose IpAddress matches the IpAddress in the given list.
 boolean removePolledDataForNodes(java.lang.String startip, java.lang.String endip, java.lang.String netmask, java.lang.String key)
          Removes the PolledData for all the nodes whose IpAddress falls between startip and end ip.
 void restart()
          Stops and restarts the data collection.
 boolean resumeAllPollsForAgent(java.lang.String agentname)
          Restarts the data collection for an agent if there are any PolledData objects configured for that agent.
 void savePollState()
          Saves the state of the Poll Engine.
 void scheduleReport(java.lang.String name, long timeval)
          Schedules an existing report to be run at a given time.
 boolean setAutoCommit(boolean b)
          WebNMS Poll module has a connection to the database, This method sets the connection's auto-commit mode to true or false.
 void setDebugMode(boolean debug)
          Sets the debugging to true/false based on which some debugging messages will be printed during DataCollection.
 boolean setPolledDataForGroup(java.lang.String group, PolledData pd)
          Assigns the PolledData to each and every node that belongs to the group.
 boolean setPolledDataForNode(java.lang.String ip, PolledData pd)
          Modifies the PolledData of the node with the specified IpAddress with the PolledData passed as argument.
 boolean setPolledDataForNodes(java.lang.String[] ipaddrlist, PolledData pd)
          Replaces all the PolledData objects of all the nodes whose IpAddress matches the IpAddress in the given list, with the pd passed.
 boolean setPolledDataForNodes(java.lang.String startip, java.lang.String endip, java.lang.String netmask, PolledData pd)
          Assigns the PolledData to all the Nodes whose IpAddres falls between startip and endip.
 void setPollingObjectStatus(java.lang.String name, boolean status)
          sets status of the PollingObject name to the given value.
 void shutDown()
          Gets called whenever Web NMS Server shuts down.
 void shutDownAllPollers()
          ShutsDown all the pollers which are active currently.
 void shutDownPoller(java.lang.String pollerName)
          ShutsDown the poller with the name passed as a parameter.
 boolean startDataPoll()
          Starts the data collection.
 void stopAll()
          Stops the data collection permanently.
 boolean stopDataPoll()
          Stops the data collection.
 boolean suspendAllPollsForAgent(java.lang.String agentname)
          Suspends the data being collected from the specified agent.
 void unlock(PolledData obj)
          Unlocks the specified PolledData.
 void update(int type, PolledData pd)
          This is called when a PolledData is added/modified/deleted .
 void update(int type, PollingObject po)
          This method is called when there is any add/modify/delete/status change of PollingObject occurs.
 void update(java.util.Vector pdVect)
          This is called when all PolledData for a particular agent are deleted or when a ManagedObject is deleted, which results in PolledDatas of that ManagedObject getting deleted.
 void update(XMLNode node)
          This method is called when a bulk delete is done.
 void updateNumericTypeOfPd(java.lang.String key, int numericType)
          Updates the numericType of the PolledData whose key is same as the the key given with the numericType passed.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.adventnet.nms.poll.PollAPI
registerPoller
 

Constructor Detail

PollAPIProxyImpl

public PollAPIProxyImpl()
                 throws java.rmi.RemoteException
Obtains the handle of PollAPI.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
Method Detail

isInitialized

public boolean isInitialized()
                      throws java.rmi.RemoteException
Returns boolean value to indicate whether the PollAPI has been initialized or not. PollAPI can be used only after it has been initialized.
Specified by:
isInitialized in interface PollAPI
Returns:
boolean "true" if PollAPI is initialized, "false" if PollAPI is not initialized.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getList

public java.util.Vector getList()
                         throws UserTransactionException,
                                NmsPollException,
                                java.rmi.RemoteException
Deprecated. as of version WebNMS2.0 use getCompleteList() instead.

Returns the key of all PolledData from database which are currently available.
Specified by:
getList in interface PollAPI
Returns:
vector containing key of all the PolledData. The key for a PolledData pd is
pd.name + "\t" + pd.agent.toLowerCase().trim() + "\t" + pd.oid.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPolledData

public PolledData getPolledData(java.lang.String key)
                         throws UserTransactionException,
                                NmsPollException,
                                java.rmi.RemoteException
Returns the PolledData details for the key passed as parameter. The key for a PolledData pd is
pd.name + "\t" + pd.agent.toLowerCase().trim() + "\t" + pd.oid.
Specified by:
getPolledData in interface PollAPI
Parameters:
key - The unique key for the PolledData formed by concatinating name, agent, oid fields of the PolledData with "\t" as the separator between the fields.
Returns:
Return the PolledData object corresponding to the key.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

addPoll

public void addPoll(PolledData pdata)
             throws java.rmi.RemoteException,
                    UserTransactionException,
                    NmsPollException
Adds a PolledData into the database. This method will start data collection immediately if the PolledData is active.
Specified by:
addPoll in interface PollAPI
Parameters:
pd - The PolledData object to be added.
Throws:
NmsPollException - if ,
  • PolledData with the given key already exists.
  • PolledData key is not formed properly.
  • if dynamic table is not created properly at run time (this is applicable only if dynamic table feature is used). if there is any exception while adding PolledData
UserTransactionException - if there is any exception while doing transaction operations.
java.rmi.RemoteException - if an error occurs during remote call

addPoll

public void addPoll(PolledData pdata,
                    boolean kickoff)
             throws java.rmi.RemoteException,
                    UserTransactionException,
                    NmsPollException
Deprecated. as of WebNMS2.1 use addPoll(PolledData) instead.

Adds a PolledData into the database. This method was useful in earlier versions where the second argument specifies whether to start data collection immediately or not.But now starting the data collection immediately or otherwise depends on the active or inactive state of the PolledData.
Specified by:
addPoll in interface PollAPI
Parameters:
pdata - The PolledData to be added to the database.
kickoff - Boolean "true", specifying data collection is to be started immediately.
Throws:
NmsPollException - if ,
  • PolledData with the given key already exists.
  • PolledData key is not formed properly.
  • if dynamic table is not created properly at run time (this is applicable only if dynamic table feature is used). if there is any exception while adding PolledData
UserTransactionException - if there is any exception while doing transaction operations.
java.rmi.RemoteException - if an error occurs during remote call

addPolledData

public void addPolledData(PolledData pd,
                          boolean passthrofilters)
                   throws java.rmi.RemoteException,
                          UserTransactionException,
                          NmsPollException
Adds a PolledData into the database. If passthroFilters is true, then the added PolledData is passed through the available Poll Filters, else it is added directly, as in addPoll(PolledData) method. This method tries to obtain the ManagedObject corresponding to this PolledData from the PolledData itself(Parent ManagedObject name should be set using setParentObj() method). If it is obtained, the ManagedObject and the PolledData are passed through the Poll Filters. else PolledData is added directly.
Specified by:
addPolledData in interface PollAPI
Parameters:
pd - a PolledData to be added to the database
passthrofilters - a boolean indicating whether to pass through Poll Filters or not.
Throws:
NmsPollException - if ,
  • there is any exception while passing PolledData through existing PollFilters
  • there is any problem while retrieving the corresponding ManagedObject
  • PolledData with the given key already exists.
  • PolledData key is not formed properly.
  • if dynamic table is not created properly at run time (this is applicable only if dynamic table feature is used). if there is any exception while adding PolledData
UserTransactionException - if there is any exception while doing transaction operations.

deletePoll

public void deletePoll(java.lang.String nodename)
                throws UserTransactionException,
                       NmsPollException,
                       java.rmi.RemoteException
Stops data collection for all the PolledData whose agent name matches the name passed as parameter and removes the PolledData from the database .
Specified by:
deletePoll in interface PollAPI
Parameters:
nodename - The agent name of the PolledData object for which data collection is to be stopped and the PolledData objects are deleted.
Throws:
NmsPollException - if there is any exception while deleting PolledDatas
java.rmi.RemoteException - if an error occurs during remote call

removePoll

public boolean removePoll(java.lang.String key)
                   throws java.rmi.RemoteException,
                          NmsPollException,
                          UserTransactionException
Stops the data collection for the PolledData object identified by the key and deletes the corresponding PolledData object from the database.
Specified by:
removePoll in interface PollAPI
Parameters:
key - The key for the PolledData object. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
Returns:
boolean specifying the status of the operation .
Throws:
UserTransactionException - if there is any exception while doing transaction operations.
NmsPollException - if there is any problem in deleting the PolledData from the database
java.rmi.RemoteException - if an error occurs during remote call

restart

public void restart()
             throws java.rmi.RemoteException
Stops and restarts the data collection. Use this method to restart data collection only if it is of utmost neccessity as this is a costly process.
Specified by:
restart in interface PollAPI
Throws:
java.rmi.RemoteException - if an error occurs during remote call

stopAll

public void stopAll()
             throws java.rmi.RemoteException
Stops the data collection permanently.
Specified by:
stopAll in interface PollAPI
Throws:
java.rmi.RemoteException - if an error occurs during remote call

savePollState

public void savePollState()
                   throws java.rmi.RemoteException
Saves the state of the Poll Engine. It is not required to call this method as saving the state is done automatically whenever any changes are made. This is used during ShutDown of the Server to make sure the latest information is saved.
Specified by:
savePollState in interface PollAPI
Throws:
java.rmi.RemoteException - if an error occurs during remote call

modifyPoll

public void modifyPoll(PolledData pdata)
                throws java.rmi.RemoteException,
                       NmsPollException,
                       UserTransactionException
Modify a PolledData object whose key matches with the key of PolledData passed as parameter. If the key of the PolledData passed as the argument, matches that of any other PolledData object already in the database, then that PolledData's properties will be changed to the given PolledData's properties. Else the given PolledData will be added as a new PolledData and the data collection is started for this.
Specified by:
modifyPoll in interface PollAPI
Parameters:
pdata - The PolledData object to be modified.
Throws:
UserTransactionException - if there is any exception while doing transaction operations.
java.rmi.RemoteException - if an error occurs during remote call

registerForData

public void registerForData(java.lang.String key,
                            PollObserver pollob)
                     throws java.rmi.RemoteException
Registers for data collection done for the PolledData whose key corresponds to the key passed as argument.This PollObserver will be notified whenever data is collected for that PolledData.
Specified by:
registerForData in interface PollAPI
Parameters:
key - The key of the PolledData object whose data collection will be notified to the PollObservers registered for this key.
pollob - The PollObserver interface implementor class which is notified of the collected data.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
See Also:
PollObserver

deregisterForData

public void deregisterForData(java.lang.String key,
                              PollObserver pollob)
                       throws java.rmi.RemoteException
Deregisters the specified PollObserver from being notified when the data is collected for the PolledData whose key corresponds to the key passed as argument.
Specified by:
deregisterForData in interface PollAPI
Parameters:
key - The key of the PolledData object whose data collection was notified to the PollObserver which was registered before.
pollob - The PollObserver which has to be deregistered.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
See Also:
PollObserver

registerForAllData

public void registerForAllData(PollObserver pollob)
                        throws java.rmi.RemoteException
Register for all data which is collected by the Poll Engine. The PollObserver will be notified whenever a new data is collected .
Specified by:
registerForAllData in interface PollAPI
Parameters:
pollob - The PollObserver interface implementor class which is notified of the collected data.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
See Also:
PollObserver

deregisterForAllData

public void deregisterForAllData(PollObserver pollob)
                          throws java.rmi.RemoteException
Deregisters the specified pollObserver from being notified when a data is collected.
Specified by:
deregisterForAllData in interface PollAPI
Parameters:
pollob - The PollObserver to be deregistered.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
See Also:
PollObserver

registerForDataFromAgent

public void registerForDataFromAgent(java.lang.String agent,
                                     PollObserver pollob)
                              throws java.rmi.RemoteException
Register for data collection whenever the data is collected for the agent whose name is passed as parameter. The PollObserver will be notified whenever data is collected from that agent.
Specified by:
registerForDataFromAgent in interface PollAPI
Parameters:
agent - The agent name whose data will be notified to the PollObserver.
pollob - The PollObserver interface implementor class which is notified of the collected data.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
See Also:
PollObserver

deregisterForDataFromAgent

public void deregisterForDataFromAgent(java.lang.String agent,
                                       PollObserver pollob)
                                throws java.rmi.RemoteException
Deregisters the PollObserver from being notified of the data collected from the agent whose name is passed as parameter.
Specified by:
deregisterForDataFromAgent in interface PollAPI
Parameters:
agent - agent name whose data was notified.
pollob - The PollObserver interface implementor class which is notified of the data collected.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
See Also:
PollObserver

getCollectedData

public java.util.Vector getCollectedData(java.lang.String key,
                                         java.lang.String date)
                                  throws UserTransactionException,
                                         NmsPollException,
                                         java.rmi.RemoteException
Deprecated. as of WebNMS2.2 use getColletedData(String, Date)

Returns the data collected for the PolledData object on a given date, whose key matches with the key passed.
Specified by:
getCollectedData in interface PollAPI
Parameters:
key - The key of the PolledData Object whose data is required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
date - The date on which data collected is required. The date is given in Month-Day-Year (9-20-2000) format.
Returns:
The Vector containing the collected data. The first element is the time array as long[] and the second element is the values array as long[] or string[] depending on the value collected. Vector is null if no data is collected for the given key on the particular date.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public CollectedData getCollectedData(java.lang.String key,
                                      java.util.Date date)
                               throws UserTransactionException,
                                      NmsPollException,
                                      java.rmi.RemoteException
Returns the data collected for the PolledData object on a given date, whose key matches with the key passed.
Specified by:
getCollectedData in interface PollAPI
Parameters:
key - The key of the PolledData Object whose data is required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
date - The date as on which data collected is required. The date is the instance of java.util.Date
Returns:
CollectedData containing the collected data.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public java.util.Vector getCollectedData(java.lang.String key,
                                         long timeStart,
                                         long timeEnd)
                                  throws UserTransactionException,
                                         NmsPollException,
                                         java.rmi.RemoteException
Deprecated. as of WebNMS2.2 use getColletedValues(String,long,long)

Returns the data collected for the PolledData object whose key matches with the key passed, which is collected between the specified time. This method requires the start time and end time as long. This method can be used only in database mode and in serialized mode this returns null.
Specified by:
getCollectedData in interface PollAPI
Parameters:
key - The key of the PolledData Object whose data is required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
timeStart - The starting time from when the collected data is required. The time is given as a long.
timeEnd - The end time, until when the collected data is required as long.
Returns:
The Vector containing the collected data. The first element is the time array as long[] and the second element is the values array as long[] or String[] depending on the value collected. The return value is null if there is no data collected.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public java.util.Vector getCollectedData(java.lang.String key,
                                         long timeStart)
                                  throws UserTransactionException,
                                         NmsPollException,
                                         java.rmi.RemoteException
Deprecated. as of WebNMS2.2 use getColletedValues(String,long)

Returns the data collected for the given PolledData object whose key is given and from the start time specified till the current time. This method requires the start time in long. This method can be used only in database mode and in serialized mode this returns null.
Specified by:
getCollectedData in interface PollAPI
Parameters:
key - The key of the PolledData Object whose data is required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
timeStart - The starting time from when the collected data is required. The time is given as a long.
Returns:
The Vector containing the collected data. The first element is the time array as long[] and the second element is the values array as long[] or String[] depending on the value collected. The return value is null if there is no data collected.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public CollectedData getCollectedData(java.lang.String instance,
                                      java.lang.String key,
                                      java.util.Date date)
                               throws UserTransactionException,
                                      NmsPollException,
                                      java.rmi.RemoteException
Returns the data collected for the PolledData whose key corresponds to the key specified as argument and for the specified instance on the specified date. This method is used only in case of MultiplePolledData.
Specified by:
getCollectedData in interface PollAPI
Parameters:
instance - the instance of the MultiplePolledData for which the data is required.
key - The key of the PolledData Object whose data is required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
date - Date on which the data collected is required.
Returns:
CollectedData containing the collected data.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public CollectedData getCollectedData(java.lang.String index,
                                      java.lang.String key,
                                      long starttime,
                                      long endtime)
                               throws UserTransactionException,
                                      NmsPollException,
                                      java.rmi.RemoteException
Returns the data collected for the PolledData object whose key matches with the key passed, which is collected between the specified time, and for the specified instance. This is used only in case of MultiplePolledData. This method requires the start time and end time as long. This method can be used only in database mode and in serialized mode this returns null. This method is used to get the Collected data when the PolledData is an instance of MultiplePolledData.
Specified by:
getCollectedData in interface PollAPI
Parameters:
index - the instance string whose value is needed.
key - The key of the PolledData Object whose data is required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
starttime - The starting time from when the collected data is required. The time is given as a long.
endtime - The end time until when the collected data is required as long.
Returns:
CollectedData containing the collected data.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public CollectedData getCollectedData(java.lang.String instance,
                                      java.lang.String key,
                                      long timeStart)
                               throws UserTransactionException,
                                      NmsPollException,
                                      java.rmi.RemoteException
To get the data of the PolledData object whose key corresponds to the the key specified as argument and for the specified instance and form the given time till current time. This is used in case of MultiplePolledDatas.
Specified by:
getCollectedData in interface PollAPI
Parameters:
instance - instance of the MultiplePolledData
key - The key of the PolledData Object whose data are required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
timeStart - The starting time from when the collected statistic is required. The time is given as a long.
Returns:
CollectedData containing the collected statistics.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getInstances

public java.util.Vector getInstances(MultiplePolledData mpd)
                              throws UserTransactionException,
                                     NmsPollException,
                                     java.rmi.RemoteException
Returns all the instances of the PolledData when the type of the PolledData is multiple or else returns one element with the value -1.
Specified by:
getInstances in interface PollAPI
Parameters:
mpd - MultiplePolledData whose instances has to be obtained.
Returns:
Vector containing the instances of the mpd as String.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

suspendAllPollsForAgent

public boolean suspendAllPollsForAgent(java.lang.String agentname)
                                throws UserTransactionException,
                                       NmsPollException,
                                       java.rmi.RemoteException
Suspends the data being collected from the specified agent.
Specified by:
suspendAllPollsForAgent in interface PollAPI
Parameters:
agentname - Name of the agent for whom data collection has to be suspended.
Returns:
false if there are no PolledData object configured for the agent else true.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

resumeAllPollsForAgent

public boolean resumeAllPollsForAgent(java.lang.String agentname)
                               throws UserTransactionException,
                                      NmsPollException,
                                      java.rmi.RemoteException
Restarts the data collection for an agent if there are any PolledData objects configured for that agent.
Specified by:
resumeAllPollsForAgent in interface PollAPI
Parameters:
agentname - Name of the agent for whom the data collection are to be resumed.
Returns:
false If there are no PolledData objects configured for the agent else true.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPollsForAgent

public java.util.Vector getPollsForAgent(java.lang.String agentname)
                                  throws UserTransactionException,
                                         NmsPollException,
                                         java.rmi.RemoteException
Returns the keys of all the PolledData objects configured for an agent. The Key for the PolledData object pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
Specified by:
getPollsForAgent in interface PollAPI
Parameters:
agentname - Name of the agent whose keys to the PolledData has to be returned.
Returns:
Vector of keys to the PolledData objects as String. Empty Vector if there is no PolledData configured for that agent.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getObjects

public java.util.Vector getObjects(java.lang.String classname,
                                   java.util.Properties match)
                            throws UserTransactionException,
                                   NmsPollException,
                                   java.rmi.RemoteException
Returns the Vector of PolledData objects matching the given properties. The classname is the name of the class the objects belong to. This method can be used only if the object's properties are stored in an RDBMS. It is also assumed one object is stored in only one table. If one object is stored in multiple tables, then only partial object will be returned.
Specified by:
getObjects in interface PollAPI
Parameters:
classname - name of the class the object belongs.
match - properties which is to be matched with the object's properties.
Returns:
Vector of objects whose properties match the properties given.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

setAutoCommit

public boolean setAutoCommit(boolean b)
                      throws java.rmi.RemoteException,
                             java.sql.SQLException
WebNMS Poll module has a connection to the database, This method sets the connection's auto-commit mode to true or false. By default auto-commit mode is true.
Specified by:
setAutoCommit in interface PollAPI
Parameters:
b - boolean true/false which sets/resets the AutoCommit mode.
Returns:
boolean false if connection to the database doesnot exist,else true when connection exists and the autocommit is set.
Throws:
java.rmi.RemoteException - if an error occurs during remote call
java.sql.SQLException - if an error occurs during database access

getNumPollObjects

public int getNumPollObjects()
                      throws NmsPollException,
                             java.rmi.RemoteException
Returns the total number of PolledData objects currently present in the Polling engine.
Specified by:
getNumPollObjects in interface PollAPI
Returns:
int number of PolledData objects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPropertiesOfObject

public java.util.Properties getPropertiesOfObject(java.lang.String objectname)
                                           throws UserTransactionException,
                                                  NmsStorageException,
                                                  java.rmi.RemoteException
Returns the Properties of the object passed.
Specified by:
getPropertiesOfObject in interface CommonAPI
Parameters:
objectname - Object whose properties are required as String.
Returns:
properties Properties of the object passed.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getObjectNamesWithProps

public java.util.Vector getObjectNamesWithProps(java.util.Properties p)
                                         throws UserTransactionException,
                                                NmsStorageException,
                                                java.rmi.RemoteException
Returns all the objects whose properties match with the given Properties.
Specified by:
getObjectNamesWithProps in interface CommonAPI
Parameters:
p - properties which has tobe matched with the object properties.
Returns:
Vector containing object names as String.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCompleteList

public java.util.Vector getCompleteList()
                                 throws UserTransactionException,
                                        NmsStorageException,
                                        java.rmi.RemoteException
Returns key of all the PolledData objects.
Specified by:
getCompleteList in interface CommonAPI
Returns:
vector of all the PolledData object keys.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

registerPoller

public boolean registerPoller(com.adventnet.nms.fe.perf.RemotePoller rp,
                              java.lang.String name)
                       throws java.rmi.RemoteException
Registers the Poller with the Poll engine.
Parameters:
rp - Remote poller whish is tobe registered with the Poll engine.
name - name of the poller
Returns:
false when the Poller is not registered since the Poller with the given name is already registered ,else true.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

fetchPollerSpecificPolldata

public java.util.Vector fetchPollerSpecificPolldata(java.lang.String name)
                                             throws java.rmi.RemoteException
To get all the PolledDatas for the PollerName given as a parameter.
Specified by:
fetchPollerSpecificPolldata in interface PollAPI
Parameters:
name - Name of the Poller as String.
Returns:
Vector of PolledDatas for the poller specified.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getTableNames

public java.util.Vector getTableNames()
                               throws java.rmi.RemoteException
Returns a Vector of tables specific to this poller.
Specified by:
getTableNames in interface PollAPI
Returns:
return Vector containing table names as String.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

updateNumericTypeOfPd

public void updateNumericTypeOfPd(java.lang.String key,
                                  int numericType)
                           throws UserTransactionException,
                                  NmsPollException,
                                  java.rmi.RemoteException
Updates the numericType of the PolledData whose key is same as the the key given with the numericType passed.
Specified by:
updateNumericTypeOfPd in interface PollAPI
Parameters:
key - key of the PolledData whose numericType has tobe changed as string.
numericType - with which the numericType of PD is changed as int.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPolledDataForNode

public java.util.Vector getPolledDataForNode(java.lang.String ipaddr)
                                      throws UserTransactionException,
                                             NmsPollException,
                                             java.rmi.RemoteException
Returns all the PolledData objects configured for Node with the given IPAddresss.
Specified by:
getPolledDataForNode in interface PollAPI
Parameters:
ipaddr - IPAddress of the node as String.
Returns:
Vector containing PolledData objects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPolledDataForGroup

public java.util.Vector getPolledDataForGroup(java.lang.String group)
                                       throws java.rmi.RemoteException,
                                              NmsPollException,
                                              UserTransactionException
Returns the PolledData objects for nodes that belong to the groupname given. This group name is different from the groupname in the PolledData. Here group refers to the group of the Node in which it belongs.
Specified by:
getPolledDataForGroup in interface PollAPI
Parameters:
group - group name as String.
Returns:
Vector containing PolledData objects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPolledDataForNodes

public java.util.Vector getPolledDataForNodes(java.lang.String[] ipaddrlist)
                                       throws UserTransactionException,
                                              NmsPollException,
                                              java.rmi.RemoteException
Returns the PolledData objects for all the nodes whose IPAddress matches the IPAddress in the given list.
Specified by:
getPolledDataForNodes in interface PollAPI
Parameters:
ipaddrlist - IPAddresses as String[] array.
Returns:
Vector containing PolledData objects of all the nodes whose IP matches with the one in the list.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPolledDataForNodes

public java.util.Vector getPolledDataForNodes(java.lang.String startip,
                                              java.lang.String endip,
                                              java.lang.String netmask)
                                       throws java.rmi.RemoteException,
                                              NmsPollException,
                                              UserTransactionException
Returns all the PolledData objects of the nodes whose IPAddress falls between startip and endip. The starting and ending IPAddress must belong to same network.
Specified by:
getPolledDataForNodes in interface PollAPI
Parameters:
startip - The starting ip address as String.
endip - The ending ip address as String.
netmask - The netmask as String.
Returns:
Vector containing PolledData objects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

setPolledDataForGroup

public boolean setPolledDataForGroup(java.lang.String group,
                                     PolledData pd)
                              throws java.rmi.RemoteException,
                                     NmsPollException,
                                     UserTransactionException
Assigns the PolledData to each and every node that belongs to the group.
Specified by:
setPolledDataForGroup in interface PollAPI
Parameters:
group - Group name as String.
pd - The PolledData that is to be assigned.
Returns:
boolean representing the status of the operation. Returns false even if the operation is unable to assign the PolledData to any one of the node of the group.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

setPolledDataForNodes

public boolean setPolledDataForNodes(java.lang.String[] ipaddrlist,
                                     PolledData pd)
                              throws NmsPollException,
                                     UserTransactionException,
                                     java.rmi.RemoteException
Replaces all the PolledData objects of all the nodes whose IpAddress matches the IpAddress in the given list, with the pd passed.
Specified by:
setPolledDataForNodes in interface PollAPI
Parameters:
ipaddrlist - the list of IpAddress for which the PolledData is to be assigned.
pd - The PolledData with which the modification is made.
Returns:
boolean representing the status of the operation. Returns false even if the operation is unable to assign the PolledData to any one of the IpAddress in the give list
Throws:
java.rmi.RemoteException - if an error occurs during remote call

setPolledDataForNodes

public boolean setPolledDataForNodes(java.lang.String startip,
                                     java.lang.String endip,
                                     java.lang.String netmask,
                                     PolledData pd)
                              throws java.rmi.RemoteException,
                                     NmsPollException,
                                     UserTransactionException
Assigns the PolledData to all the Nodes whose IpAddres falls between startip and endip. The starting and ending IPAddress must belong to same network.
Specified by:
setPolledDataForNodes in interface PollAPI
Parameters:
startip - The starting ip address.
endip - The ending ip address.
netmask - The netmask.
pd - the PolledData to be assigned.
Returns:
boolean representing the status of the operation. Returns false even if the operation is unable to assign the PolledData to any one of the IpAddress in the give range.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

setPolledDataForNode

public boolean setPolledDataForNode(java.lang.String ip,
                                    PolledData pd)
                             throws java.rmi.RemoteException,
                                    NmsPollException,
                                    UserTransactionException
Modifies the PolledData of the node with the specified IpAddress with the PolledData passed as argument. When the key of the PolledData passed matches with any of the PolledData in the Polling Engine that PolledData is modified else,a new PolledData is added .
Specified by:
setPolledDataForNode in interface PollAPI
Parameters:
ip - IPAddress of the node for which the PolledData is to be modified.
pd - The PolledData to be assigned.
Returns:
boolean representing the status of the operation.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

removePolledDataForNode

public boolean removePolledDataForNode(java.lang.String ipaddr,
                                       java.lang.String key)
                                throws UserTransactionException,
                                       NmsPollException,
                                       java.rmi.RemoteException
Removes the PolledData for the node with the given IpAddress.
Specified by:
removePolledDataForNode in interface PollAPI
Parameters:
ipaddr - the IpAddress for which the PolledData is to be removed.
key - the key of the PolledData to be removed.
Returns:
boolean representing the status of the operation.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

removePolledDataForGroup

public boolean removePolledDataForGroup(java.lang.String group,
                                        java.lang.String key)
                                 throws java.rmi.RemoteException,
                                        NmsPollException,
                                        UserTransactionException
Removes the PolledData for each and every node that belongs to the group.
Specified by:
removePolledDataForGroup in interface PollAPI
Parameters:
group - the group name.
key - The key of the PolledData that is to be removed.
Returns:
boolean representing the status of the operation. Returns false even if the operation is unable to remove the PolledData for any one of the node of the group.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

removePolledDataForNodes

public boolean removePolledDataForNodes(java.lang.String startip,
                                        java.lang.String endip,
                                        java.lang.String netmask,
                                        java.lang.String key)
                                 throws java.rmi.RemoteException,
                                        NmsPollException,
                                        UserTransactionException
Removes the PolledData for all the nodes whose IpAddress falls between startip and end ip. The starting and ending IPAddress must belong to same network.
Specified by:
removePolledDataForNodes in interface PollAPI
Parameters:
startip - The starting ip address.
endip - The ending ip address.
netmask - The netmask.
key - the key of the PolledData to be removed.
Returns:
boolean representing the status of the operation. Returns false even if the operation is unable to remove the PolledData of any one of the IpAddress in the range.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

removePolledDataForNodes

public boolean removePolledDataForNodes(java.lang.String[] ipaddrlist,
                                        java.lang.String key)
                                 throws java.rmi.RemoteException,
                                        NmsPollException,
                                        UserTransactionException
Removes the PolledData for all the nodes whose IpAddress matches the IpAddress in the given list.
Specified by:
removePolledDataForNodes in interface PollAPI
Parameters:
ipaddrlist - list containig the IpAddress for which the PolledData is to be removed.
key - the key of the PolledData to be removed.
Returns:
boolean representing the status of the operation. Returns false even if the operation is unable to remove the PolledData of any one of the IpAddress in the list.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPolledDataConsistent

public boolean getPolledDataConsistent(java.lang.String groupname,
                                       java.lang.String key)
                                throws java.rmi.RemoteException,
                                       UserTransactionException,
                                       NmsPollException
Checks whether all the nodes in the group has PolledData with same name and oid.
Specified by:
getPolledDataConsistent in interface PollAPI
Parameters:
groupname - the group name.
key - The key of the PolledData that is to be checked for.
Returns:
boolean representing the status of the operation.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

startDataPoll

public boolean startDataPoll()
                      throws java.rmi.RemoteException
Starts the data collection.
Specified by:
startDataPoll in interface PollAPI
Returns:
boolean true if the data collection is started.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

stopDataPoll

public boolean stopDataPoll()
                     throws java.rmi.RemoteException
Stops the data collection.
Specified by:
stopDataPoll in interface PollAPI
Returns:
boolean true if the data collection is stopped.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getActivePollers

public java.util.Vector getActivePollers()
                                  throws java.rmi.RemoteException
Fetches the names of the active pollers at that time.
Specified by:
getActivePollers in interface PollAPI
Returns:
Vector containing names of ActivePollers as String.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

isPollerActive

public boolean isPollerActive(java.lang.String pollerName)
                       throws java.rmi.RemoteException
Returns the status of the poller identified by the name given as argument.
Specified by:
isPollerActive in interface PollAPI
Parameters:
pollerName - as String.
Returns:
boolean true if the poller is active or otherwise.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

shutDownPoller

public void shutDownPoller(java.lang.String pollerName)
                    throws java.rmi.RemoteException
ShutsDown the poller with the name passed as a parameter.
Specified by:
shutDownPoller in interface PollAPI
Parameters:
pollerName - as String.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

shutDownAllPollers

public void shutDownAllPollers()
                        throws java.rmi.RemoteException
ShutsDown all the pollers which are active currently.
Specified by:
shutDownAllPollers in interface PollAPI
Throws:
java.rmi.RemoteException - if an error occurs during remote call

addThresholdObject

public boolean addThresholdObject(ThresholdObject obj)
                           throws UserTransactionException,
                                  NmsPollException,
                                  java.rmi.RemoteException
Adds a ThresholdObject in to the system. This threshold object can be associated with any data collection variable to check thresholds.
Specified by:
addThresholdObject in interface PollAPI
Parameters:
obj - ThresholdObject which has to be added.
Returns:
boolean representing the status of the operation.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

modifyThresholdObject

public boolean modifyThresholdObject(ThresholdObject obj)
                              throws UserTransactionException,
                                     NmsPollException,
                                     java.rmi.RemoteException
Modifies the ThresholdObject which has been added already. That is changes the properties of the ThresholdObject already present in the system to that of the one passed as argument.
Specified by:
modifyThresholdObject in interface PollAPI
Parameters:
obj - ThresholdObject with the properties to be modified.
Returns:
boolean to represent the status of the operation.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

deleteThresholdObject

public boolean deleteThresholdObject(java.lang.String name)
                              throws UserTransactionException,
                                     NmsPollException,
                                     java.rmi.RemoteException
Deletes the ThresholdObject with the name name from the system.
Specified by:
deleteThresholdObject in interface PollAPI
Parameters:
name - Name of the thresholdObject to be deleted.
Returns:
boolean representing the status of the operation.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getAllThresholdObjects

public java.util.Vector getAllThresholdObjects()
                                        throws java.rmi.RemoteException
Returns all the available ThresholdObjects.
Specified by:
getAllThresholdObjects in interface PollAPI
Returns:
the Vector containing ThresholdObjects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

setDebugMode

public void setDebugMode(boolean debug)
                  throws java.rmi.RemoteException
Sets the debugging to true/false based on which some debugging messages will be printed during DataCollection.
Specified by:
setDebugMode in interface PollAPI
Parameters:
debug - true/false.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedValues

public CollectedData getCollectedValues(java.lang.String key,
                                        long timeStart,
                                        long timeEnd)
                                 throws UserTransactionException,
                                        NmsPollException,
                                        java.rmi.RemoteException
Returns the data collected for the PolledData object whose key matches with the key passed, and is collected between the specified time. This method requires the start time and end time as long. This method can be used only in database mode and in serialized mode this returns null.
Specified by:
getCollectedValues in interface PollAPI
Parameters:
key - The key of the PolledData Object whose data are required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
timeStart - The starting time from when the collected data is required. The time is given as a long.
timeEnd - The end time until when the collected data is required as long.
Returns:
CollectedData containing the collected statistics.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedValues

public CollectedData getCollectedValues(java.lang.String key,
                                        long timeStart)
                                 throws UserTransactionException,
                                        NmsPollException,
                                        java.rmi.RemoteException
Returns the data collected for the given PolledData object whose key is given and between the start time specified till the current time . This method requires the start time in long. This method can be used only in database mode and in serialized mode this returns null.
Specified by:
getCollectedValues in interface PollAPI
Parameters:
key - The key of the PolledData Object whose data are required. The key for a PolledData pd is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
timeStart - The starting time from when the collected data is required. The time is given as a long.
Returns:
CollectedData containing the collected statistics.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getThreshHashOfOid

public java.util.Hashtable getThreshHashOfOid()
                                       throws java.rmi.RemoteException
Description copied from interface: PollAPI
Returns a Hashtable containing names of ThresholdObjects associated with oids. In this Hashtable Vector of Threshold Object names are stored against PollingObject name+oid name . For example if a PollingObject with name 'snmpnode' consists of the oid '2.2.1.10' with oid name "INTERFACE_in_octets" and threshold1,threshold2 are the names of ThresholdObjects associated with this oid, then this method will return the Hashtable which contains the Vector of these ThresholdObject names against PollingObject Name+ oid name.
Specified by:
getThreshHashOfOid in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Returns:
Hashtable containing thresholdObject names against the key PollingObject name + oid name.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call

addPollingObject

public void addPollingObject(PollingObject po,
                             boolean updateOldMOs)
                      throws UserTransactionException,
                             NmsPollException,
                             java.rmi.RemoteException
Description copied from interface: PollAPI
Adds a new PollingObject to the Polling Engine. This method takes a PollingObject and a boolean specifying whether to apply this Polling Object to already existing ManagedObjects or not. If this boolean is false ,then this Polling Object will be applicable only to Managed Objects which are discovered later(after addition of this PollingObject). if it is true ,polling will be configured for an already discovered ManagedObject if , Since it is a very costly process it is not advisible to use this option(i.e., setting updateOldMOs to true) unless it is absolutely necessary.
Specified by:
addPollingObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
po - PollingObject to be added.
updateOldMOs - a boolean value specifying whether this Polling Object has to be applied to already discovered ManagedObjects or not.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs while adding PollingObject.
UserTransactionException - if this method is called within a transaction block and if transaction times out

modifyPollingObject

public void modifyPollingObject(PollingObject po,
                                boolean updateOldMOs)
                         throws UserTransactionException,
                                NmsPollException,
                                java.rmi.RemoteException
Description copied from interface: PollAPI
Modifies an existing PollingObject. This method takes a PollingObject and a boolean specifying whether to apply the changes(applicable only if new oids are being added) to already existing ManagedObjects or not. Only the data collection details and status can be modified for a Polling Object. This includes addition of new oids , modification of existing oids(except name , oid string and type) and deletion of existing oids. Modification and deletion of existing oids will have effect on existing PolledDatas. If any new oids are added ,addition of new PolledDatas will depend on the parameter updateOldMOs and the value of PASS_THRO_ALL_POLLING_OBJECTS given in NmsProcessesBE.conf.
Since this is a very costly process it is not advisible to use this option(i.e.,setting updateOldMOs to true) unless it is absolutely necessary.
Specified by:
modifyPollingObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
po - Polling Object to be modified.
updateOldMOs - a boolean specifying whether to apply the changes (if any new oids are added) to already existing ManagedObjects or not.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while modifying the PollingObject
UserTransactionException - if this method is called within a transaction block and if transaction times out

deletePollingObject

public void deletePollingObject(java.lang.String name)
                         throws UserTransactionException,
                                NmsPollException,
                                java.rmi.RemoteException
Description copied from interface: PollAPI
Deletes the PollingObject whose name is passed as a parameter from Polling Engine. Also all the PolledDatas corresponding to this PollingObject will be deleted.
Specified by:
deletePollingObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - name of the PollingObject to be deleted.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while deleting PollingObject and corresponding PolledDatas.
UserTransactionException - if this method is called within a transaction block and if transaction times out

getPollingObject

public PollingObject getPollingObject(java.lang.String name)
                               throws java.rmi.RemoteException,
                                      NmsPollException
Description copied from interface: PollAPI
Returns the PollingObject whose name is passed as a parameter.
Specified by:
getPollingObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - name of the PollingObject to be retrieved.
Returns:
The specified PollingObject.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while getting PollingObject.

getPollingObjects

public java.util.Vector getPollingObjects()
                                   throws java.rmi.RemoteException,
                                          NmsPollException
Description copied from interface: PollAPI
Returns a Vector of all PollingObjects in Polling Engine.
Specified by:
getPollingObjects in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Returns:
A Vector contains all the Polling Objects.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while getting Polling Objects.
See Also:
PollingObject

modifyPropForPollingObject

public void modifyPropForPollingObject(java.lang.String name,
                                       java.util.Properties prop,
                                       boolean updateMOs)
                                throws UserTransactionException,
                                       NmsPollException,
                                       java.rmi.RemoteException
Description copied from interface: PollAPI
modifies properties of a single oid or adds a new oid in the data collection criteria of PollingObject whose of name passed as a parameter. prop represents the new properties of the oid and the boolean updateMOs indicates whether to apply changes to existing ManagedObjects or not(applicable only if the oid is being added).

The properties prop must contain the fields oid ,name and type which form the key of the oid string. If the oid with the oid key is already present in the Polling Object,then all the corresponding PolledDatas will be modified as per the new properties. If such an oid key is not present already , if the boolean updateMOs is false,then the new property will be added as a part of data collection criteria and PolledDatas with this new oid will be created for ManagedObjects which get added later .
On the other hand , if the the boolean updateMOs is true ,

The key refers to key of the oid, name of oid + "::" + oid string + "::" + type of oid .

Specified by:
modifyPropForPollingObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - name of the PollingObject
prop - the new properties of the oid.
updateMOs - a boolean value indicating whether to apply the changes to existing ManagedObjects or not.(applicable only if oid is being added).
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while modification or additon as the case may be.
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
PollingObject

deletePropForPollingObject

public void deletePropForPollingObject(java.lang.String name,
                                       java.lang.String key)
                                throws UserTransactionException,
                                       NmsPollException,
                                       java.rmi.RemoteException
Description copied from interface: PollAPI
Deletes a single oid from the PollingObject whose name is passed as a parameter. The key refers to key of the oid, name of oid + "::" + oid string + "::" + type of oid . If such an oid exists , it's entry in the PollingObject is removed.Also all the corresponding PolledDatas will be deleted.
Specified by:
deletePropForPollingObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - name of the PollingObject
key - key of the oid
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while deleting the oid.
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
PollingObject

getPollingObjectStatus

public boolean getPollingObjectStatus(java.lang.String name)
                               throws java.rmi.RemoteException,
                                      NmsPollException
Description copied from interface: PollAPI
returns the status of the PollingObject,whose name is passed as a parameter to this method.
Specified by:
getPollingObjectStatus in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - name of the Polling Object.
Returns:
status of the Polling Object.
Throws:
java.rmi.RemoteException - if an exception occurs remote call
NmsPollException - if an exception occurs while getting status.
See Also:
PollingObject, PollAPI.setPollingObjectStatus(java.lang.String, boolean)

addPollFilter

public void addPollFilter(java.lang.String className)
                   throws UserTransactionException,
                          NmsPollException,
                          java.rmi.RemoteException
Description copied from interface: PollAPI
Adds a new poll filter to the Polling Engine. PolledDatas which are added will be passed through this filter. The filter must implement PollFilter interface.
Specified by:
addPollFilter in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
className - fully qualified class name of the Poll Filter .
Throws:
java.rmi.RemoteException - if an exception occurs remote call
NmsPollException - if an exception occurs while adding poll filter
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
PollFilter

deletePollFilter

public void deletePollFilter(java.lang.String className)
                      throws UserTransactionException,
                             NmsPollException,
                             java.rmi.RemoteException
Description copied from interface: PollAPI
Deletes an existing poll filter from Poll Engine whose name is passed as an argument. PolledData that are added will be no more passed through this filter.
Specified by:
deletePollFilter in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
className - fully qualified class name of the poll filter to be deleted
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while deleting
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
PollFilter

setPollingObjectStatus

public void setPollingObjectStatus(java.lang.String name,
                                   boolean status)
                            throws UserTransactionException,
                                   NmsPollException,
                                   java.rmi.RemoteException
Description copied from interface: PollAPI
sets status of the PollingObject name to the given value. The default status of a PollingObject is true in which case the active state of PolledDatas will be set as per their individual active property. But if status is explicitly set to true using this method , active state of all PolledDatas of this PollingObject will be set to true. Similarly if status is false, active state of PolledDatas will be set to false. The active property of a PolledData indicates whether polling is being done currently for that PolledData or not.Setting active to false suspends polling for the PolledData.
Specified by:
setPollingObjectStatus in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - name of the PollingObject whose status is to be set.
status - status of PollingObject whether true or false.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while setting status
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
PollingObject, PollAPI.getPollingObjectStatus(java.lang.String)

addReport

public void addReport(ReportObject ro)
               throws UserTransactionException,
                      NmsPollException,
                      java.rmi.RemoteException
Description copied from interface: PollAPI
Adds a new report to the Polling Engine. The className in the ReportObject must implement Reporter interface. If time for report generation is not set in the ReportObject(setTimeVal() method) , this method takes care of setting up the time depending on the parameters given in ReportObject like whether it is a daily report / weekly report etc.,
Specified by:
addReport in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
ro - The ReportObject to be added.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs while adding report.
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
PollAPI.scheduleReport(String,long), Reporter

deleteReport

public void deleteReport(java.lang.String name)
                  throws UserTransactionException,
                         NmsPollException,
                         java.rmi.RemoteException
Description copied from interface: PollAPI
Deletes an existing report with the class name, whose name is passed as a parameter.
Specified by:
deleteReport in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - fully qualified class name of the report to be deleted.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call
NmsPollException - if an exception occurs while deleting report.
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
ReportObject

scheduleReport

public void scheduleReport(java.lang.String name,
                           long timeval)
                    throws UserTransactionException,
                           NmsPollException,
                           java.rmi.RemoteException
Description copied from interface: PollAPI
Schedules an existing report to be run at a given time. The timeval given will override the default report generation time.If timeval is less than current time, the report will be run immediately.After running the report at the given timeval, the next report generation time will be set depending on the type of the report(daily/weekly etc).
Specified by:
scheduleReport in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - fully qualified class name of the report to be scheduled.
timeval - the time in milliseconds at which the report should be run.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs while scheduling report.
UserTransactionException - if this method is called within a transaction block and if transaction times out
See Also:
ReportObject

register

public void register(PollUnitObserver pdObs)
              throws java.rmi.RemoteException,
                     NmsPollException
Registers for getting the notifications whenever a PolledData is added/modified/deleted.
Specified by:
register in interface PollAPI
Parameters:
pdObs - a PollUnitObserver Observer which needs to get the notification.
Throws:
java.rmi.RemoteException - if an error occurs during remote call.
NmsPollException - if an error occurs during registering.

deRegister

public void deRegister(PollUnitObserver pdObs)
                throws java.rmi.RemoteException,
                       NmsPollException
Deregisters this observer from getting the notifications whenever a PolledData is added/modified/deleted.
Specified by:
deRegister in interface PollAPI
Parameters:
pdObs - a PollUnitObserver. Observer that was getting notifications.
Throws:
java.rmi.RemoteException - if an error occurs during remote call.
NmsPollException - if an error occurs during registering.

addProtocolProvider

public void addProtocolProvider(java.lang.String protocol,
                                ProtocolProvider prov)
                         throws UserTransactionException,
                                NmsPollException,
                                java.rmi.RemoteException
Adds a new ProtocolProvider class for the protocol provided.
Specified by:
addProtocolProvider in interface PollAPI
Parameters:
protocol - String for which provider is added.
prov - a ProtocolProvider.
Throws:
java.rmi.RemoteException - if an error occurs
NmsPollException - if an error occurs

deleteProtocolProvider

public void deleteProtocolProvider(java.lang.String protocol)
                            throws UserTransactionException,
                                   NmsPollException,
                                   java.rmi.RemoteException
Deletes the Provider Class defined for this protocol.
Specified by:
deleteProtocolProvider in interface PollAPI
Parameters:
protocol - String for which provider is deleted.
Throws:
java.rmi.RemoteException - if an error occurs
NmsPollException - if an error occurs

addCreateSchema

public void addCreateSchema(java.lang.String tableName,
                            java.lang.String schema)
                     throws UserTransactionException,
                            NmsStorageException,
                            java.rmi.RemoteException
This method adds a new table and a respective schema to create that table.When this table name is given for the PolledData the table will be created and the Collected Data will be stored in this table.
Specified by:
addCreateSchema in interface PollAPI
Parameters:
tableName - name of the table
schema - String which used to create the table
Throws:
NmsStorageException - if an error occurs while adding the schema.

getCreateSchema

public java.lang.String getCreateSchema(java.lang.String tableName)
                                 throws java.rmi.RemoteException
This method returns the schema that is used for creating the table that is specified.
Specified by:
getCreateSchema in interface PollAPI
Parameters:
tableName - name of the table for which schema is returned.
Returns:
The String which is the schema used to create this table

createTable

public void createTable(java.lang.String tableName)
                 throws UserTransactionException,
                        NmsStorageException,
                        java.rmi.RemoteException
This method creates the table that is given as the paranmeter. If the schema for creation of this table is already present then table will be created according to this schema else table will be create using the default schema.
Specified by:
createTable in interface PollAPI
Parameters:
tabName - the name of the table which will be created.

checkOut

public PolledData checkOut(java.lang.String key)
                    throws UserTransactionException,
                           NmsPollException,
                           java.rmi.RemoteException
Newly added methods of PollAPI for Object Locking support !!
Specified by:
checkOut in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
key - The unique key of the PolledData to be checked out
Returns:
PolledData, if it is present in the database, null, if not present in the database
Throws:
UserTransactionException - if this method is called within a transaction block and if transaction times out
NmsPollException - if the object is not available for writing
java.rmi.RemoteException - if an exception occurs during remote call
See Also:
PollAPI.checkOut(String,int)

checkOut

public PolledData checkOut(java.lang.String key,
                           int timeOut)
                    throws UserTransactionException,
                           NmsPollException,
                           java.rmi.RemoteException
Description copied from interface: PollAPI
Checks out the PolledData with the given key from the database for writing, with a write lock. If the PolledData to be checked out is currently locked by some other thread, this method keeps trying to check out the object for the specified time. If the PolledData becomes available for writing before the specified time, the object is fetched from the database, locked and returned back. Returns null if the PolledData is not present in the database.
Specified by:
checkOut in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
key - The unique key of the PolledData to be checked out
timeOut - Time in seconds to wait, if the object is locked by some other thread.
Returns:
PolledData, if it is present in the database, null, if not present in the database
Throws:
UserTransactionException - if this method is called within a transaction block and if transaction times out
NmsPollException - if the object is not available for writing even after the specified amount of time.
java.rmi.RemoteException - if an exception occurs during remote call
See Also:
PollAPI.checkOut(String)

checkOutIfAvailable

public PolledData checkOutIfAvailable(java.lang.String key)
                               throws UserTransactionException,
                                      NmsPollException,
                                      java.rmi.RemoteException
Description copied from interface: PollAPI
Checks out the PolledData with the given key from the database for writing, with a write lock. This method throws an Exception if the managed object is locked by another thread and if the thread doesn't wait.
Specified by:
checkOutIfAvailable in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
key - The unique key of the PolledData to be checked out
Returns:
PolledData, if it is present in the database, null, if not present in the database
Throws:
UserTransactionException - if this method is called within a transaction block and if transaction times out
java.rmi.RemoteException - if a problem occurs when accessing through RMI.
NmsPollException - if the object is locked by some other thread

lock

public PolledData lock(PolledData obj,
                       int lock_type,
                       int timeout)
                throws java.rmi.RemoteException,
                       NmsPollException
Description copied from interface: PollAPI
Applies the specified lock to the PolledData. This method will lock the specified PolledData, by applying the given type of lock, which will actually define access levels for the object. This interface defines the lock types and various other methods to implement the locking mechanism as required by the user. The third argument specifies the time in seconds as to how long to wait to obtain the lock for the PolledData.
Specified by:
lock in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
obj - The PolledData that is to be locked.
lock_type - The type of lock to be applied.
timeout - Time, in seconds, to wait to acquire the lock.
Returns:
The PolledData with the lock set in it's lockId property.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs during locking.
See Also:
LockableObject

unlock

public void unlock(PolledData obj)
            throws java.rmi.RemoteException,
                   NmsPollException
Description copied from interface: PollAPI
Unlocks the specified PolledData. This method will unlock the given instance of PolledData, releving it from all the previously applied locks.
Specified by:
unlock in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
obj - The PolledData that is to be unlocked.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs during unlock.
See Also:
LockableObject

checkWritePermission

public boolean checkWritePermission(PolledData obj)
                             throws java.rmi.RemoteException,
                                    NmsPollException
Description copied from interface: PollAPI
Checks whether this instance of the PolledData can be written to the database. This method checks whether the specified instance of the PolledData currently holds a valid write lock, so that it can be written to the database.
Specified by:
checkWritePermission in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
obj - The PolledData instance that is to be checked whether it has a write lock.
Returns:
true if the object holds a write lock, false otherwise.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs while checking the permission for writing.
See Also:
LockableObject

getCurrentLockType

public int getCurrentLockType(PolledData obj)
                       throws java.rmi.RemoteException,
                              NmsPollException
Description copied from interface: PollAPI
Gets the type oflock currently held by the specified instance of the PolledData. This method is useful in finding out what type of lock this instance of the PolledData holds, when multiple instances hold different types of locks.
Specified by:
getCurrentLockType in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
obj - PolledData instance for which the lock type is to be obtained.
Returns:
The lock type value, as defined in the LockableObject interfae, currently held by the specified instance of the PolledData. If the object instance is not locked previously, this method returns UNKNOWN_LOCK.
Throws:
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs while getting the lock type.

clearLockForObject

public void clearLockForObject(java.lang.String name,
                               int lockType)
                        throws UserTransactionException,
                               NmsPollException,
                               java.rmi.RemoteException
Description copied from interface: PollAPI
Releases the specified lock type unconditionally for the PolledData with the given name. If under some exceptional condition, a PolledData instance that was holding a lock, is lost before it has unlocked, then it will result in all subsequent requests for locks over that PolledData to fail. In such a case, this method can be used to unconditionally release the specified lock type by giving just the name of the PolledData. But the effect of this method depends entirely on the implementation of the LockableObject interface.
Specified by:
clearLockForObject in interface PollAPI
Following copied from interface: com.adventnet.nms.poll.PollAPI
Parameters:
name - Name of the PolledData to be unlocked.
lockType - Type of the lock to be unlocked.
Throws:
UserTransactionException - if this method is called within a transaction block and if transaction times out.
NmsPollException - if there is any exception while retrieving PolledData .
java.rmi.RemoteException - if an exception occurs during remote call.
NmsPollException - if an exception occurs while clearing the lock.

removePoll

public boolean removePoll(PolledData pd,
                          boolean dealWithLocks)
                   throws java.rmi.RemoteException,
                          NmsPollException,
                          UserTransactionException
Stops the Snmp Poll identified by the key and also deletes the corresponding PolledData object from the polling engine database. This checks for lock if the second parameter is true.
Specified by:
removePoll in interface PollAPI
Parameters:
keyer - The key for the PolledData object.The key is pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
dealWithLocks - boolean suggesting whether to check for locking or not.
Returns:
"true" if PolledData with the given key is removed successfully, "false" if PolledData could not be removed or if PolledData with the given key could not be found.
Throws:
UserTransactionException - if there is any exception while doing transaction operations.

modifyPoll

public void modifyPoll(PolledData pdata,
                       boolean dealWithLocks)
                throws java.rmi.RemoteException,
                       NmsPollException,
                       UserTransactionException
Modify a PolledData element whose key matches with the key of PolledData passed as as a parameter . This also checks whether the object is locked if the second parameter is true. If the key of the PolledData, passed as the argument, matches that of any other PolledData object already in the database, then that PolledData's properties will be changed to the given PolledData's properties. Else the given PolledData will be added as a new PolledData and the Poll is started for this.
Specified by:
modifyPoll in interface PollAPI
Parameters:
pdata - The PolledData object to be modified.
dealWithLocks - boolean to check for locking.
Throws:
UserTransactionException - if there is any exception while doing transaction operations.

addPolledDataForMO

public void addPolledDataForMO(ManagedObject mo)
                        throws java.rmi.RemoteException,
                               NmsPollException,
                               UserTransactionException
Adds PolledData to the Polling Engine for the ManagedObject which is passed as a parameter. This can be used when the discovery process is not used and the ManagedObjects are not added by using TopoAPI, and PolledData needs to be configured for these ManagedObjects. This ManagedObject is passed through all the PollingObjects and if it satisfies any of the match criteria of PollingObject, PolledDatas are added. These PolledDatas are passed through PollFilters also.

If data collection is using SNMP, an instance of either SnmpNode or SnmpInterface (sub classes of ManagedObject) should be passed to this method. For SnmpNode object,oids of type 'node' or 'multiple' (given in Polling.conf) will be added and for SnmpInterface object 'interface' type oid will be added. The necessary fields which should be set in this case are
name, ipAddress, isDHCP, isNode, isInterface, isSNMP, snmpport (default-161), community(default-public), version, userName and contextName. In this userName and contextName are only applicable only if version is v3.

For other protocols , the ManagedObject passed should be an instance of TopoObject . The necessary fields which should be set in this case are
name,ipAddress,isDHCP

The agent name of the PolledData is set as follows:

  • If isDHCP is set to true, the agent name of the PolledDatas created will be the name of the ManagedObject. If name starts with "IF-" , the agent name is set after removing "IF-".
  • if isDHCP is false, dnsname is obtained using the ipAddress provided and is set as agent names for PolledDatas.
    Specified by:
    addPolledDataForMO in interface PollAPI
    Parameters:
    mo - ManagedObject for which the PolledData is to be added.
    Throws:
    NmsPollException - if ,
    • there is any problem while retrieving the corresponding ManagedObject
    • PolledData with the given key already exists.
    • PolledData key is not formed properly.
    • if dynamic table is not created properly at run time (this is applicable only if dynamic table feature is used). if there is any exception while adding PolledData
    UserTransactionException - if there is any exception while doing transaction operations.
    java.rmi.RemoteException - if an exception occurs during remote call.
    See Also:
    addPoll(PolledData)

  • dataUpdate

    public void dataUpdate(java.lang.String pollkey,
                           long time,
                           long value)
                    throws java.rmi.RemoteException
    Description copied from interface: PollObserver
    This is the method called in case of the collected data being a numeric.
    Specified by:
    dataUpdate in interface PollObserver
    Following copied from interface: com.adventnet.nms.poll.PollObserver
    Parameters:
    pollkey - The unique key of the PolledData object. The key for a PolledData pd is
    pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
    time - The time of statistics collection.
    value - The value of the collected statistic.
    Throws:
    RemoteException - if an exception occurs during remote call.
    See Also:
    PollAPI.registerForData(String,PollObserver)

    dataUpdate

    public void dataUpdate(java.lang.String pollkey,
                           long time,
                           java.lang.String value)
                    throws java.rmi.RemoteException
    Description copied from interface: PollObserver
    This is the method called in case of the collected data being a String.
    Specified by:
    dataUpdate in interface PollObserver
    Following copied from interface: com.adventnet.nms.poll.PollObserver
    Parameters:
    pollkey - The unique key of the PolledData object. The key for a PolledData pd is
    pd.name+"\t"+pd.agent.toLowerCase().trim()+"\t"+pd.oid
    time - The time of statistics collection.
    value - The value of the collected statistic.
    Throws:
    RemoteException - if an exception occurs during remote call.
    See Also:
    PollAPI.registerForData(String,PollObserver)

    dataUpdate

    public void dataUpdate(CollectedInfo colinfo)
                    throws java.rmi.RemoteException
    Description copied from interface: PollObserver
    Called when intimation about data collection has to be done for all PolledData objects of an agent as a set or for all data, i.e., when the observer has registered for all PolledData objects of a particular agent or registered for all data.
    Specified by:
    dataUpdate in interface PollObserver
    Following copied from interface: com.adventnet.nms.poll.PollObserver
    Parameters:
    colinfo - Instance of CollectedInfo object containing details about the collected data.
    Throws:
    RemoteException - if an exception occurs during remote call.
    See Also:
    CollectedInfo, PollAPI.registerForDataFromAgent(String,PollObserver), PollAPI.registerForAllData(PollObserver)

    update

    public void update(int type,
                       PolledData pd)
                throws java.rmi.RemoteException
    Description copied from interface: PollUnitObserver
    This is called when a PolledData is added/modified/deleted .
    Specified by:
    update in interface PollUnitObserver
    Following copied from interface: com.adventnet.nms.poll.PollUnitObserver
    Parameters:
    type - specifies whether PolledData is added, modified or deleted. Type can be
    • PollConstants.ADD_NEW_OBJECT if a new PolledData is added.
    • PollConstants.MODIFY_OBJ_DETAILS if a PolledData is modified.
    • PollConstants.REMOVE_OBJECT for deletion of a PolledData.
    pd - PolledData which is added/modified/deleted.
    Throws:
    java.rmi.RemoteException - if an exception occurs during remote call.

    update

    public void update(java.util.Vector pdVect)
                throws java.rmi.RemoteException
    Description copied from interface: PollUnitObserver
    This is called when all PolledData for a particular agent are deleted or when a ManagedObject is deleted, which results in PolledDatas of that ManagedObject getting deleted. The Vector contains the PolledData's which are deleted.
    Specified by:
    update in interface PollUnitObserver
    Following copied from interface: com.adventnet.nms.poll.PollUnitObserver
    Parameters:
    pdVect - Vector of PolledDatas.
    Throws:
    java.rmi.RemoteException - if an exception occurs during remote call.
    See Also:
    PollAPI.deletePoll(String)

    update

    public void update(XMLNode node)
                throws java.rmi.RemoteException
    Description copied from interface: PollUnitObserver
    This method is called when a bulk delete is done. A bulk delete operation results when TopoAPI.deleteObjectAndSubElements() is used for deleting a network object or an object that is a parent of a Container relationship or group relationship. The parameter that is passed is an XMLNode that would have the key of the object to be deleted and a SQL Query which when executed gives the keys of the child objects to be deleted. The pattern of the XMLNode would be like the one given below.
     <BULK_DELETE_INFO>
    	  <DATA
             sqlQuery="select * from PolledData where PARENTOBJ in ( '192.168.4.0',
                      '192.168.4.1', 'topont', 'pollnt' ) and OWNERNAME like 'null'"
    	       parentObjectKey="192.168.4.0" />
        <PROPS
    	       parentKey="192.168.4.0" />
     </BULK_DELETE_INFO>
     
    Applications implementing this interface can execute this SQL query to get all the PolledData objects to be deleted. If the database access is not available to the application, the application can get the keys of the Managed Objects to be deleted using the method TopoAPI.getObjectNamesWithProps() by passing to it, the properties provided under the <PROPS> tag of the XML notification. From the names of the ManagedObject obtained, by using the PollAPI.getObjectNamesWithProps(), the PolledData keys corresponding to the ManagedObject name can be obtained. The parentObj field in PolledData represents the name of the parent ManagedObject for which this PolledData was created. The parentObjectKey will contain the ownerName also appended with it, when the ownerName is not null.
    Specified by:
    update in interface PollUnitObserver
    Following copied from interface: com.adventnet.nms.poll.PollUnitObserver
    Parameters:
    node - a XMLNode value.
    Throws:
    java.rmi.RemoteException - if an exception occurs during remote call
    See Also:
    PollAPI

    update

    public void update(int type,
                       PollingObject po)
                throws java.rmi.RemoteException
    Description copied from interface: PollUnitObserver
    This method is called when there is any add/modify/delete/status change of PollingObject occurs. The modify/delete of PollingObject results in Updation and Deletion of PolledDatas respectively.
    Specified by:
    update in interface PollUnitObserver
    Following copied from interface: com.adventnet.nms.poll.PollUnitObserver
    Parameters:
    type - a String of operation. It can be
    • PollConstants.ADD_POLLING_OBJECT if a new PollingObject is added.
    • PollConstants.MODIFY_POLLING_OBJECT if a PollingObject is modified.
    • PollConstants.DELETE_POLLING_OBJECT if a PollingObject is deleted.
    • PollConstants.SET_STATUS_POLLING_OBJECT for status change of PollingObject.
    po - a PollingObject.
    Throws:
    java.rmi.RemoteException - if an exception occurs during remote call
    See Also:
    PollingObject, PollConstants

    shutDown

    public void shutDown()
    Gets called whenever Web NMS Server shuts down.
    Specified by:
    shutDown in interface ShutDownObserver

    preBEFailOverNotification

    public void preBEFailOverNotification(BEFailOverEvent event)
    Description copied from interface: BEFailOverListener
    Indicates that the BE server, to which the FE server is connected, has failed and the FE server is going to try to connect to the standby BE server.

    The FE server, on detecting the BE server failure, intimates all the BEFailOverListeners through this method and makes an attempt to switch over to the standby BE server. The attempt to switch over may fail, and this notification does not imply anything about the outcome of the switch over operation.

    Specified by:
    preBEFailOverNotification in interface BEFailOverListener
    Following copied from interface: com.adventnet.nms.fe.common.BEFailOverListener
    Parameters:
    beFailOverEvent - An event object indicating BE fail over, containing details about the failed BE server and the current primary BE server
    See Also:
    BEFailOverListener.postBEFailOverNotification(BEFailOverEvent), MainSocketClientFE.registerBEFailOverListener(BEFailOverListener), MainSocketClientFE.deRegisterBEFailOverListener(BEFailOverListener)

    postBEFailOverNotification

    public void postBEFailOverNotification(BEFailOverEvent beEvent)
    Description copied from interface: BEFailOverListener
    Indicates that the FE server has successfully switched over its connection to the current primary BE server.

    The FE server, on successfully switching over to the current primary BE server, notifies all the BEFailOverListeners through this method. This notification is the confirmation that the switch over operation has been successful.

    Specified by:
    postBEFailOverNotification in interface BEFailOverListener
    Following copied from interface: com.adventnet.nms.fe.common.BEFailOverListener
    Parameters:
    beFailOverEvent - An event object indicating BE fail over, containing details about the failed BE server and the current primary BE server
    See Also:
    BEFailOverListener.preBEFailOverNotification(BEFailOverEvent), MainSocketClientFE.registerBEFailOverListener(BEFailOverListener), MainSocketClientFE.deRegisterBEFailOverListener(BEFailOverListener)

    AdventNet Web NMS 4 API Specification