public class LinkServiceAdapter extends Object implements LinkService
LinkService
API, provided specifically for
unit tests and implementers to use, to insulate from changes in the API.Constructor and Description |
---|
LinkServiceAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(LinkListener listener)
Adds the specified link update listener.
|
Iterator<Link> |
getLinks()
Returns an iterator over the set of all infrastructure links.
|
Set<Link> |
getLinks(ConnectionPoint cp)
Returns the link(s) that contain the given connection point.
|
Set<Link> |
getLinks(DeviceId device)
Returns the set of all links for which the given device is either
the source or the destination.
|
Set<Link> |
getLinks(DeviceId deviceA,
DeviceId deviceB)
Returns the set of all links between the two given devices.
|
Set<Link> |
getLinksFrom(ConnectionPoint cp)
Returns the set of all links for which this connection point
is the source.
|
Set<Link> |
getLinksFrom(DeviceId device)
Returns the set of all links for which this device is the source.
|
Set<Link> |
getLinksTo(ConnectionPoint cp)
Returns the set of all links for which this connection point
is the destination.
|
Set<Link> |
getLinksTo(DeviceId device)
Returns the set of all links for which this device is
the destination.
|
Set<LinkListener> |
getListeners()
Returns the set of all link update listeners.
|
void |
removeListener(LinkListener listener)
Removes the specified link update listener.
|
public Iterator<Link> getLinks()
LinkService
getLinks
in interface LinkService
public Set<Link> getLinks(DeviceId device)
LinkService
getLinks
in interface LinkService
device
- the device IDpublic Set<Link> getLinks(DeviceId deviceA, DeviceId deviceB)
LinkService
getLinks
in interface LinkService
deviceA
- the first device IDdeviceB
- the second device IDpublic Set<Link> getLinksFrom(DeviceId device)
LinkService
getLinksFrom
in interface LinkService
device
- the device IDpublic Set<Link> getLinksTo(DeviceId device)
LinkService
getLinksTo
in interface LinkService
device
- the device IDpublic Set<Link> getLinks(ConnectionPoint cp)
LinkService
Note that a connection point can appear to be part of more than one link when switches not connected to this controller are in the path.
getLinks
in interface LinkService
cp
- the connection point to matchpublic Set<Link> getLinksFrom(ConnectionPoint cp)
LinkService
getLinksFrom
in interface LinkService
cp
- the source connection pointpublic Set<Link> getLinksTo(ConnectionPoint cp)
LinkService
getLinksTo
in interface LinkService
cp
- the source connection pointpublic void addListener(LinkListener listener)
LinkService
addListener
in interface LinkService
listener
- the listener to be addedpublic void removeListener(LinkListener listener)
LinkService
removeListener
in interface LinkService
listener
- the listener to be removedpublic Set<LinkListener> getListeners()
LinkService
getListeners
in interface LinkService
Copyright © 2015. All Rights Reserved.