AdventNet Web NMS 4 API Specification

com.adventnet.nms.fe.perf
Class PerfSessionBean

java.lang.Object
  |
  +--com.adventnet.nms.fe.common.CustomSessionBean
        |
        +--com.adventnet.nms.fe.perf.PerfSessionBean
All Implemented Interfaces:
SessionNarrowerInterface
Direct Known Subclasses:
PerfSessionEJB

public class PerfSessionBean
extends CustomSessionBean

This class is the bean implementation of PerfSession. This holds the reference of ThinPerfAPI and acts as wrapper for update/write requests like deletePoll, getCollectedData, etc. send by the client. Also as it extends CustomSessionBean, the customview related operations are also taken care.

Since:
Web NMS 2.3
See Also:
CustomSessionBean

Fields inherited from class com.adventnet.nms.fe.common.CustomSessionBean
apihandle, cvScopeAPI, cvu, dbUtility, jdbcapi, latest, logapi, module, tableName
 
Constructor Summary
PerfSessionBean()
          default constructor called while bean instantiation
 
Method Summary
 void deletePoll(java.lang.String userName, java.lang.String name)
          Stops data collection for all the PolledData objects whose agent name is the name passed as a parameter and removes the PolledData objects from the Polling Engine database .
 boolean deleteThresholdObject(java.lang.String userName, java.lang.String name)
          Deletes the ThresholdObject with the name as the name passed, from the system.
 java.util.Vector getActivePollers(java.lang.String userName)
          Returns the names of all the active pollers at that time.
 java.util.Vector getAllThresholdObjectsProps(java.lang.String userName)
          Returns Properties of all the available ThresholdObjects.
 CollectedData getCollectedData(java.lang.String userName, java.lang.String index, java.lang.String key, long timeStart, long timeEnd)
          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.
 ViewData getData(ViewCriteria criteria)
          Gets all the PolledData in the system
protected  java.util.Properties getDefaultPanelProps()
          Returns default Panel Properties that can be used for createCustomView & modifyCustomView.
protected  java.lang.String getModuleName()
          Gets module of the extending class.
 int getNumPollObjects(java.lang.String userName)
          Returns the total number of PolledData objects currently present in the Polling engine.
 java.util.Vector getObjectNamesWithProps(java.lang.String userName, java.util.Properties p)
          Returns all the PolledData objects matching the Properties.
 java.util.Vector getObjectsProps(java.lang.String userName, java.lang.String classname, java.util.Properties match)
          Returns the Vector of Properties of PolledData objects matching the given properties.
 java.util.Vector getPollingObjects(java.lang.String userName)
          Returns all PollingObjects in NMS
 java.util.Vector getPollsForAgent(java.lang.String userName, java.lang.String agentname)
          Returns the keys of all the PolledData objects configured for an agent.
 java.util.Properties getPropertiesOfObject(java.lang.String userName, java.lang.String key)
          Returns the Properties of an PolledData Object specified by its unique key.
 boolean removePoll(java.lang.String userName, java.lang.String key)
          stops the data collection for the PolledData object identified by the key and deletes the corresponding PolledData object from the polling engine database.
 void setAPI(CommonAPI obj)
          session narrowerinterface impl method for setting the api to be used for the bean.
 void setConnection(java.sql.Connection con)
          setConnection method uses the connection and to create instances for CustomViewUtility and DBXmlUtility.
 
Methods inherited from class com.adventnet.nms.fe.common.CustomSessionBean
createCustomView, createCustomView, error, getAllViewIDsAndProps, getCriteriaProps, getInstance, getLatest, getTableColumnsArr, getTotalCount, getTotalCount, getTotalCount, getViewProperties, log, modifyCustomView, removeCustomView, renameCustomView, saveViewState, setCustomViewScopeAPI, setJdbcAPI, setLogAPI, setSeverityAPI, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerfSessionBean

public PerfSessionBean()
default constructor called while bean instantiation
Method Detail

setConnection

public void setConnection(java.sql.Connection con)
setConnection method uses the connection and to create instances for CustomViewUtility and DBXmlUtility.
Parameters:
con - a Connection value

getModuleName

protected java.lang.String getModuleName()
Gets module of the extending class.
Overrides:
getModuleName in class CustomSessionBean
Returns:
module name

getDefaultPanelProps

protected java.util.Properties getDefaultPanelProps()
Returns default Panel Properties that can be used for createCustomView & modifyCustomView.
Overrides:
getDefaultPanelProps in class CustomSessionBean
Returns:
default panel properties

setAPI

public void setAPI(CommonAPI obj)
session narrowerinterface impl method for setting the api to be used for the bean. Not used in EJB mode. because these api's are looked up via JNDI.
Overrides:
setAPI in class CustomSessionBean
Following copied from interface: com.adventnet.nms.fe.common.SessionNarrowerInterface
Parameters:
comapi - a CommonAPI instance to be used by this Session Bean.

deletePoll

public void deletePoll(java.lang.String userName,
                       java.lang.String name)
                throws java.rmi.RemoteException
Stops data collection for all the PolledData objects whose agent name is the name passed as a parameter and removes the PolledData objects from the Polling Engine database .
Parameters:
userName - The name of the user which will be used for authentication and logging.
name - The agent name of the PolledData object for which data collection is to be stopped and the PolledData objects are deleted.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

removePoll

public boolean removePoll(java.lang.String userName,
                          java.lang.String key)
                   throws java.rmi.RemoteException
stops the data collection for the PolledData object identified by the key and deletes the corresponding PolledData object from the polling engine database.
Parameters:
userName - The name of the user which will be used for authentication and logging.
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:
java.rmi.RemoteException - if an error occurs during remote call

getCollectedData

public CollectedData getCollectedData(java.lang.String userName,
                                      java.lang.String index,
                                      java.lang.String key,
                                      long timeStart,
                                      long timeEnd)
                               throws 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 MultiplePolledDatas. 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.
Parameters:
userName - The name of the user which will be used for authentication and logging.
index - the instance string whose value is needed.
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

getPollsForAgent

public java.util.Vector getPollsForAgent(java.lang.String userName,
                                         java.lang.String agentname)
                                  throws 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
Parameters:
userName - The name of the user which will be used for authentication and logging.
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

getObjectsProps

public java.util.Vector getObjectsProps(java.lang.String userName,
                                        java.lang.String classname,
                                        java.util.Properties match)
                                 throws java.rmi.RemoteException
Returns the Vector of Properties 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.
Parameters:
userName - The name of the user which will be used for authentication and logging.
classname - name of the class the object belongs.
match - properties which is to be matched with the object's properties.
Returns:
Vector of properties of PolledData objects match the properties given.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getNumPollObjects

public int getNumPollObjects(java.lang.String userName)
                      throws java.rmi.RemoteException
Returns the total number of PolledData objects currently present in the Polling engine.
Parameters:
userName - The name of the user which will be used for authentication and logging.
Returns:
int number of PolledData objects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getActivePollers

public java.util.Vector getActivePollers(java.lang.String userName)
                                  throws java.rmi.RemoteException
Returns the names of all the active pollers at that time.
Parameters:
userName - The name of the user which will be used for authentication and logging.
Returns:
Vector containing names of ActivePollers as String.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

deleteThresholdObject

public boolean deleteThresholdObject(java.lang.String userName,
                                     java.lang.String name)
                              throws java.rmi.RemoteException
Deletes the ThresholdObject with the name as the name passed, from the system.
Parameters:
userName - The name of the user which will be used for authentication and logging.
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

getAllThresholdObjectsProps

public java.util.Vector getAllThresholdObjectsProps(java.lang.String userName)
                                             throws java.rmi.RemoteException
Returns Properties of all the available ThresholdObjects.
Parameters:
userName - The name of the user which will be used for authentication and logging.
Returns:
the Vector containing Properties of ThresholdObjects.
Throws:
java.rmi.RemoteException - if an error occurs during remote call

getPollingObjects

public java.util.Vector getPollingObjects(java.lang.String userName)
                                   throws java.rmi.RemoteException,
                                          NmsPollException
Returns all PollingObjects in NMS
Parameters:
userName - The name of the user which will be used for authentication and logging.
Returns:
A Vector contains all the Polling Object in NMS
Throws:
java.rmi.RemoteException - if an error occurs during remote call
NmsPollException - if an error occurs while getting Polling Objects.

getPropertiesOfObject

public java.util.Properties getPropertiesOfObject(java.lang.String userName,
                                                  java.lang.String key)
                                           throws java.rmi.RemoteException
Returns the Properties of an PolledData Object specified by its unique key.
Overrides:
getPropertiesOfObject in class CustomSessionBean
Parameters:
userName - The name of the user which will be used for authentication and logging.
a - key The keyof the PolledData Object whose properties is to be returned.
Returns:
The Properties of the PolledData Object identified by its key.

getObjectNamesWithProps

public java.util.Vector getObjectNamesWithProps(java.lang.String userName,
                                                java.util.Properties p)
                                         throws java.rmi.RemoteException
Returns all the PolledData objects matching the Properties.
Overrides:
getObjectNamesWithProps in class CustomSessionBean
Parameters:
userName - The name of the user which will be used for authentication and logging.
p - The properties with which to filter out PolledData.
Returns:
The Vector of all the PolledData Object entities matching the Properties.

getData

public ViewData getData(ViewCriteria criteria)
                 throws java.rmi.RemoteException,
                        com.adventnet.nms.fe.common.CustomViewException
Gets all the PolledData in the system
Overrides:
getData in class CustomSessionBean
Parameters:
userName - The name of the user which will be used for authentication and logging.
Returns:
The Vector of all the PolledData entities in the system.

AdventNet Web NMS 4 API Specification