Class WsData
java.lang.Object
io.openems.common.websocket.WsData
io.openems.edge.controller.api.websocket.WsData
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassertUserIsAuthenticated
(String resource) Throws an exception if the User is not authenticated.Gets the Session Token.getUser()
Gets theUser
.void
Applies a SubscribeChannelsRequest.void
logout()
Logout and invalidate Session.void
Sends the subscribed Channels to the UI session.void
setSessionToken
(String sessionToken) Sets the Session Token.void
Sets theUser
.toString()
Provides a specific toString method.void
Unsets theUser
.Methods inherited from class io.openems.common.websocket.WsData
dispose, getWebsocket, handleJsonrpcResponse, send, send, setWebsocket
-
Constructor Details
-
WsData
-
-
Method Details
-
logout
public void logout()Logout and invalidate Session. -
setSessionToken
Sets the Session Token.- Parameters:
sessionToken
- the Session Token
-
getSessionToken
Gets the Session Token.- Returns:
- the Session Token
-
setUser
Sets theUser
.- Parameters:
user
- theUser
-
unsetUser
public void unsetUser()Unsets theUser
. -
getUser
Gets theUser
. -
assertUserIsAuthenticated
Throws an exception if the User is not authenticated.- Parameters:
resource
- a resource identifier; used for the exception- Returns:
- the current
User
- Throws:
OpenemsError.OpenemsNamedException
- if the current Role privileges are less
-
toString
Description copied from class:WsData
Provides a specific toString method. -
handleSubscribeChannelsRequest
public void handleSubscribeChannelsRequest(SubscribeChannelsRequest request) throws OpenemsError.OpenemsNamedException Applies a SubscribeChannelsRequest.- Parameters:
request
- theSubscribeChannelsRequest
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
sendSubscribedChannels
public void sendSubscribedChannels()Sends the subscribed Channels to the UI session.
-