Package org.opennms.netmgt.poller
Class DefaultPollContext
- java.lang.Object
-
- 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
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DISABLE_POLL_TIMESTAMP_TRACKING
Poll timestamps are updated using a DB transaction in the same thread and immediately following the poll.
-
Constructor Summary
Constructors Constructor Description DefaultPollContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Event
createEvent(String uei, int nodeId, InetAddress address, String svcName, Date date, String reason)
createEventString
getCriticalServiceName()
getCriticalServiceNameEventIpcManager
getEventManager()
getEventManagerString
getLocalHostName()
getLocalHostNameLocationAwarePingClient
getLocationAwarePingClient()
String
getName()
getNamePollerConfig
getPollerConfig()
getPollerConfigQueryManager
getQueryManager()
getQueryManagerboolean
isNodeProcessingEnabled()
isNodeProcessingEnabledboolean
isPollingAllIfCritServiceUndefined()
isPollingAllIfCritServiceUndefinedboolean
isServiceUnresponsiveEnabled()
isServiceUnresponsiveEnabledvoid
onEvent(IEvent event)
Process a sent event.void
openOutage(PollableService svc, PollEvent svcLostEvent)
openOutagevoid
resolveOutage(PollableService svc, PollEvent svcRegainEvent)
resolveOutagePollEvent
sendEvent(Event event)
sendEventvoid
setEventManager(EventIpcManager eventManager)
setEventManagervoid
setLocalHostName(String localHostName)
setLocalHostNamevoid
setLocationAwarePingClient(LocationAwarePingClient locationAwarePingClient)
void
setName(String name)
setNamevoid
setPollerConfig(PollerConfig pollerConfig)
setPollerConfigvoid
setQueryManager(QueryManager queryManager)
setQueryManagervoid
trackPoll(PollableService service, PollStatus result)
-
-
-
Field Detail
-
DISABLE_POLL_TIMESTAMP_TRACKING
public static final boolean DISABLE_POLL_TIMESTAMP_TRACKING
Poll timestamps are updated using a DB transaction in the same thread and immediately following the poll. This may cause unnecessary overhead in extreme cases, so we add the ability to disable this functionality.
-
-
Method Detail
-
getEventManager
public EventIpcManager getEventManager()
getEventManager
- Returns:
- a
EventIpcManager
object.
-
setEventManager
public void setEventManager(EventIpcManager eventManager)
setEventManager
- Parameters:
eventManager
- aEventIpcManager
object.
-
setLocalHostName
public void setLocalHostName(String localHostName)
setLocalHostName
- Parameters:
localHostName
- aString
object.
-
getName
public String getName()
getName
- Specified by:
getName
in interfaceEventListener
- Returns:
- a
String
object.
-
getPollerConfig
public PollerConfig getPollerConfig()
getPollerConfig
- Returns:
- a
PollerConfig
object.
-
setPollerConfig
public void setPollerConfig(PollerConfig pollerConfig)
setPollerConfig
- Parameters:
pollerConfig
- aPollerConfig
object.
-
getQueryManager
public QueryManager getQueryManager()
getQueryManager
- Returns:
- a
QueryManager
object.
-
setQueryManager
public void setQueryManager(QueryManager queryManager)
setQueryManager
- Parameters:
queryManager
- aQueryManager
object.
-
getLocationAwarePingClient
public LocationAwarePingClient getLocationAwarePingClient()
-
setLocationAwarePingClient
public void setLocationAwarePingClient(LocationAwarePingClient locationAwarePingClient)
-
getCriticalServiceName
public String getCriticalServiceName()
getCriticalServiceName
- Specified by:
getCriticalServiceName
in interfacePollContext
- Returns:
- a
String
object.
-
isNodeProcessingEnabled
public boolean isNodeProcessingEnabled()
isNodeProcessingEnabled
- Specified by:
isNodeProcessingEnabled
in interfacePollContext
- Returns:
- a boolean.
-
isPollingAllIfCritServiceUndefined
public boolean isPollingAllIfCritServiceUndefined()
isPollingAllIfCritServiceUndefined
- Specified by:
isPollingAllIfCritServiceUndefined
in interfacePollContext
- Returns:
- a boolean.
-
sendEvent
public PollEvent sendEvent(Event event)
sendEvent
- Specified by:
sendEvent
in interfacePollContext
- 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 interfacePollContext
- Parameters:
uei
- aString
object.nodeId
- a int.address
- aInetAddress
object.svcName
- aString
object.date
- aDate
object.reason
- aString
object.- Returns:
- a
Event
object.
-
openOutage
public void openOutage(PollableService svc, PollEvent svcLostEvent)
openOutage
- Specified by:
openOutage
in interfacePollContext
- Parameters:
svc
- aPollableService
object.svcLostEvent
- aPollEvent
object.
-
resolveOutage
public void resolveOutage(PollableService svc, PollEvent svcRegainEvent)
resolveOutage
- Specified by:
resolveOutage
in interfacePollContext
- Parameters:
svc
- aPollableService
object.svcRegainEvent
- aPollEvent
object.
-
isServiceUnresponsiveEnabled
public boolean isServiceUnresponsiveEnabled()
isServiceUnresponsiveEnabled
- Specified by:
isServiceUnresponsiveEnabled
in interfacePollContext
- Returns:
- a boolean.
-
onEvent
public void onEvent(IEvent event)
Process a sent event.- Specified by:
onEvent
in interfaceEventListener
- Parameters:
event
- aIEvent
object.
-
trackPoll
public void trackPoll(PollableService service, PollStatus result)
- Specified by:
trackPoll
in interfacePollContext
-
-