Package org.onosproject.ui.topo
Class NodeSelection
- java.lang.Object
-
- org.onosproject.ui.topo.NodeSelection
-
public class NodeSelection extends Object
Encapsulates a selection of devices, hosts and links from the topology view.
-
-
Constructor Summary
Constructors Constructor Description NodeSelection(com.fasterxml.jackson.databind.node.ObjectNode payload, DeviceService deviceService, HostService hostService, LinkService linkService)
Creates a node selection entity, from the given payload, using the supplied link, device and host services.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Device>
devices()
Returns a view of the selected devices (hover not included).Set<Device>
devicesWithHover()
Returns a view of the selected devices, including the hovered device if there was one.Set<Host>
hosts()
Returns a view of the selected hosts (hover not included).Set<Host>
hostsWithHover()
Returns a view of the selected hosts, including the hovered host if thee was one.Element
hovered()
Returns the element (link, host or device) over which the mouse was hovering, or null.Set<Link>
links()
Returns a view of the selected links (hover not included).Set<Link>
linksWithHover()
Returns a view of the selected links, including the hovered link if thee was one.boolean
none()
Returns true if nothing is selected.String
toString()
-
-
-
Constructor Detail
-
NodeSelection
public NodeSelection(com.fasterxml.jackson.databind.node.ObjectNode payload, DeviceService deviceService, HostService hostService, LinkService linkService)
Creates a node selection entity, from the given payload, using the supplied link, device and host services. Note that if a link, device or host was hovered over by the mouse, it is available viahovered()
.- Parameters:
payload
- message payloaddeviceService
- device servicehostService
- host servicelinkService
- link service
-
-
Method Detail
-
devices
public Set<Device> devices()
Returns a view of the selected devices (hover not included).- Returns:
- selected devices
-
links
public Set<Link> links()
Returns a view of the selected links (hover not included).- Returns:
- selected links
-
devicesWithHover
public Set<Device> devicesWithHover()
Returns a view of the selected devices, including the hovered device if there was one.- Returns:
- selected (plus hovered) devices
-
hosts
public Set<Host> hosts()
Returns a view of the selected hosts (hover not included).- Returns:
- selected hosts
-
hostsWithHover
public Set<Host> hostsWithHover()
Returns a view of the selected hosts, including the hovered host if thee was one.- Returns:
- selected (plus hovered) hosts
-
linksWithHover
public Set<Link> linksWithHover()
Returns a view of the selected links, including the hovered link if thee was one.- Returns:
- selected (plus hovered) links
-
hovered
public Element hovered()
Returns the element (link, host or device) over which the mouse was hovering, or null.- Returns:
- element hovered over
-
none
public boolean none()
Returns true if nothing is selected.- Returns:
- true if nothing selected
-
-