Package org.onosproject.ui
Interface UiConnection
-
public interface UiConnectionAbstraction of a user interface session connection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UiTopoLayoutcurrentLayout()Returns the current layout context.StringcurrentView()Returns the current view identifier.voidsendMessage(com.fasterxml.jackson.databind.node.ObjectNode message)Sends the specified JSON message to the user interface client.voidsendMessage(String type, com.fasterxml.jackson.databind.node.ObjectNode payload)Composes a message into JSON and sends it to the user interface client.voidsetCurrentLayout(UiTopoLayout topoLayout)Changes the current layout context to the specified layout.voidsetCurrentView(String viewId)Sets the currently selected view.StringuserName()Returns the name of the logged-in user for which this connection exists.
-
-
-
Method Detail
-
userName
String userName()
Returns the name of the logged-in user for which this connection exists.- Returns:
- logged in user name
-
currentLayout
UiTopoLayout currentLayout()
Returns the current layout context.- Returns:
- current topology layout
-
setCurrentLayout
void setCurrentLayout(UiTopoLayout topoLayout)
Changes the current layout context to the specified layout.- Parameters:
topoLayout- new topology layout context
-
currentView
String currentView()
Returns the current view identifier.- Returns:
- current view
-
setCurrentView
void setCurrentView(String viewId)
Sets the currently selected view.- Parameters:
viewId- view identifier
-
sendMessage
void sendMessage(com.fasterxml.jackson.databind.node.ObjectNode message)
Sends the specified JSON message to the user interface client. It is assumed that the message is already correctly formatted and ready to send.- Parameters:
message- message to send
-
sendMessage
void sendMessage(String type, com.fasterxml.jackson.databind.node.ObjectNode payload)
Composes a message into JSON and sends it to the user interface client.- Parameters:
type- message (event) typepayload- message payload
-
-