|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.floodlightcontroller.core.OFSwitchBase.PortManager
protected class OFSwitchBase.PortManager
Manages the ports of this switch. Provides methods to query and update the stored ports. The class ensures that every port name and port number is unique. When updating ports the class checks if port number <-> port name mappings have change due to the update. If a new port P has number and port that are inconsistent with the previous mapping(s) the class will delete all previous ports with name or number of the new port and then add the new port. Port names are stored as-is but they are compared case-insensitive The methods that change the stored ports return a list of PortChangeEvents that represent the changes that have been applied to the port list so that IOFSwitchListeners can be notified about the changes. Implementation notes: - We keep several different representations of the ports to allow for fast lookups - Ports are stored in unchangeable lists. When a port is modified new data structures are allocated. - We use a read-write-lock for synchronization, so multiple readers are allowed.
Constructor Summary | |
---|---|
OFSwitchBase.PortManager()
|
Method Summary | |
---|---|
OrderedCollection<IOFSwitch.PortChangeEvent> |
comparePorts(java.util.Collection<ImmutablePort> newPorts)
Compare the current ports of this switch to the newPorts list and return the changes that would be applied to transfort the current ports to the new ports. |
java.util.List<java.lang.Integer> |
getEnabledPortNumbers()
|
java.util.List<ImmutablePort> |
getEnabledPorts()
|
ImmutablePort |
getPort(java.lang.Integer portNumber)
|
ImmutablePort |
getPort(java.lang.String name)
|
java.util.List<ImmutablePort> |
getPorts()
|
OrderedCollection<IOFSwitch.PortChangeEvent> |
getSinglePortChanges(ImmutablePort newPort)
Given a new or modified port newPort, returns the list of PortChangeEvents to "transform" the current ports stored by this switch to include / represent the new port. |
OrderedCollection<IOFSwitch.PortChangeEvent> |
handlePortStatusMessage(OFPortStatus ps)
Handle a OFPortStatus message, update the internal data structures that store ports and return the list of OFChangeEvents. |
OrderedCollection<IOFSwitch.PortChangeEvent> |
updatePorts(java.util.Collection<ImmutablePort> newPorts)
Compare the current ports of this switch to the newPorts list and return the changes that would be applied to transform the current ports to the new ports. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OFSwitchBase.PortManager()
Method Detail |
---|
public OrderedCollection<IOFSwitch.PortChangeEvent> handlePortStatusMessage(OFPortStatus ps)
ps
-
public OrderedCollection<IOFSwitch.PortChangeEvent> getSinglePortChanges(ImmutablePort newPort)
newPort
- the new or modified port.
public OrderedCollection<IOFSwitch.PortChangeEvent> comparePorts(java.util.Collection<ImmutablePort> newPorts)
#compareAndUpdatePorts(List, boolean)
newPorts
- the list of new ports
public OrderedCollection<IOFSwitch.PortChangeEvent> updatePorts(java.util.Collection<ImmutablePort> newPorts)
#compareAndUpdatePorts(List, boolean)
newPorts
- the list of new ports
public ImmutablePort getPort(java.lang.String name)
public ImmutablePort getPort(java.lang.Integer portNumber)
public java.util.List<ImmutablePort> getPorts()
public java.util.List<ImmutablePort> getEnabledPorts()
public java.util.List<java.lang.Integer> getEnabledPortNumbers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |