OpenNMS API 1.2.3

org.opennms.netmgt.collectd
Class Collectd

java.lang.Object
  extended byorg.opennms.netmgt.collectd.Collectd
All Implemented Interfaces:
Fiber, PausableFiber

public final class Collectd
extends java.lang.Object
implements PausableFiber


Field Summary
private static java.lang.String LOG4J_CATEGORY
          Log4j category
private  java.util.List m_collectableServices
          List of all CollectableService objects.
private  BroadcastEventProcessor m_receiver
          Reference to the event processor
private  Scheduler m_scheduler
          Reference to the collection scheduler
private  boolean m_schedulingCompleted
          Indicates if scheduling of existing interfaces has been completed
private static java.util.Map m_serviceIds
          Holds map of service names to service identifiers
private static Collectd m_singleton
          Singleton instance of the Collectd class
private  int m_status
          Status of the Collectd instance.
private static java.util.Map m_svcCollectors
          Map of all available ServiceCollector objects indexed by service name
private static java.lang.String SQL_RETRIEVE_INTERFACES
          SQL used to retrieve all the interfaces which support a particular service.
private static java.lang.String SQL_RETRIEVE_SERVICE_IDS
          SQL used to retrieve all the service id's and names from the database.
 
Fields inherited from interface org.opennms.core.fiber.PausableFiber
PAUSE_PENDING, PAUSED, RESUME_PENDING
 
Fields inherited from interface org.opennms.core.fiber.Fiber
RUNNING, START_PENDING, STARTING, STATUS_NAMES, STOP_PENDING, STOPPED
 
Constructor Summary
private Collectd()
          Constructor.
 
Method Summary
private  boolean alreadyScheduled(java.lang.String ipAddress, java.lang.String pkgName)
          Returns true if specified address/pkg pair is already represented in the collectable services list.
private  ReadyRunnable buildSchedule(org.apache.log4j.Category log)
           
private  void buildServiceIdMap(org.apache.log4j.Category log)
           
private  void createEventProcessor(org.apache.log4j.Category log)
           
private  void createScheduler(org.apache.log4j.Category log, CollectdConfiguration config)
           
static Collectd getInstance()
          Returns singleton instance of the collection daemon.
 java.lang.String getName()
          Return sthe name of the collection daemon.
 Scheduler getScheduler()
          Returns reference to the scheduler
 ServiceCollector getServiceCollector(java.lang.String svcName)
          Returns the loaded ServiceCollector for the specified service name.
 int getStatus()
          Returns current status of the collection daemon.
 void init()
          Responsible for starting the collection daemon.
private  void instantiateCollectors(org.apache.log4j.Category log, CollectdConfiguration config)
           
 boolean isSchedulingCompleted()
           
private  void loadConfigFactory(org.apache.log4j.Category log)
           
private  void loadscheduledOutagesConfigFactory(org.apache.log4j.Category log)
           
 void pause()
          Responsible for pausing the collection daemon.
 void refreshServicePackages()
           
 void resume()
          Responsible for resuming the collection daemon.
private  void scheduleExistingInterfaces()
          Schedule existing interfaces for data collection.
(package private)  void scheduleInterface(int nodeId, java.lang.String ipAddress, java.lang.String svcName, boolean existing)
          This method is responsible for scheduling the specified node/address/svcname tuple for data collection.
 void setSchedulingCompleted(boolean schedulingCompleted)
           
 void start()
          Responsible for starting the collection daemon.
 void stop()
          Responsible for stopping the collection daemon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_CATEGORY

private static final java.lang.String LOG4J_CATEGORY
Log4j category

See Also:
Constant Field Values

SQL_RETRIEVE_INTERFACES

private static final java.lang.String SQL_RETRIEVE_INTERFACES
SQL used to retrieve all the interfaces which support a particular service.

See Also:
Constant Field Values

SQL_RETRIEVE_SERVICE_IDS

private static final java.lang.String SQL_RETRIEVE_SERVICE_IDS
SQL used to retrieve all the service id's and names from the database.

See Also:
Constant Field Values

m_singleton

private static final Collectd m_singleton
Singleton instance of the Collectd class


m_serviceIds

private static final java.util.Map m_serviceIds
Holds map of service names to service identifiers


m_collectableServices

private java.util.List m_collectableServices
List of all CollectableService objects.


m_scheduler

private Scheduler m_scheduler
Reference to the collection scheduler


m_status

private int m_status
Status of the Collectd instance.


m_receiver

private BroadcastEventProcessor m_receiver
Reference to the event processor


m_svcCollectors

private static java.util.Map m_svcCollectors
Map of all available ServiceCollector objects indexed by service name


m_schedulingCompleted

private boolean m_schedulingCompleted
Indicates if scheduling of existing interfaces has been completed

Constructor Detail

Collectd

private Collectd()
Constructor.

Method Detail

init

public void init()
Responsible for starting the collection daemon.


createEventProcessor

private void createEventProcessor(org.apache.log4j.Category log)

buildSchedule

private ReadyRunnable buildSchedule(org.apache.log4j.Category log)

createScheduler

private void createScheduler(org.apache.log4j.Category log,
                             CollectdConfiguration config)

buildServiceIdMap

private void buildServiceIdMap(org.apache.log4j.Category log)

instantiateCollectors

private void instantiateCollectors(org.apache.log4j.Category log,
                                   CollectdConfiguration config)

loadscheduledOutagesConfigFactory

private void loadscheduledOutagesConfigFactory(org.apache.log4j.Category log)

loadConfigFactory

private void loadConfigFactory(org.apache.log4j.Category log)

start

public void start()
Responsible for starting the collection daemon.

Specified by:
start in interface Fiber

stop

public void stop()
Responsible for stopping the collection daemon.

Specified by:
stop in interface Fiber

pause

public void pause()
Responsible for pausing the collection daemon.

Specified by:
pause in interface PausableFiber

resume

public void resume()
Responsible for resuming the collection daemon.

Specified by:
resume in interface PausableFiber

getStatus

public int getStatus()
Returns current status of the collection daemon.

Specified by:
getStatus in interface Fiber
Returns:
The current status of the Fiber.

getName

public java.lang.String getName()
Return sthe name of the collection daemon.

Specified by:
getName in interface Fiber
Returns:
The name of the Fiber.

getInstance

public static Collectd getInstance()
Returns singleton instance of the collection daemon.


getScheduler

public Scheduler getScheduler()
Returns reference to the scheduler


getServiceCollector

public ServiceCollector getServiceCollector(java.lang.String svcName)
Returns the loaded ServiceCollector for the specified service name.

Parameters:
svcName - Service name to lookup.
Returns:
ServiceCollector responsible for performing data collection on the specified service.

scheduleExistingInterfaces

private void scheduleExistingInterfaces()
                                 throws java.sql.SQLException
Schedule existing interfaces for data collection.

Throws:
java.sql.SQLException - if database errors encountered.

scheduleInterface

void scheduleInterface(int nodeId,
                       java.lang.String ipAddress,
                       java.lang.String svcName,
                       boolean existing)
This method is responsible for scheduling the specified node/address/svcname tuple for data collection.

Parameters:
nodeId - Node id
ipAddress - IP address
svcName - Service name
existing - True if called by scheduleExistingInterfaces(), false otheriwse

alreadyScheduled

private boolean alreadyScheduled(java.lang.String ipAddress,
                                 java.lang.String pkgName)
Returns true if specified address/pkg pair is already represented in the collectable services list. False otherwise.


isSchedulingCompleted

public boolean isSchedulingCompleted()
Returns:
Returns the schedulingCompleted.

setSchedulingCompleted

public void setSchedulingCompleted(boolean schedulingCompleted)
Parameters:
schedulingCompleted - The schedulingCompleted to set.

refreshServicePackages

public void refreshServicePackages()

OpenNMS API 1.2.3

Generated by eevans on May 29 2005 2015.