OpenNMS API 1.2.9

## org.opennms.netmgt.poller.mock
Class MockPollContext

    java.lang.Object
      org.opennms.netmgt.poller.mock.MockPollContext

All Implemented Interfaces:
  EventListener, PollContext

public class MockPollContext
extends java.lang.Object
implements PollContext, EventListener

Field Summary
`private java.lang.String` `m_critSvcName`
`private MockDatabase` `m_db`
`private EventIpcManager` `m_eventMgr`
`private MockNetwork` `m_mockNetwork`
`private boolean` `m_nodeProcessingEnabled`
`private java.util.List` `m_pendingPollEvents`
`private boolean` `m_pollingAllIfCritServiceUndefined`
`private boolean` `m_serviceUnresponsiveEnabled`

Constructor Summary
`MockPollContext()`

Method Summary
`void` `closeOutage(PollableService pSvc, PollEvent svcRegainEvent)`
`Event` `createEvent(java.lang.String uei, int nodeId, java.net.InetAddress address, java.lang.String svcName, java.util.Date date)`
`java.lang.String` `getCriticalServiceName()`
`java.lang.String` `getName()` Return the id of the listener
`boolean` `isNodeProcessingEnabled()`
`boolean` `isPollingAllIfCritServiceUndefined()`
`boolean` `isServiceUnresponsiveEnabled()`
`void` `onEvent(Event e)` Process a sent event.
`void` `openOutage(PollableService pSvc, PollEvent svcLostEvent)`
`void` `reparentOutages(java.lang.String ipAddr, int oldNodeId, int newNodeId)`
`void` `resolveOutage(PollableService pSvc, PollEvent svcRegainEvent)`
`PollEvent` `sendEvent(Event event)`
`void` `setCriticalServiceName(java.lang.String svcName)`
`void` `setDatabase(MockDatabase db)`
`void` `setEventMgr(EventIpcManager eventMgr)`
`void` `setMockNetwork(MockNetwork network)`
`void` `setNodeProcessingEnabled(boolean nodeProcessingEnabled)`
`void` `setPollingAllIfCritServiceUndefined(boolean pollingAllIfCritServiceUndefined)`
`void` `setServiceUnresponsiveEnabled(boolean serviceUnresponsiveEnabled)`
`private void` `writeOutage(PollableService pSvc, PollEvent svcLostEvent)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_critSvcName

    private java.lang.String m_critSvcName

### m_nodeProcessingEnabled

    private boolean m_nodeProcessingEnabled

### m_pollingAllIfCritServiceUndefined

    private boolean m_pollingAllIfCritServiceUndefined

### m_serviceUnresponsiveEnabled

    private boolean m_serviceUnresponsiveEnabled

### m_eventMgr

    private EventIpcManager m_eventMgr

### m_db

    private MockDatabase m_db

### m_mockNetwork

    private MockNetwork m_mockNetwork

### m_pendingPollEvents

    private java.util.List m_pendingPollEvents

Constructor Detail

### MockPollContext

    public MockPollContext()

Method Detail

### getCriticalServiceName

    public java.lang.String getCriticalServiceName()

  Specified by:
    `getCriticalServiceName` in interface `PollContext`

### setCriticalServiceName

    public void setCriticalServiceName(java.lang.String svcName)

### isNodeProcessingEnabled

    public boolean isNodeProcessingEnabled()

  Specified by:
    `isNodeProcessingEnabled` in interface `PollContext`
  Returns:

### setNodeProcessingEnabled

    public void setNodeProcessingEnabled(boolean nodeProcessingEnabled)

### isPollingAllIfCritServiceUndefined

    public boolean isPollingAllIfCritServiceUndefined()

  Specified by:
    `isPollingAllIfCritServiceUndefined` in interface `PollContext`
  Returns:

### setPollingAllIfCritServiceUndefined

    public void setPollingAllIfCritServiceUndefined(boolean pollingAllIfCritServiceUndefined)

### setEventMgr

    public void setEventMgr(EventIpcManager eventMgr)

### setDatabase

    public void setDatabase(MockDatabase db)

### setMockNetwork

    public void setMockNetwork(MockNetwork network)

### sendEvent

    public PollEvent sendEvent(Event event)

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

### createEvent

    public Event createEvent(java.lang.String uei,
                             int nodeId,
                             java.net.InetAddress address,
                             java.lang.String svcName,
                             java.util.Date date)

  Specified by:
    `createEvent` in interface `PollContext`
  Parameters:
    `uei` -
    `nodeId` -
    `address` -
    `svcName` -
    `date` -
  Returns:

### openOutage

    public void openOutage(PollableService pSvc,
                           PollEvent svcLostEvent)

  Specified by:
    `openOutage` in interface `PollContext`

### writeOutage

    private void writeOutage(PollableService pSvc,
                             PollEvent svcLostEvent)

### resolveOutage

    public void resolveOutage(PollableService pSvc,
                              PollEvent svcRegainEvent)

  Specified by:
    `resolveOutage` in interface `PollContext`

### closeOutage

    public void closeOutage(PollableService pSvc,
                            PollEvent svcRegainEvent)

### reparentOutages

    public void reparentOutages(java.lang.String ipAddr,
                                int oldNodeId,
                                int newNodeId)

  Specified by:
    `reparentOutages` in interface `PollContext`

### isServiceUnresponsiveEnabled

    public boolean isServiceUnresponsiveEnabled()

  Specified by:
    `isServiceUnresponsiveEnabled` in interface `PollContext`
  Returns:

### setServiceUnresponsiveEnabled

    public void setServiceUnresponsiveEnabled(boolean serviceUnresponsiveEnabled)

### getName

    public java.lang.String getName()

  Description copied from interface: `EventListener`
  Return the id of the listener

  Specified by:
    `getName` in interface `EventListener`

### onEvent

    public void onEvent(Event e)

  Description copied from interface: `EventListener`
  Process a sent event.

  Specified by:
    `onEvent` in interface `EventListener`

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.