T1
- generic Switch typeT2
- generic Port typeT3
- Generic Link typepublic abstract class Network<T1 extends Switch,T2 extends Port,T3 extends Link> extends Object implements LLDPEventHandler, OVXSendMsg
Modifier and Type | Field and Description |
---|---|
protected Map<Long,T1> |
dpidMap |
protected Set<T3> |
linkSet |
protected Map<T1,HashSet<T1>> |
neighborMap |
protected Map<T2,T2> |
neighborPortMap |
protected Set<T1> |
switchSet |
Modifier | Constructor and Description |
---|---|
protected |
Network()
Instantiates the network.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addLink(T3 link)
Adds link to topology data structures.
|
protected void |
addSwitch(T1 sw)
Adds switch to topology.
|
abstract boolean |
boot()
Boots this network.
|
T3 |
getLink(T2 srcPort,
T2 dstPort)
Gets the link instance between the given ports.
|
Set<T3> |
getLinks()
Returns the unmodifiable set of links belonging to the network.
|
T2 |
getNeighborPort(T2 port)
Returns neighbor port of given port.
|
Set<T1> |
getNeighbors(T1 sw)
Returns neighbor switches of given switch.
|
T1 |
getSwitch(Long dpid)
Returns switch instance based on its dpid.
|
Set<T1> |
getSwitches()
Returns the unmodifiable set of switches belonging to the network.
|
protected boolean |
removeLink(T3 link)
Removes link to topology.
|
protected boolean |
removeSwitch(T1 sw)
Removes switch from topology.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleLLDP
getName, sendMsg
protected void addLink(T3 link)
link
- the linkprotected boolean removeLink(T3 link)
link
- the linkprotected void addSwitch(T1 sw)
sw
- the switchprotected boolean removeSwitch(T1 sw)
sw
- the switchpublic Set<T1> getNeighbors(T1 sw)
sw
- the switchpublic T2 getNeighborPort(T2 port)
port
- the portpublic T1 getSwitch(Long dpid) throws InvalidDPIDException
dpid
- the datapath IDInvalidDPIDException
public Set<T1> getSwitches()
public Set<T3> getLinks()
public T3 getLink(T2 srcPort, T2 dstPort)
srcPort
- the source portdstPort
- the destination portpublic abstract boolean boot()
Copyright © 2015. All rights reserved.