"WEBNMS_5 API Docs"

com.adventnet.nms.poll
Class PollerUtil

java.lang.Object
  extended by com.adventnet.nms.poll.PollerUtil

public class PollerUtil
extends java.lang.Object

An important utility class that contains static constants and methods that are used by the distributed poller. Some of the most important methods are,

To lookup for an object from BE registry To fetch the properties set in the PollerParams.xml file etc It also contains methods for initializing the distributed poller, reconnecting to BE server etc.


Field Summary
static java.lang.String country
           
static boolean IS_BE_SECURE
           
static boolean IS_COMMON_DB
           
static boolean IS_SERVER_ALIVE
           
static boolean IS_STANDBY
           
static boolean isFromFailover
           
static java.lang.String language
           
static java.lang.String PASSWORD
           
static PollAPI pollAPI
           
static java.lang.String POLLER_NAME
           
static java.lang.String PRIMARY_POLLER_NAME
           
static java.lang.String protocol
           
static java.lang.String SERVER_NAME
           
static java.lang.String SERVER_RMI_PORT
           
static java.lang.String STANDBY_POLLER_NAME
           
static java.util.Properties standByServerProps
           
static java.lang.String USERNAME
           
 
Method Summary
static void authenticatePollerInSecureMode()
          This method is internally used for authenticating the poller in secure mode.
static boolean deleteDirectoryContents(java.lang.String direc, java.lang.String excludedFile)
          This method deletes the contents of the given directory with the exception of a single file.
static java.util.Properties fetchHourlyArchiveTableProps()
          This method is used internally.
static PollAPI fetchPollAPI(boolean failOver)
          This method returns the PollAPI instance.
static PollAPI fetchPollAPI(boolean failOver, int retryCount)
          This method returns the PollAPI instance.
static CommonAPI getAPI(java.lang.String apiName)
          This method returns the requested API instance from the BE server.
static java.lang.String getParameter(java.lang.String key)
          Gets the parameter from the poller parameters which is built from the Poller home/conf/PollerParams.xml and Poller home/conf/serverparametes.conf The value corresponding to the argument in the file is returned by this method .It returns null if the argument is not present.
static com.adventnet.nms.poll.Poller getPoller()
          This method returns the Poller instance.
static java.rmi.Remote getRemoteAPI(java.lang.String apiName)
          This method returns the requested API instance from the BE server.
static void init(com.adventnet.nms.poll.Poller remPoller)
           
static void setPollerProperties(java.util.Hashtable props)
          This method is for setting the properties obtained from the BE server after registering with the BE.
static boolean uploadReportsFile(java.lang.String fileName)
          This method uploads the given reports file to the BE server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IS_SERVER_ALIVE

public static boolean IS_SERVER_ALIVE

SERVER_NAME

public static java.lang.String SERVER_NAME

SERVER_RMI_PORT

public static java.lang.String SERVER_RMI_PORT

POLLER_NAME

public static java.lang.String POLLER_NAME

IS_COMMON_DB

public static boolean IS_COMMON_DB

PRIMARY_POLLER_NAME

public static java.lang.String PRIMARY_POLLER_NAME

STANDBY_POLLER_NAME

public static java.lang.String STANDBY_POLLER_NAME

IS_STANDBY

public static boolean IS_STANDBY

pollAPI

public static PollAPI pollAPI

IS_BE_SECURE

public static boolean IS_BE_SECURE

USERNAME

public static java.lang.String USERNAME

PASSWORD

public static java.lang.String PASSWORD

standByServerProps

public static java.util.Properties standByServerProps

country

public static java.lang.String country

language

public static java.lang.String language

isFromFailover

public static boolean isFromFailover

protocol

public static java.lang.String protocol
Method Detail

init

public static void init(com.adventnet.nms.poll.Poller remPoller)

uploadReportsFile

public static boolean uploadReportsFile(java.lang.String fileName)
This method uploads the given reports file to the BE server. The BE server persists the contents of same in the REPORTS_HOURLY table.

Parameters:
fileName - the name of the file along with its relative path from poller home
Returns:
a boolean depending on result of the transfer

deleteDirectoryContents

public static boolean deleteDirectoryContents(java.lang.String direc,
                                              java.lang.String excludedFile)
This method deletes the contents of the given directory with the exception of a single file.

Parameters:
direc - the name of the directory along with its relative path from poller home
excludedFile - the name of the file to be excluded from the deletion
Returns:
a boolean depending on result of the operation

setPollerProperties

public static void setPollerProperties(java.util.Hashtable props)
This method is for setting the properties obtained from the BE server after registering with the BE. This method is used internally


fetchPollAPI

public static PollAPI fetchPollAPI(boolean failOver)
This method returns the PollAPI instance. In case the connection to the BE server is lost, it will wait till the connection is established with the BE server and and then return the PollAPI from the reconnected BE server. Otherwise, it will return the already fetched PollAPI. This method is used internally for registration purposes

Parameters:
failOver - a boolean stating the status of the connection to BE
Returns:
the PollAPI instance from the BE server

fetchPollAPI

public static PollAPI fetchPollAPI(boolean failOver,
                                   int retryCount)
This method returns the PollAPI instance. In case the connection to the BE server is lost, it will try to reconnect with the BE server and then return the PollAPI from the reconnected BE server. The number of attempts to fetch the PollAPI will depend on the retryCount and in case the PollAPI instance is not fetched, it will return null. If the server is conencted, it will return the already fetched PollAPI. This method is used internally for registration purposes

Parameters:
failOver - a boolean stating the status of the connection to BE
retryCount - the number of attempts to be made.
Returns:
the PollAPI instance from the BE server

getRemoteAPI

public static java.rmi.Remote getRemoteAPI(java.lang.String apiName)
                                    throws java.rmi.RemoteException,
                                           java.rmi.NotBoundException,
                                           RMIAccessException,
                                           java.lang.Exception
This method returns the requested API instance from the BE server.

Parameters:
apiName - the name of the API to be fetched from the BE server
Returns:
the RemoteAPI instance of the requested API
Throws:
java.rmi.RemoteException
java.rmi.NotBoundException
RMIAccessException
java.lang.Exception

authenticatePollerInSecureMode

public static void authenticatePollerInSecureMode()
This method is internally used for authenticating the poller in secure mode.


getPoller

public static com.adventnet.nms.poll.Poller getPoller()
This method returns the Poller instance.

Returns:
the Poller instance

fetchHourlyArchiveTableProps

public static java.util.Properties fetchHourlyArchiveTableProps()
This method is used internally. It is used to fetch the properties of the hourly data aggregation


getParameter

public static java.lang.String getParameter(java.lang.String key)
Gets the parameter from the poller parameters which is built from the Poller home/conf/PollerParams.xml and Poller home/conf/serverparametes.conf The value corresponding to the argument in the file is returned by this method .It returns null if the argument is not present.

Parameters:
arg - parameter to be fetched
Returns:
a String which corresponds to the above parameter

getAPI

public static CommonAPI getAPI(java.lang.String apiName)
This method returns the requested API instance from the BE server.

Parameters:
apiName - the name of the API to be fetched from the BE server
Returns:
the CommonAPI instance of the requested API

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.