org.opennms.netmgt.poller
Class DefaultPollContext

java.lang.Object
  extended by org.opennms.netmgt.poller.DefaultPollContext
All Implemented Interfaces:
EventListener, PollContext

public class DefaultPollContext
extends Object
implements PollContext, EventListener

Represents a DefaultPollContext

Version:
$Id: $
Author:
brozow

Constructor Summary
DefaultPollContext()
           
 
Method Summary
 Event createEvent(String uei, int nodeId, InetAddress address, String svcName, Date date, String reason)
          createEvent
 String getCriticalServiceName()
          getCriticalServiceName
 EventIpcManager getEventManager()
          getEventManager
 String getLocalHostName()
          getLocalHostName
 String getName()
          getName
 PollerConfig getPollerConfig()
          getPollerConfig
 QueryManager getQueryManager()
          getQueryManager
 boolean isNodeProcessingEnabled()
          isNodeProcessingEnabled
 boolean isPollingAllIfCritServiceUndefined()
          isPollingAllIfCritServiceUndefined
 boolean isServiceUnresponsiveEnabled()
          isServiceUnresponsiveEnabled
 void onEvent(Event e)
          Process a sent event.
 void openOutage(PollableService svc, PollEvent svcLostEvent)
          openOutage
 void reparentOutages(String ipAddr, int oldNodeId, int newNodeId)
          reparentOutages
 void resolveOutage(PollableService svc, PollEvent svcRegainEvent)
          resolveOutage
 PollEvent sendEvent(Event event)
          sendEvent
 void setEventManager(EventIpcManager eventManager)
          setEventManager
 void setLocalHostName(String localHostName)
          setLocalHostName
 void setName(String name)
          setName
 void setPollerConfig(PollerConfig pollerConfig)
          setPollerConfig
 void setQueryManager(QueryManager queryManager)
          setQueryManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultPollContext

public DefaultPollContext()
Method Detail

getEventManager

public EventIpcManager getEventManager()

getEventManager

Returns:
a EventIpcManager object.

setEventManager

public void setEventManager(EventIpcManager eventManager)

setEventManager

Parameters:
eventManager - a EventIpcManager object.

setLocalHostName

public void setLocalHostName(String localHostName)

setLocalHostName

Parameters:
localHostName - a String object.

getLocalHostName

public String getLocalHostName()

getLocalHostName

Returns:
a String object.

getName

public String getName()

getName

Specified by:
getName in interface EventListener
Returns:
a String object.

setName

public void setName(String name)

setName

Parameters:
name - a String object.

getPollerConfig

public PollerConfig getPollerConfig()

getPollerConfig

Returns:
a PollerConfig object.

setPollerConfig

public void setPollerConfig(PollerConfig pollerConfig)

setPollerConfig

Parameters:
pollerConfig - a PollerConfig object.

getQueryManager

public QueryManager getQueryManager()

getQueryManager

Returns:
a QueryManager object.

setQueryManager

public void setQueryManager(QueryManager queryManager)

setQueryManager

Parameters:
queryManager - a QueryManager object.

getCriticalServiceName

public String getCriticalServiceName()

getCriticalServiceName

Specified by:
getCriticalServiceName in interface PollContext
Returns:
a String object.

isNodeProcessingEnabled

public boolean isNodeProcessingEnabled()

isNodeProcessingEnabled

Specified by:
isNodeProcessingEnabled in interface PollContext
Returns:
a boolean.

isPollingAllIfCritServiceUndefined

public boolean isPollingAllIfCritServiceUndefined()

isPollingAllIfCritServiceUndefined

Specified by:
isPollingAllIfCritServiceUndefined in interface PollContext
Returns:
a boolean.

sendEvent

public PollEvent sendEvent(Event event)

sendEvent

Specified by:
sendEvent in interface PollContext
Parameters:
event - the event to send
Returns:
the same event

createEvent

public Event createEvent(String uei,
                         int nodeId,
                         InetAddress address,
                         String svcName,
                         Date date,
                         String reason)

createEvent

Specified by:
createEvent in interface PollContext
Parameters:
uei - a String object.
nodeId - a int.
address - a InetAddress object.
svcName - a String object.
date - a Date object.
reason - a String object.
Returns:
a Event object.

openOutage

public void openOutage(PollableService svc,
                       PollEvent svcLostEvent)

openOutage

Specified by:
openOutage in interface PollContext
Parameters:
svc - a PollableService object.
svcLostEvent - a PollEvent object.

resolveOutage

public void resolveOutage(PollableService svc,
                          PollEvent svcRegainEvent)

resolveOutage

Specified by:
resolveOutage in interface PollContext
Parameters:
svc - a PollableService object.
svcRegainEvent - a PollEvent object.

reparentOutages

public void reparentOutages(String ipAddr,
                            int oldNodeId,
                            int newNodeId)

reparentOutages

Specified by:
reparentOutages in interface PollContext
Parameters:
ipAddr - a String object.
oldNodeId - a int.
newNodeId - a int.

isServiceUnresponsiveEnabled

public boolean isServiceUnresponsiveEnabled()

isServiceUnresponsiveEnabled

Specified by:
isServiceUnresponsiveEnabled in interface PollContext
Returns:
a boolean.

onEvent

public void onEvent(Event e)
Process a sent event.

Specified by:
onEvent in interface EventListener
Parameters:
e - a Event object.


Copyright © 2011. All Rights Reserved.