Package org.onosproject.ui
Interface UiConnection
-
public interface UiConnection
Abstraction of a user interface session connection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description UiTopoLayout
currentLayout()
Returns the current layout context.java.lang.String
currentView()
Returns the current view identifier.void
sendMessage(com.fasterxml.jackson.databind.node.ObjectNode message)
Sends the specified JSON message to the user interface client.void
sendMessage(java.lang.String type, com.fasterxml.jackson.databind.node.ObjectNode payload)
Composes a message into JSON and sends it to the user interface client.void
setCurrentLayout(UiTopoLayout topoLayout)
Changes the current layout context to the specified layout.void
setCurrentView(java.lang.String viewId)
Sets the currently selected view.java.lang.String
userName()
Returns the name of the logged-in user for which this connection exists.
-
-
-
Method Detail
-
userName
java.lang.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
java.lang.String currentView()
Returns the current view identifier.- Returns:
- current view
-
setCurrentView
void setCurrentView(java.lang.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(java.lang.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
-
-