Class DefaultCockpitUserService

  • All Implemented Interfaces:
    CockpitUserService, java.io.Serializable

    public class DefaultCockpitUserService
    extends java.lang.Object
    implements CockpitUserService, java.io.Serializable
    Default implementation of service to get and change the current user.
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultCockpitUserService

        public DefaultCockpitUserService()
    • Method Detail

      • setCurrentUser

        public void setCurrentUser​(java.lang.String userId)
        Description copied from interface: CockpitUserService
        Sets the current user to the user with the specified ID
        Specified by:
        setCurrentUser in interface CockpitUserService
        Parameters:
        userId - non-empty user ID
      • isAdmin

        public boolean isAdmin​(java.lang.String userId)
        Checks if the given userId belongs to an administrator user. This method should be overridden in child classes otherwise it rises UnsupportedOperationException when called.
        Specified by:
        isAdmin in interface CockpitUserService
        Parameters:
        userId - non-empty user ID
        Returns:
        true if user with the specified ID is an administrator, false otherwise