java.lang.Object
io.openems.common.websocket.WsData
io.openems.edge.controller.api.websocket.WsData

public class WsData extends WsData
  • Constructor Details

  • Method Details

    • logout

      public void logout()
      Logout and invalidate Session.
    • setSessionToken

      public void setSessionToken(String sessionToken)
      Sets the Session Token.
      Parameters:
      sessionToken - the Session Token
    • getSessionToken

      public String getSessionToken()
      Gets the Session Token.
      Returns:
      the Session Token
    • setUser

      public void setUser(User user)
      Sets the User.
      Parameters:
      user - the User
    • unsetUser

      public void unsetUser()
      Unsets the User.
    • getUser

      public Optional<User> getUser()
      Gets the User.
      Returns:
      the Optional User
    • assertUserIsAuthenticated

      public User assertUserIsAuthenticated(String resource) throws OpenemsError.OpenemsNamedException
      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

      public String toString()
      Description copied from class: WsData
      Provides a specific toString method.
      Specified by:
      toString in class WsData
      Returns:
      a specific string for this instance
    • handleSubscribeChannelsRequest

      public void handleSubscribeChannelsRequest(SubscribeChannelsRequest request) throws OpenemsError.OpenemsNamedException
      Applies a SubscribeChannelsRequest.
      Parameters:
      request - the SubscribeChannelsRequest
      Throws:
      OpenemsError.OpenemsNamedException - on error
    • sendSubscribedChannels

      public void sendSubscribedChannels()
      Sends the subscribed Channels to the UI session.