Package org.opennms.netmgt.mock
Class MockNetwork
- java.lang.Object
-
- org.opennms.netmgt.mock.MockElement
-
- org.opennms.netmgt.mock.MockContainer<MockContainer<?,?>,MockElement>
-
- org.opennms.netmgt.mock.MockNetwork
-
public class MockNetwork extends MockContainer<MockContainer<?,?>,MockElement>
A test network configuration- Version:
- $Id: $
- Author:
- brozow
-
-
Constructor Summary
Constructors Constructor Description MockNetwork()
Constructor for MockNetwork.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MockInterface
addInterface(int nodeId, java.lang.String ipAddr)
addInterfaceMockInterface
addInterface(java.lang.String ipAddr)
addInterfaceMockNode
addNode(int nodeid, java.lang.String label)
addNodeMockPathOutage
addPathOutage(int nodeid, java.net.InetAddress ipAddr, java.lang.String svcName)
MockService
addService(int nodeId, java.lang.String ipAddr, java.lang.String svcName)
addServiceMockService
addService(java.lang.String svcName)
addServiceEvent
createDeleteEvent()
createDeleteEventEvent
createDownEvent()
createDownEventEvent
createNewEvent()
createNewEventvoid
createStandardNetwork()
createStandardNetworkEvent
createUpEvent()
createUpEventjava.lang.String
getCriticalService()
getCriticalServicejava.util.Map<java.lang.Integer,java.lang.String>
getIdToNameMap()
getIdToNameMapjava.lang.String
getIfAlias()
getIfAliasMockInterface
getInterface(int nodeid, java.lang.String ipAddr)
getInterfaceint
getInterfaceCount()
getInterfaceCountint
getInvalidPollCount()
getInvalidPollCountjava.util.Map<java.lang.String,java.lang.Integer>
getNameToIdMap()
getNameToIdMapMockNode
getNode(int i)
getNodeint
getNodeCount()
getNodeCountint
getNodeIdForInterface(java.lang.String ipAddr)
getNodeIdForInterfaceMockService
getService(int nodeid, java.lang.String ipAddr, java.lang.String svcName)
getServiceint
getServiceCount()
getServiceCountjava.util.List<MockService>
getServices(int nodeId)
void
receivedInvalidPoll(java.lang.String ipAddr, java.lang.String svcName)
receivedInvalidPollvoid
removeElement(MockElement element)
removeElementvoid
removeInterface(MockInterface iface)
removeInterfacevoid
removeNode(MockNode node)
removeNodevoid
removeService(MockService svc)
removeServicevoid
resetInvalidPollCount()
resetInvalidPollCountvoid
setCriticalService(java.lang.String svcName)
setCriticalServicevoid
setIfAlias(java.lang.String ifAlias)
setIfAliasvoid
setIfIndex(int ifIndex)
setIfIndexjava.lang.String
toString()
void
visit(MockVisitor v)
visit-
Methods inherited from class org.opennms.netmgt.mock.MockContainer
addAnticipator, addMember, getMember, getMembers, getPollCount, getPollStatus, removeAnticipator, removeMember, resetPollCount, visitMembers
-
Methods inherited from class org.opennms.netmgt.mock.MockElement
bringDown, bringUnresponsive, bringUp, createDownEvent, createUpEvent, getNetwork, getParent, moveTo, setServicePollStatus
-
-
-
-
Method Detail
-
createDownEvent
public Event createDownEvent()
createDownEvent
- Specified by:
createDownEvent
in classMockElement
- Returns:
- a
Event
object.
-
createUpEvent
public Event createUpEvent()
createUpEvent
- Specified by:
createUpEvent
in classMockElement
- Returns:
- a
Event
object.
-
createNewEvent
public Event createNewEvent()
createNewEvent
- Specified by:
createNewEvent
in classMockElement
- Returns:
- a
Event
object.
-
createDeleteEvent
public Event createDeleteEvent()
createDeleteEvent
- Specified by:
createDeleteEvent
in classMockElement
- Returns:
- a
Event
object.
-
getCriticalService
public java.lang.String getCriticalService()
getCriticalService
- Returns:
- a
String
object.
-
setCriticalService
public void setCriticalService(java.lang.String svcName)
setCriticalService
- Parameters:
svcName
- aString
object.
-
getIfAlias
public java.lang.String getIfAlias()
getIfAlias
- Returns:
- a
String
object.
-
setIfAlias
public void setIfAlias(java.lang.String ifAlias)
setIfAlias
- Parameters:
ifAlias
- aString
object.
-
setIfIndex
public void setIfIndex(int ifIndex)
setIfIndex
- Parameters:
ifIndex
-
-
addInterface
public MockInterface addInterface(int nodeId, java.lang.String ipAddr)
addInterface
- Parameters:
nodeId
- a int.ipAddr
- aString
object.- Returns:
- a
MockInterface
object.
-
addInterface
public MockInterface addInterface(java.lang.String ipAddr)
addInterface
- Parameters:
ipAddr
- aString
object.- Returns:
- a
MockInterface
object.
-
addNode
public MockNode addNode(int nodeid, java.lang.String label)
addNode
- Parameters:
nodeid
- a int.label
- aString
object.- Returns:
- a
MockNode
object.
-
addPathOutage
public MockPathOutage addPathOutage(int nodeid, java.net.InetAddress ipAddr, java.lang.String svcName)
-
addService
public MockService addService(int nodeId, java.lang.String ipAddr, java.lang.String svcName)
addService
- Parameters:
nodeId
- a int.ipAddr
- aString
object.svcName
- aString
object.- Returns:
- a
MockService
object.
-
addService
public MockService addService(java.lang.String svcName)
addService
- Parameters:
svcName
- aString
object.- Returns:
- a
MockService
object.
-
getIdToNameMap
public java.util.Map<java.lang.Integer,java.lang.String> getIdToNameMap()
getIdToNameMap
- Returns:
- a
Map
object.
-
getInterface
public MockInterface getInterface(int nodeid, java.lang.String ipAddr)
getInterface
- Parameters:
nodeid
- a int.ipAddr
- aString
object.- Returns:
- a
MockInterface
object.
-
getInvalidPollCount
public int getInvalidPollCount()
getInvalidPollCount
- Returns:
- a int.
-
getNameToIdMap
public java.util.Map<java.lang.String,java.lang.Integer> getNameToIdMap()
getNameToIdMap
- Returns:
- a
Map
object.
-
getNodeIdForInterface
public int getNodeIdForInterface(java.lang.String ipAddr)
getNodeIdForInterface
- Parameters:
ipAddr
- aString
object.- Returns:
- a int.
-
getService
public MockService getService(int nodeid, java.lang.String ipAddr, java.lang.String svcName)
getService
- Parameters:
nodeid
- a int.ipAddr
- aString
object.svcName
- aString
object.- Returns:
- a
MockService
object.
-
getServices
public java.util.List<MockService> getServices(int nodeId)
-
receivedInvalidPoll
public void receivedInvalidPoll(java.lang.String ipAddr, java.lang.String svcName)
receivedInvalidPoll
- Parameters:
ipAddr
- aString
object.svcName
- aString
object.
-
removeElement
public void removeElement(MockElement element)
removeElement
- Parameters:
element
- aMockElement
object.
-
removeInterface
public void removeInterface(MockInterface iface)
removeInterface
- Parameters:
iface
- aMockInterface
object.
-
removeService
public void removeService(MockService svc)
removeService
- Parameters:
svc
- aMockService
object.
-
resetInvalidPollCount
public void resetInvalidPollCount()
resetInvalidPollCount
-
visit
public void visit(MockVisitor v)
visit
- Overrides:
visit
in classMockContainer<MockContainer<?,?>,MockElement>
- Parameters:
v
- aMockVisitor
object.
-
getNodeCount
public int getNodeCount()
getNodeCount
- Returns:
- a int.
-
getInterfaceCount
public int getInterfaceCount()
getInterfaceCount
- Returns:
- a int.
-
getServiceCount
public int getServiceCount()
getServiceCount
- Returns:
- a int.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
createStandardNetwork
public void createStandardNetwork()
createStandardNetwork
-
-