public class UiTopoSession extends Object implements UiModelListener
UiTopoLayoutService to access
UiTopoLayouts, and with the UiSharedTopologyModel which
maintains a local model of the network entities, tailored specifically
for displaying on the UI.
Note that an instance of this class will be created for each
UiWebSocket connection, and will contain
the state of how the topology is laid out for the logged-in user.
The expected pattern is for the Topo2ViewMessageHandler to obtain
a reference to the session instance (via the UiWebSocket), and
interact with it when topo-related events come in from the client.
| Constructor and Description |
|---|
UiTopoSession(UiWebSocket webSocket,
UiSharedTopologyModel model,
org.onosproject.ui.UiTopoLayoutService layoutService)
Creates a new topology session for the specified web socket connection.
|
| Modifier and Type | Method and Description |
|---|---|
List<org.onosproject.ui.model.topo.UiTopoLayout> |
breadCrumbs()
Returns the breadcrumb trail from current layout to root.
|
org.onosproject.ui.model.topo.UiTopoLayout |
currentLayout()
Returns the current layout context.
|
void |
destroy()
Destroys the session; unregistering from the shared model.
|
void |
enableEvent(boolean enabled)
Enables or disables the transmission of topology event update messages.
|
void |
event(UiModelEvent event) |
List<org.onosproject.ui.model.topo.UiClusterMember> |
getAllInstances()
Returns the list of ONOS instances (cluster members).
|
List<org.onosproject.ui.model.topo.UiSynthLink> |
getLinks(org.onosproject.ui.model.topo.UiTopoLayout layout)
Returns the (synthetic) links of the region in the specified layout.
|
Set<org.onosproject.ui.model.topo.UiNode> |
getPeerNodes(org.onosproject.ui.model.topo.UiTopoLayout layout)
Returns the regions/devices that are "peers" to this region.
|
org.onosproject.ui.model.topo.UiRegion |
getRegion(org.onosproject.ui.model.topo.UiTopoLayout layout)
Returns the region for the specified layout.
|
Set<org.onosproject.ui.model.topo.UiRegion> |
getSubRegions(org.onosproject.ui.model.topo.UiTopoLayout layout)
Returns the subregions of the region in the specified layout.
|
void |
init()
Initializes the session; registering with the shared model.
|
void |
navToRegion(String regionId)
Navigates to the specified region by setting the associated layout as
current.
|
void |
refreshModel()
Refreshes the model's internal state.
|
void |
setCurrentLayout(org.onosproject.ui.model.topo.UiTopoLayout topoLayout)
Changes the current layout context to the specified layout.
|
String |
toString() |
public UiTopoSession(UiWebSocket webSocket, UiSharedTopologyModel model, org.onosproject.ui.UiTopoLayoutService layoutService)
webSocket - web socketmodel - share topology modellayoutService - topology layout servicepublic void init()
public void destroy()
public void event(UiModelEvent event)
event in interface org.onosproject.event.EventListener<UiModelEvent>public org.onosproject.ui.model.topo.UiTopoLayout currentLayout()
public List<org.onosproject.ui.model.topo.UiTopoLayout> breadCrumbs()
public void setCurrentLayout(org.onosproject.ui.model.topo.UiTopoLayout topoLayout)
topoLayout - new topology layout contextpublic void enableEvent(boolean enabled)
enabled - true if messages should be sentpublic List<org.onosproject.ui.model.topo.UiClusterMember> getAllInstances()
public org.onosproject.ui.model.topo.UiRegion getRegion(org.onosproject.ui.model.topo.UiTopoLayout layout)
layout - layout filterpublic Set<org.onosproject.ui.model.topo.UiNode> getPeerNodes(org.onosproject.ui.model.topo.UiTopoLayout layout)
layout - the layout being viewedpublic Set<org.onosproject.ui.model.topo.UiRegion> getSubRegions(org.onosproject.ui.model.topo.UiTopoLayout layout)
layout - the layout being viewedpublic List<org.onosproject.ui.model.topo.UiSynthLink> getLinks(org.onosproject.ui.model.topo.UiTopoLayout layout)
layout - the layout being viewedpublic void refreshModel()
public void navToRegion(String regionId)
regionId - region identifier