"WEBNMS_5 API Docs"

com.adventnet.nms.poll
Class PolledData

java.lang.Object
  extended by com.adventnet.nms.poll.PolledData
All Implemented Interfaces:
com.adventnet.nms.poll.corba.PolledData_CIOperations, DBExtendedInterface, DBInterface, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
MultiplePolledData

public class PolledData
extends java.lang.Object
implements java.io.Serializable, DBExtendedInterface, com.adventnet.nms.poll.corba.PolledData_CIOperations

The PolledData represents the basic unit for data collection i.e., when, where and what of data collection. They are created and added to the poll engine via PollAPI, and the poll engine takes care of collecting the data for this PolledData Objects. At start up PolledData Objects are created by reading the Polling.conf. Users can also add PolledData Objects at run time using PollAPI or through UI.

Data Collection:
Data collection is protocol independent and the protocol using which data is collected for a PolledData is represented by the field protocol.

Data Storage:
Ths collected statistic can be stored either in CSV files or database or both. By default, the collected values will be stored STATSDATAmm_dd_yyyy or STRINGDATAmm_dd_yyyy tables where 'mm','dd' and 'yyyy' represents current month, date and year respectively. Collected statistic can also be stored in customized tables.

See Also:
ThresholdObject, PollAPI.addPoll(PolledData), PollAPI.addPolledData(PolledData,boolean), Serialized Form

Field Summary
protected static boolean isPoller
          whether poller is associated with this PolledData.
protected static PollAPI pollapi
          the PollAPI instance associated with this PolledData.
 
Constructor Summary
PolledData()
           
 
Method Summary
 void checkAgainstThresholds(long time, long val)
           
 void checkAgainstThresholds(long time, java.lang.String val)
           
 java.lang.Object clone()
          Returns a new object which is a clone of this.
 boolean getActive()
          Returns a boolen representing the state of the PolledData - whether active or inactive.
 java.lang.String getAgent()
          Returns the agent from which data is collected.
 java.lang.String getCommunity()
          Returns the community string of this PolledData.
 java.lang.String getContextName()
          Returns the value of contextName.
 boolean getCounterUpdateRequired()
           
 int getCurrentSaveCount()
          Returns the value of current count of data collected after the last save.
 java.lang.String getDnsName()
          Returns the IP address / DNS name of the agent to collect data from.
 java.lang.Object getDynamicUserProperty(java.lang.String nam)
           
 java.lang.String getExtension()
          Returns the string to be appended in the message of the threshold events generated by this PolledData.
 int getFailureCount()
          Returns the failureCount for this PolledData.
 int getFailureThreshold()
          Returns the failureThreshold for this PolledData.
 java.lang.String getGroupName()
          Returns the polling group that this polled Data belongs to.
 long getId()
          Returns the id of the PolledData.
 java.lang.String getInstance()
          Returns the instance of the oid which is being currently referred.
 boolean getIsMultiplePolledData()
          Returns whether multiple oids are being polled by this PolledData.
 java.lang.String getKey()
          To get the key of this PolledData object.
 java.lang.String getKeyName()
          To get the key of this PolledData object.
 long getLastCounterValue()
          Returns the value collected during the previous poll for this PolledData.
 long getLastTimeValue()
          Returns the time in milliseconds since epoch, when this PolledData was last polled.
 java.lang.Object getLockId()
          Gets the current lock object associated with the PolledData.
 boolean getLogDirectly()
          Returns whether the data is being logged directly to a log file in CSV(Comma Separated values) format-for spreadsheets.
 java.lang.String getLogFile()
          Returns the verbose CSV(Comma Separated Values) log file name.
 java.util.Map getMappedProperties()
           
 java.lang.String getName()
          Returns the name of the PolledData.
 int getNumericType()
          Returns the type of data that this PolledData will collect.
 java.lang.String getOid()
          Returns the oid that is being polled from an agent.
 java.lang.String getOwnerName()
          Deprecated. as of Web NMS 5
 java.lang.String getParentObj()
          returns the name of the managed Object corresponding to this PolledData.
 int getPeriod()
          Returns the polling interval of this PolledData in seconds.
 java.lang.String getPolicyName()
          Returns the name of the PollingObject which controls this PolledData.
 java.lang.String getPollerName()
          Returns the name of the remote poller which is responsible for collecting data via this poller.
 int getPort()
          To get the port number on the agent which is being polled.
 int getPreviousSeverity()
          Returns the severity of the event last generated by this PolledData.
 com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
          corba: PolledData_CIOperations interface method.
 java.util.Properties getProperties()
          Returns the object's properties .
 java.lang.String getProtocol()
          returns the protocol string.
 boolean getSave()
          Returns whether the collected data is stored in compact form in database- for reports, charts, etc.
 boolean getSaveAbsolutes()
          Returns whether absolute values of the counters are stored or not.
 boolean getSaveOnThreshold()
          Returns whether to store collected data only when an associated threshold is satisfied and threshold event is generated.
 int getSavePollCount()
          Returns the number of times after which the collected data is to be stored.
 java.lang.String getSnmpVersion()
          Returns the value of snmpVersion.
 java.lang.String getStatsDataTableName()
          Returns the name of the table where the data collected for this PolledData should be stored.
 java.lang.String getSuffix()
          Returns the index of the OID for which the data is collected.
 boolean getThreshold()
          Returns whether threshold checking is being done for the collected data.
 java.lang.String getThresholdList()
          Get the value of thresholdList.
 java.util.Vector getThresholdNames()
          Returns the ThresholdObject names which is associated with this PolledData.
 PollTieRefHolder getTieRefHolder_PolledData()
          Returns the TieHolder of this PolledData.
 boolean getTimeAvg()
          storage option specifying whether to store time average collected values or not.
 long getTimeVal()
          Returns the time in milli seconds since epoch, as to when the PolledData has to be polled again.
 java.lang.String getUserName()
          Returns the value of userName.
 java.util.Properties getUserProperties()
          Get all the user properties of the PolledData.
 java.lang.String getUserProperty(java.lang.String name)
          Get the value of the user property with the given name (key).
 java.lang.String getWebNMS()
          the WebNMS server that owns this PolledData.
 boolean logAllData(java.lang.String logFile)
          Log all collected data for the current day to specified file.
 boolean logAllData(java.lang.String logFile, java.util.Date date)
          Logs all collected data for the given date to specified file
 boolean logAllData(java.lang.String logFile, java.lang.String date)
          Deprecated. as of Web NMS version 2.2 logAllData(String,Date) can be used.
 java.lang.String removeUserProperty(java.lang.String name)
          Remove the specified user property from the PolledData.
 void setActive(boolean active)
          Sets the status of this PolledData - whether active or inactive.
 void setAgent(java.lang.String agent)
          Sets the agent from which data is to be collected.
 void setCommunity(java.lang.String community)
          Sets the community string to be used for this PolledData.
 void setContextName(java.lang.String v)
          Sets the value of contextName.
 void setCounterUpdateRequired(boolean isCounter)
          The fields lastCounterValue and lastTimeValue in PolledData will be updated in DB during each data poll cycle.
 void setCurrentSaveCount(int v)
          Set the value of currentSaveCount which gives the current count of data collected after the last save.
 void setDnsName(java.lang.String dnsName)
          Sets the IP address / DNS name of the agent to collect data from .
 void setDynamicUserProperty(java.lang.String key, java.lang.Object value)
           
 void setExtension(java.lang.String extension)
          Sets the string to be appended in the message of the threshold events generated by this PolledData.
 void setFailureCount(int fail)
          Sets the failureCount for this PolledData.
 void setFailureThreshold(int failThresh)
          Sets the failureThreshold for this PolledData.
 void setGroupName(java.lang.String group)
          Sets the polling group that this polled Data belongs to.
Note Not used since WebNMS 2.3
 void setId(long id)
          sets the id for the PolledData.
 void setInstance(java.lang.String instance)
          Sets the instance for the oid which is being currently referred.
 void setIsMultiplePolledData(boolean isMultiplePolledData)
          Set whether multiple oids are to be polled by this PolledData.
 void setLockId(java.lang.Object lockId)
          Sets the current lock object associated with the PolledData.
 void setLogDirectly(boolean logDirectly)
          Sets whether the data collected should be logged directly to log file in CSV(comma Separated Values) format.
 void setLogFile(java.lang.String logFile)
          Sets the verbose CSV(Comma Separated Values) log file name.
 void setMappedProperties(java.util.Map mappedProps)
           
 void setName(java.lang.String name)
          Sets the name of the PolledData.
 void setNumericType(int numeric)
          Sets the type of data that this PolledData will collect.
 void setOid(java.lang.String oid)
          Sets the oid to be polled from an agent.
 void setOwnerName(java.lang.String owner)
          Deprecated. as of Web NMS 5
 void setParentObj(java.lang.String moname)
          sets the name of the Managed Object corresponding to this PolledData.
 void setPeriod(int period)
          Sets the polling interval for this PolledData in seconds.
 void setPolicyName(java.lang.String policyName)
          Sets the polling Object name for this PolledData.
 void setPollerName(java.lang.String pollerName)
          Sets the remote poller name for this PolledData.
 void setPort(int p)
          Sets p the port number to be polled for the agent.
 void setPreviousSeverity(int previousSeverity)
          Sets the severity of the latest event which was generated.
 void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] propertyList)
          corba: PolledData_CIOperations interface method.
 void setProperties(java.util.Properties prop)
          Set the object's properties with the properties that is passed.
 void setProtocol(java.lang.String proto)
          sets the protocol string.
 void setSave(boolean save)
          Sets whether the collected data is to be stored in compact form in database- for reports, charts, etc.
 void setSaveAbsolutes(boolean saveAbsolutes)
          Sets whether absolute values of the counters are to be stored or not.
 void setSaveOnThreshold(boolean save)
          Sets whether to store collected data only when an associated threshold is satisfied and threshold event is generated.
 void setSavePollCount(int v)
          Set the value of savePollCount which is number of times after which the collected data is stored.
 void setSnmpVersion(java.lang.String v)
          Sets the value of snmpVersion.
 void setStatsDataTableName(java.lang.String s)
          Sets the name of the table where the data collected for this PolledData should be stored.
 void setSuffix(java.lang.String suffix)
          Sets the index of the oid for which the data is collected.
 void setThreshold(boolean threshold)
          Sets Whether threshold checking is to be done for the collected data.
 void setThresholdList(java.lang.String thresholdList)
          Set the value of thresholdList.
 void setThresholdNames(java.util.Vector v)
          Sets the ThresholdObject names for this PolledData.
 void setTimeAvg(boolean timeAvg)
          Sets whether the data to be collected is to be averaged with time or not.
 void setTimeVal(long timeVal)
          Sets the time in milli seconds since epoch, as to when the PolledData has to be polled again.
 void setUserName(java.lang.String v)
          Sets the value of userName.
 void setUserProperty(java.lang.String name, java.lang.String value)
          Adds a new user property to the PolledData, with the given value.
 void setWebNMS(java.lang.String webNMS)
          the WebNMS server that owns this PolledData.
 void updateCurrentSaveCount()
          Updates the curentSaveCount after each data collection.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pollapi

protected static PollAPI pollapi
the PollAPI instance associated with this PolledData.


isPoller

protected static boolean isPoller
whether poller is associated with this PolledData.

Constructor Detail

PolledData

public PolledData()
Method Detail

getName

public java.lang.String getName()
Returns the name of the PolledData. This is a unique name, assigned by the user for the statistic collected by this polling unit. This forms an important identification while generating reports via the user written report generators. It also forms a part of PolledData key. PolledDatas are identified by their key name+"\t"+agent+"\t"+oid.

Specified by:
getName in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
Name of this PolledData.
See Also:
setName(String)

setName

public void setName(java.lang.String name)
Sets the name of the PolledData. This is a unique name , assigned by the user for the statistic collected by this polling unit. This forms an important identification while generating reports via the user written report generators. It also forms a part of PolledData key. PolledDatas are identified by their key name+"\t"+agent+"\t"+oid.

Specified by:
setName in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
name - the name for the PolledData.
See Also:
getName()

getId

public long getId()
Returns the id of the PolledData. A variable for internal use of the Polling Engine only It is assigned by the poll engine when the PolledData is created and it is a unique value for every PolledData.

Specified by:
getId in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
id of this PolledData.
See Also:
setId(long)

setId

public void setId(long id)
sets the id for the PolledData. A variable for internal use of the Polling Engine only It is assigned by the poll engine when the PolledData is created and it is a unique value for every PolledData.

Specified by:
setId in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
id - the id for this PolledData.
See Also:
getId()

getLastCounterValue

public long getLastCounterValue()
Returns the value collected during the previous poll for this PolledData. This is applicable only to the PolledDatas whose oid is of counter type.

Returns:
the value collected during the last poll.

getLastTimeValue

public long getLastTimeValue()
Returns the time in milliseconds since epoch, when this PolledData was last polled.

Returns:
the time in milliseconds since epoch, when this PolledData was polled last.

getTimeVal

public long getTimeVal()
Returns the time in milli seconds since epoch, as to when the PolledData has to be polled again.

Returns:
time in milli seconds since epoch, as to when the PolledData has to be polled again.

setTimeVal

public void setTimeVal(long timeVal)
Sets the time in milli seconds since epoch, as to when the PolledData has to be polled again.

Parameters:
timeVal - time in milli seconds since epoch, as to when the PolledData has to be polled again.

getAgent

public java.lang.String getAgent()
Returns the agent from which data is collected.

Specified by:
getAgent in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the agent from which data is collected. For DHCP nodes this would return the physical address and for non-DHCP nodes it would return the DNS name.
See Also:
setAgent(String), getAgent(), getDnsName(), setDnsName(String)

setAgent

public void setAgent(java.lang.String agent)
Sets the agent from which data is to be collected.

Specified by:
setAgent in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
agent - the agent from which data is to collected. For DHCP nodes the physical address is the input parameter and for non-DHCP nodes the DNS name is the input parameter. Please note that this also sets the DNS name of the PolledData. This is to ensure backward compatabiliy. i.e if the PolledData does not deal with a DHCP node the setAgent call will suffice as it will set both the agent and the dnsName to the same value. If it deals with the DHCP node the dnsName which is used for polling will have to be set separtely using setDnsName(String) after invoking this method.
See Also:
getAgent(), getDnsName(), setDnsName(String)

getDnsName

public java.lang.String getDnsName()
Returns the IP address / DNS name of the agent to collect data from. For DHCP nodes this would be the IP address currently assigned.

Returns:
the IP address/DNS name of the agent. For DHCP nodes this would be the physical address.
See Also:
setDnsName(String), getAgent(), setAgent(String)

setDnsName

public void setDnsName(java.lang.String dnsName)
Sets the IP address / DNS name of the agent to collect data from .

Parameters:
dnsName - for DHCP nodes this would be the physical address.
See Also:
getDnsName(), getAgent(), setAgent(String)

getCommunity

public java.lang.String getCommunity()
Returns the community string of this PolledData.
Note: By default, it returns "public"and it is specific to SNMP Protocol.

Specified by:
getCommunity in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the community string of PolledData.
See Also:
setCommunity(String)

setCommunity

public void setCommunity(java.lang.String community)
Sets the community string to be used for this PolledData.
Note: Default community string is "public"and it is specific to SNMP Protocol.

Specified by:
setCommunity in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
community - the community to be set for this PolledData.
See Also:
getCommunity()

getPeriod

public int getPeriod()
Returns the polling interval of this PolledData in seconds.
Note: the default polling period is 5 minutes.

Specified by:
getPeriod in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the polling interval of this PolledData in seconds
See Also:
setPeriod(int)

setPeriod

public void setPeriod(int period)
Sets the polling interval for this PolledData in seconds.

Specified by:
setPeriod in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
period - the polling interval in seconds
See Also:
getPeriod()

getPort

public int getPort()
To get the port number on the agent which is being polled.
Note: The default port set is 161.

Specified by:
getPort in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the port number on the agent which is being polled.
See Also:
setPort(int)

setPort

public void setPort(int p)
Sets p the port number to be polled for the agent.

Specified by:
setPort in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
p - the port number to be polled for the agent.
See Also:
getPort()

getActive

public boolean getActive()
Returns a boolen representing the state of the PolledData - whether active or inactive. The variable "Active" represents whether polling takes place currently for this PolledData or not.
Note:By default, a PolledData is active

Specified by:
getActive in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the status of this PolledData "true" if PolledData is active, "false" otherwise
See Also:
setActive(boolean)

setActive

public void setActive(boolean active)
Sets the status of this PolledData - whether active or inactive. This when set to "false" suspends polling for this PolledData until it is set to "true" again.

Specified by:
setActive in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
active - the status for this PolledData "true" if PolledData is active, "false" otherwise
See Also:
getActive()

getOid

public java.lang.String getOid()
Returns the oid that is being polled from an agent.

Specified by:
getOid in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the oid that is being polled from an agent.

setOid

public void setOid(java.lang.String oid)
Sets the oid to be polled from an agent. In case of SNMP data collection , set the columnar oid string if this is a MultiplePolledData (i.e., isMultiplePolledData = true) , set the full oid string otherwise.

Specified by:
setOid in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
oid - the oid to be polled from an agent.

getOwnerName

public java.lang.String getOwnerName()
Deprecated. as of Web NMS 5

returns the owner name of this PolledData.

Returns:
owner name of the PolledData

setOwnerName

public void setOwnerName(java.lang.String owner)
Deprecated. as of Web NMS 5

sets the owner name for this PolledData. For each PolledData object , user can specify an owner for that PolledData. By default , this field will contain the string "NULL". If any other string is specified , then it becomes a part of the PolledData key . The format of the key is , name + \t + agent + \t + oid + \t +ownerName if ownerName is any string other than "NULL" else the key will be name + \t + agent + \t + oid

Parameters:
owner - owner name of the PolledData

getLogDirectly

public boolean getLogDirectly()
Returns whether the data is being logged directly to a log file in CSV(Comma Separated values) format-for spreadsheets.
Note: By default it returns "false"

Specified by:
getLogDirectly in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
"true" if the data is being logged directly to a file, "false" otherwise.
See Also:
setLogDirectly(boolean), setLogFile(String), getLogFile()

setLogDirectly

public void setLogDirectly(boolean logDirectly)
Sets whether the data collected should be logged directly to log file in CSV(comma Separated Values) format.

Specified by:
setLogDirectly in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
logDirectly - whether to log data collected in a separate verbose CSV log file
See Also:
getLogDirectly(), getLogFile(), setLogFile(String)

getLogFile

public java.lang.String getLogFile()
Returns the verbose CSV(Comma Separated Values) log file name.

Specified by:
getLogFile in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the name of the log file
See Also:
setLogFile(String), getLogDirectly(), setLogDirectly(boolean)

setLogFile

public void setLogFile(java.lang.String logFile)
Sets the verbose CSV(Comma Separated Values) log file name. If file name alone is given the file will be created under WebNMS home directory. To create the file elsewhere, full path name of the file should be given.

Specified by:
setLogFile in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
logFile - name of the log file
See Also:
getLogFile(), getLogDirectly(), setLogDirectly(boolean)

getSave

public boolean getSave()
Returns whether the collected data is stored in compact form in database- for reports, charts, etc.
Note: The default value is "true"

Specified by:
getSave in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
returns "true" if collected data for this PolledData is being saved "false" otherwise.
See Also:
setSave(boolean), setSavePollCount(int), getSavePollCount()

setSave

public void setSave(boolean save)
Sets whether the collected data is to be stored in compact form in database- for reports, charts, etc.

Specified by:
setSave in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
save - "true" if collected data is to be saved,"false" otherwise.
See Also:
getSave()

getThreshold

public boolean getThreshold()
Returns whether threshold checking is being done for the collected data.
Note: the default value is "false"

Specified by:
getThreshold in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
"true" if threshold checking is being done for the collected data, "false" otherwise
See Also:
setThreshold(boolean), ThresholdObject

setThreshold

public void setThreshold(boolean threshold)
Sets Whether threshold checking is to be done for the collected data.

Specified by:
setThreshold in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
threshold - "true" if threshold checking is to be done for the collected data, "false" otherwise.
See Also:
getThreshold(), ThresholdObject

setFailureCount

public void setFailureCount(int fail)
Sets the failureCount for this PolledData. Used when failureThreshold is set for the oid to be polled in the Polling.conf for maintaining the number of times this PolledData has been polled after a threshold event is generated for this PolledData.

Parameters:
fail - failureCount for this PolledData.
See Also:
getFailureCount()

getFailureCount

public int getFailureCount()
Returns the failureCount for this PolledData. Used when failureThreshold is set for the oid to be polled in the Polling.conf for maintaining the number of times this PolledData has been polled after a threshold event is generated for this PolledData.

Returns:
int failureCount for this PolledData.
See Also:
setFailureCount(int)

setFailureThreshold

public void setFailureThreshold(int failThresh)
Sets the failureThreshold for this PolledData. This is the number of times the collected value of this PolledData must satisfy the threshold criteria CONSECUTIVELY after which the Threshold event will be generated.
Note: The default value is 1.

For example, if a long threshold of type max associated with this PolledData has a thresholdValue of 10000 and if the collected values for this PolledData are like 20000,25000,23000......then, setting the failureThreshold to 1 will generate a threshold event after the first value for the collected value 20000),setting it to 2 will effect in generating a threshold event after the collected value exceeds the thresholdValue twice CONSECUTIVELY. That is ,for the collected value of 25000.

Parameters:
failThresh - failureThreshold count as int.
See Also:
getFailureThreshold()

getFailureThreshold

public int getFailureThreshold()
Returns the failureThreshold for this PolledData. This is the number of times the collected value of this PolledData must satisfy the Threshold criteria CONSECUTIVELY after which the Threshold event will be generated.
Note: The value returned by default is 1.

Returns:
int failureThreshold.
See Also:
setFailureThreshold(int)

getIsMultiplePolledData

public boolean getIsMultiplePolledData()
Returns whether multiple oids are being polled by this PolledData.

Specified by:
getIsMultiplePolledData in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
whether multiple oids are being polled by this PolledData. "true" only in the case of MultiplePolledData.
See Also:
setIsMultiplePolledData(boolean), MultiplePolledData

setIsMultiplePolledData

public void setIsMultiplePolledData(boolean isMultiplePolledData)
Set whether multiple oids are to be polled by this PolledData.

Specified by:
setIsMultiplePolledData in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
isMultiplePolledData - whether multiple oidss are to be polled by this PolledData. "true" only in the case of MultiplePolledData.
See Also:
getIsMultiplePolledData(), MultiplePolledData

getPreviousSeverity

public int getPreviousSeverity()
Returns the severity of the event last generated by this PolledData.

Specified by:
getPreviousSeverity in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the severity of the event last generated by this PolledData.
See Also:
setPreviousSeverity(int)

setPreviousSeverity

public void setPreviousSeverity(int previousSeverity)
Sets the severity of the latest event which was generated.

Specified by:
setPreviousSeverity in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
previousSeverity - previous severity of this PolledData.
See Also:
getPreviousSeverity()

setPolicyName

public void setPolicyName(java.lang.String policyName)
Sets the polling Object name for this PolledData. This represents the name of the PollingObject which controls this PolledData.

Parameters:
policyName - the name of the policy
See Also:
getPolicyName(), PollingObject

getPolicyName

public java.lang.String getPolicyName()
Returns the name of the PollingObject which controls this PolledData.

Returns:
name of the policy as String.
See Also:
setPolicyName(String), PollingObject

setPollerName

public void setPollerName(java.lang.String pollerName)
Sets the remote poller name for this PolledData. This used only when distributed pollers are used. If a PolledData is associated with a distributed poller , polling for that PolledData will be done by the poller. In this case pollerName field will contain the distributed poller name. By default this field will contain an empty string.

Parameters:
pollerName - name of the remote poller
See Also:
getPollerName(), RemotePoller

getPollerName

public java.lang.String getPollerName()
Returns the name of the remote poller which is responsible for collecting data via this poller.

Returns:
Name of the remote poller as String
See Also:
setPollerName(String), RemotePoller

setThresholdNames

public void setThresholdNames(java.util.Vector v)
Sets the ThresholdObject names for this PolledData. In case multiple Thresholds are associated with a PolledData then thresholds with highest severity takes precedence over other thresholds.

Parameters:
v - vector containing the names of the Threshold Objects
See Also:
getThresholdNames(), getThreshold(), setThreshold(boolean), ThresholdObject

getThresholdNames

public java.util.Vector getThresholdNames()
Returns the ThresholdObject names which is associated with this PolledData.

Returns:
the ThresholdObjects names of this PolledData
See Also:
setThresholdNames(Vector), getThreshold(), setThreshold(boolean), ThresholdObject

getThresholdList

public java.lang.String getThresholdList()
Get the value of thresholdList.

Returns:
value of thresholdList.

setThresholdList

public void setThresholdList(java.lang.String thresholdList)
Set the value of thresholdList.

Parameters:
thresholdList - Value to assign to thresholdList.

getInstance

public java.lang.String getInstance()
Returns the instance of the oid which is being currently referred. Used in case of MultiplePolledData only

Specified by:
getInstance in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the current instance of MultiplePolledData
See Also:
setInstance(String)

setInstance

public void setInstance(java.lang.String instance)
Sets the instance for the oid which is being currently referred. Used in case of MultiplePolledData only

Specified by:
setInstance in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
instance - the current instance of MultiplePolledData
See Also:
getInstance()

getSuffix

public java.lang.String getSuffix()
Returns the index of the OID for which the data is collected.

Specified by:
getSuffix in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the index of the OID for which the data is collected.
See Also:
setSuffix(String)

setSuffix

public void setSuffix(java.lang.String suffix)
Sets the index of the oid for which the data is collected.

Specified by:
setSuffix in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
suffix - the index of the oid for which the data is collected.
See Also:
getSuffix()

getExtension

public java.lang.String getExtension()
Returns the string to be appended in the message of the threshold events generated by this PolledData. Used only in case of MultiplePolledData.

Specified by:
getExtension in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Returns:
the extension to be appended in the message of the threshold events.
See Also:
setExtension(String)

setExtension

public void setExtension(java.lang.String extension)
Sets the string to be appended in the message of the threshold events generated by this PolledData. Used only in case of MultiplePolledData.

Specified by:
setExtension in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
Parameters:
extension - the extension to be appended in the message of the threshold events.
See Also:
getExtension()

getStatsDataTableName

public java.lang.String getStatsDataTableName()
Returns the name of the table where the data collected for this PolledData should be stored.
Note The default tables is STATSDATA%.

Returns:
the name of the table
See Also:
setStatsDataTableName(String)

setStatsDataTableName

public void setStatsDataTableName(java.lang.String s)
Sets the name of the table where the data collected for this PolledData should be stored.
Note: The default tables are STATSDATA% and STRINGDATA% for numeric and string type of data respectively
Appending "%" to the table name ensures that a new table is created for each day.

For Example,if the day is 12-9-2000 when the data collection starts, then the table created is STATSDATA9_12_2000(assuming default table is used). And the next day a new table (STATSDATA9_13_2000) is automatically created and the data collected for that day will be stored in this new table and so on. Setting a table name using this method will not create the table. Table with the given name should exist in the database or users have to create table explicitly on server start up or at run time . Table creation at server start up can be done by giving an entry in DatabaseSchema.conf file (NMS home / conf directory) . Table creation at run time can be done using the PollAPI methods addCreateSchema(String,String) and createTable(String). If the table has the same schema as that of STATSDATAmm_dd_yyyy or STRINGDATAmm_dd_yyyy then collected data will be stored in the table automatically. If the table has a different schema , use table customization feature to enable storing of data in these tables.

Parameters:
s - the name of the table
See Also:
getStatsDataTableName(), CollectedInfo.putValuesForColumn(String,String,String,Object), CollectedInfo.getValuesForColumn(String,String,String), DataDecoder

getNumericType

public int getNumericType()
Returns the type of data that this PolledData will collect. Allowed values are
  • 1-numeric
  • 2-string This field will be set only after the PolledData is polled for the first time. Initially it will have a value of -1.

    Specified by:
    getNumericType in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Returns:
    the numeric type of this PolledData
    See Also:
    setNumericType(int)

  • setNumericType

    public void setNumericType(int numeric)
    Sets the type of data that this PolledData will collect. Allowed values are
  • 1-numeric
  • 2-string This field will be set only after the PolledData is polled for the first time. Initially it will have a value of -1.

    Specified by:
    setNumericType in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Parameters:
    numeric - the numeric type of this PolledData
    See Also:
    getNumericType()

  • getSaveAbsolutes

    public boolean getSaveAbsolutes()
    Returns whether absolute values of the counters are stored or not. In SNMP data collection , this parameter is applicable to only counter type oids.
    Note: By default,difference between 2 consecutively collected values is stored.The default value is 'false'

    Specified by:
    getSaveAbsolutes in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Returns:
    whether absolute values of the counters are stored or not
    See Also:
    setSaveAbsolutes(boolean)

    setSaveAbsolutes

    public void setSaveAbsolutes(boolean saveAbsolutes)
    Sets whether absolute values of the counters are to be stored or not. By default,difference between 2 consecutively collected values are stored. In SNMP data collection this parameter is applicable to only counter type oids.This is false by default and hence while polling counter type oids , differential values will be stored. Counter rollover is also handled internally in the default Snmp protocol provider while finding the differential value.

    Specified by:
    setSaveAbsolutes in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Parameters:
    saveAbsolutes - whether absolute values of the counters are to be stored or not
    See Also:
    getSaveAbsolutes()

    getTimeAvg

    public boolean getTimeAvg()
    storage option specifying whether to store time average collected values or not. If this is true , the collected value will be divided by the period of polling and the result will be saved in database instead of the originally collected value.
    Note: The default value returned is "false"

    Specified by:
    getTimeAvg in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Returns:
    whether the data collected is being averaged with time
    See Also:
    setTimeAvg(boolean)

    setTimeAvg

    public void setTimeAvg(boolean timeAvg)
    Sets whether the data to be collected is to be averaged with time or not.

    Specified by:
    setTimeAvg in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Parameters:
    timeAvg - whether the data to be collected is to be averaged with time or not
    See Also:
    getTimeAvg()

    getWebNMS

    public java.lang.String getWebNMS()
    the WebNMS server that owns this PolledData.

    Specified by:
    getWebNMS in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Returns:
    the name of the server
    See Also:
    setWebNMS(String)

    setWebNMS

    public void setWebNMS(java.lang.String webNMS)
    the WebNMS server that owns this PolledData.

    Specified by:
    setWebNMS in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Parameters:
    webNMS - the name of the server
    See Also:
    getWebNMS()

    getGroupName

    public java.lang.String getGroupName()
    Returns the polling group that this polled Data belongs to.
    Note: Not used since WebNMS 2.3

    Specified by:
    getGroupName in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Returns:
    the polling group
    See Also:
    setGroupName(String)

    setGroupName

    public void setGroupName(java.lang.String group)
    Sets the polling group that this polled Data belongs to.
    Note Not used since WebNMS 2.3

    Specified by:
    setGroupName in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Parameters:
    group - the polling group
    See Also:
    getGroupName()

    getParentObj

    public java.lang.String getParentObj()
    returns the name of the managed Object corresponding to this PolledData.

    Returns:
    Managed Object name

    setParentObj

    public void setParentObj(java.lang.String moname)
    sets the name of the Managed Object corresponding to this PolledData.

    Parameters:
    moname - name of the Managed Object

    setProtocol

    public void setProtocol(java.lang.String proto)
    sets the protocol string. It is the protocol using which data will be collected for this PolledData. The provider for this protocol can be specified either at start up through Polling.conf or it can be added at run time using API.

    Parameters:
    proto - protocol string
    See Also:
    PollAPI.addProtocolProvider(String,ProtocolProvider)

    getProtocol

    public java.lang.String getProtocol()
    returns the protocol string. It is the protocol using which data is collected for this PolledData.

    Returns:
    protocol string.

    getSavePollCount

    public int getSavePollCount()
    Returns the number of times after which the collected data is to be stored. For example , if savePollCount is 3 and if data is collected every 60 seconds , collected data will be stored every 3 minutes. ie., every third time.
    Note: The default value returned is 1.

    Returns:
    value of savePollCount.

    setSavePollCount

    public void setSavePollCount(int v)
    Set the value of savePollCount which is number of times after which the collected data is stored. For example , if savePollCount is 3 and if data is collected every 60 seconds , collected data will be stored every 3 minutes. ie., every third time. If this option is to be used save property of this PolledData should be set to true using setSave(boolean).

    Note saveOnThreshold property and this cannot be used together.The default value for savePollCount is 1.

    Parameters:
    v - Value to assign to savePollCount.

    getCurrentSaveCount

    public int getCurrentSaveCount()
    Returns the value of current count of data collected after the last save. Used when savePollCount property is set to a value > 1. This is used to keep track of number of polls that occurred after last save. For example, if savePollCount is 3, the collected data will be saved only after the third poll ( the collected data from the first 2 polls will be ignored) . To keep track of the number of polls that has occured, currentSaveCount will be increased after each poll and when it reaches 3 , the collected data will be stored and this field will be reset to 0 and so on.

    Returns:
    value of currentSaveCount.

    setCurrentSaveCount

    public void setCurrentSaveCount(int v)
    Set the value of currentSaveCount which gives the current count of data collected after the last save. . Used when savePollCount property is set to a value > 1. This is used to keep track of number of polls that occurred after last save. For example, if savePollCount is 3, the collected data will be saved only after the third poll ( the collected data from the first 2 polls will be ignored) . To keep track of the number of polls that has occured, currentSaveCount will be increased after each poll and when it reaches 3 , the collected data will be stored and this field will be reset to 0 and so on.

    Parameters:
    v - Value to assign to currentSaveCount.

    getSaveOnThreshold

    public boolean getSaveOnThreshold()
    Returns whether to store collected data only when an associated threshold is satisfied and threshold event is generated.
    Note: The default value is false.

    Returns:
    value of saveOnThreshold.

    setSaveOnThreshold

    public void setSaveOnThreshold(boolean save)
    Sets whether to store collected data only when an associated threshold is satisfied and threshold event is generated. If this option is to be used save property of this PolledData should be set to false using setSave(boolean).

    NotesavePollCount property and this cannot be used together.The default value for saveOnThreshold is false.

    Parameters:
    save - Value to assign to saveOnThreshold.
    See Also:
    getSaveOnThreshold()

    getSnmpVersion

    public java.lang.String getSnmpVersion()
    Returns the value of snmpVersion. This field is specific to SNMP protocol.

    Returns:
    value of snmpVersion.

    setSnmpVersion

    public void setSnmpVersion(java.lang.String v)
    Sets the value of snmpVersion. This field is specific to SNMP protocol. The values could be either 'v1' or 'v2' or 'v3'

    Parameters:
    v - Value to assign to snmpVersion.

    getUserName

    public java.lang.String getUserName()
    Returns the value of userName. This is applicable to SNMP v3 agents.

    Returns:
    value of userName.

    setUserName

    public void setUserName(java.lang.String v)
    Sets the value of userName. This is applicable to SNMP v3 agents.

    Parameters:
    v - Value to assign to userName.

    getContextName

    public java.lang.String getContextName()
    Returns the value of contextName. This is only applicable to SNMP v3 agents.

    Returns:
    value of contextName.

    setContextName

    public void setContextName(java.lang.String v)
    Sets the value of contextName. This is only applicable to SNMP v3 agents.

    Parameters:
    v - Value to assign to contextName.

    getLockId

    public java.lang.Object getLockId()
    Gets the current lock object associated with the PolledData. The WebNMS supports locking of PolledDatas at the application level. Currently, the WebNMS uses the lockId property of the PolledData internally to support the application level locking. This method should not be used by the users, as it might break the locks applied, if any, over the PolledData.

    Returns:
    The lock object associated with the PolledData.
    See Also:
    LockableObject

    setLockId

    public void setLockId(java.lang.Object lockId)
    Sets the current lock object associated with the PolledData. The WebNMS supports locking of PolledDatas at the application level. Currently, the WebNMS uses the lockId property of the PolledData internally to support the application level locking. This method should not be used by the users, as it might break the locks applied, if any, over the PolledData.

    Parameters:
    lockId - The lock object associated with the PolledData.
    See Also:
    LockableObject

    setUserProperty

    public void setUserProperty(java.lang.String name,
                                java.lang.String value)
    Adds a new user property to the PolledData, with the given value. If the key of the user property to be added is similar to the identifier of any of the PolledData properties, then the user property is not added. The value of the user property is specified as an Object and is stored as a corresponding type within NMS. Users have to take care of the type of the user property themselves. If an already exisiting user property is added again, the previous one is overwritten by the current one.

    Specified by:
    setUserProperty in interface DBExtendedInterface
    Parameters:
    name - Name (key) of the user property to be added.
    value - Value(as an Objcet) of the user property to be added.

    getUserProperty

    public java.lang.String getUserProperty(java.lang.String name)
    Get the value of the user property with the given name (key). This method will return the user property value as an Object, and the users must take care of casting it to the appropriate type.

    Specified by:
    getUserProperty in interface DBExtendedInterface
    Parameters:
    name - Name of the user property whose value is to be obtained.
    Returns:
    Value of the user property, as an Object.

    getDynamicUserProperty

    public java.lang.Object getDynamicUserProperty(java.lang.String nam)

    setDynamicUserProperty

    public void setDynamicUserProperty(java.lang.String key,
                                       java.lang.Object value)

    getUserProperties

    public java.util.Properties getUserProperties()
    Get all the user properties of the PolledData. This method will return all the user properties of the PolledData in a Properties object. The user property names will be the keys in the returned Properties object, with the corresponding values (as Strings).

    Specified by:
    getUserProperties in interface DBExtendedInterface
    Returns:
    A properties object containing all the user properties of the PolledData.

    removeUserProperty

    public java.lang.String removeUserProperty(java.lang.String name)
    Remove the specified user property from the PolledData. Given the name (key) of the already exisitng user property, this method will remove it from the PolledData.

    Specified by:
    removeUserProperty in interface DBExtendedInterface
    Parameters:
    name - Name of the user property to be removed.
    Returns:
    The value of the user property that was removed, null if the user property does not exist.

    checkAgainstThresholds

    public void checkAgainstThresholds(long time,
                                       java.lang.String val)

    checkAgainstThresholds

    public void checkAgainstThresholds(long time,
                                       long val)

    logAllData

    public boolean logAllData(java.lang.String logFile)
    Log all collected data for the current day to specified file. if "LogDirectly" is set all the data collected will be logged to the user given file

    Parameters:
    logFile - the name of the log file
    Returns:
    "true" if data has been logged in the given file,"false" otherwise
    See Also:
    setLogDirectly(boolean)

    logAllData

    public boolean logAllData(java.lang.String logFile,
                              java.lang.String date)
    Deprecated. as of Web NMS version 2.2 logAllData(String,Date) can be used.

    Logs all collected data for the given day to specified file. This version requires the date string in 9-20-1997 format. Please avoid using this method, this method is deprecated as of Web NMS version 2.2, use logAllData(String logFile,Date date) instead.

    Parameters:
    logFile - the name of the log file
    date - the date of data collection
    Returns:
    "true" if data has been logged onto the given file,"false" otherwise

    logAllData

    public boolean logAllData(java.lang.String logFile,
                              java.util.Date date)
    Logs all collected data for the given date to specified file

    Parameters:
    logFile - the name of the file
    date - the date of data collection
    Returns:
    "true" if data has been logged into the file,"false" otherwise
    See Also:
    setLogDirectly(boolean)

    clone

    public java.lang.Object clone()
    Returns a new object which is a clone of this.

    Specified by:
    clone in interface DBInterface
    Overrides:
    clone in class java.lang.Object
    Returns:
    clone of this PolledData

    setProperties

    public void setProperties(java.util.Properties prop)
    Set the object's properties with the properties that is passed. The properties name , agent and oid must be set, other fields being optional. Properties that can be set are ,
     period , policyName, agent, dnsName, pollerName, numericType,
     port, lastCounterValue, lastTimeValue, timeVal, previousSeverity
     failureCount, failureThreshold, savePollCount, currentSaveCount
     snmpVersion, userName, contextName, isMultiplePolledData
     saveAbsolutes, timeAvg, name, community, active, oid, groupName
     save, logDirectly, logFile, threhsold, statsDataTableName, suffix
     ownerName, thresholdList, parentObj, protocol, saveOnThreshold
     
    If any other additional property is present in the properties object , it will be taken as a user property. Id of a PolledData cannot be set using this method.

    Specified by:
    setProperties in interface DBInterface
    Parameters:
    p - Properties which has to be assigned to this PolledData.

    getProperties

    public java.util.Properties getProperties()
    Returns the object's properties .

    Specified by:
    getProperties in interface DBInterface
    Returns:
    Properties of this PolledData.

    getKey

    public java.lang.String getKey()
    To get the key of this PolledData object. key = name+"\t"+agent+"\t"+oid(if ownerName is null)
    else the value returned is
    key = name+"\t"+agent+"\t"+oid+"\t"+ownerName

    Specified by:
    getKey in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Specified by:
    getKey in interface DBInterface
    Returns:
    the key of this PolledData

    getKeyName

    public java.lang.String getKeyName()
    To get the key of this PolledData object.

    Specified by:
    getKeyName in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Specified by:
    getKeyName in interface DBInterface
    Returns:
    the key of this PolledData

    setProperties_CT

    public void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] propertyList)
    corba: PolledData_CIOperations interface method.
    Sets the PropertyList passed for this PolledData object.

    Specified by:
    setProperties_CT in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Parameters:
    propertyList - the property list

    getProperties_CT

    public com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
    corba: PolledData_CIOperations interface method.
    Gets the property list

    Specified by:
    getProperties_CT in interface com.adventnet.nms.poll.corba.PolledData_CIOperations
    Returns:
    the property list

    getMappedProperties

    public java.util.Map getMappedProperties()

    setMappedProperties

    public void setMappedProperties(java.util.Map mappedProps)

    getTieRefHolder_PolledData

    public PollTieRefHolder getTieRefHolder_PolledData()
    Returns the TieHolder of this PolledData.

    Returns:
    PollTieRefHolder.

    updateCurrentSaveCount

    public void updateCurrentSaveCount()
    Updates the curentSaveCount after each data collection.


    setCounterUpdateRequired

    public void setCounterUpdateRequired(boolean isCounter)
    The fields lastCounterValue and lastTimeValue in PolledData will be updated in DB during each data poll cycle. Along with these fields threshold and savePollCount related fields are also updated. If these fields are not used, and also if thresholds are not enabled, a call to this method with input parameter as false will result in the update statement not being executed thus increasing performance. By default it is set to true indicating that the update query will be executed.

    Can be set in protocol provider or data decoder. Please note that this is just a transient variable and is not a property of PolledData and so will not be stored in database.


    getCounterUpdateRequired

    public boolean getCounterUpdateRequired()
    See Also:
    setCounterUpdateRequired(boolean)

    "WEBNMS_5 API Docs"

    Copyright © 2011 ZOHO Corp., All Rights Reserved.