Class FunctionalUser

java.lang.Object
com.sodius.oslc.server.oauth.FunctionalUser

public class FunctionalUser extends Object
Represents a functional user, which is a an identity associated to a consumer registered in the application. A functional user enables a remote server to perform a programmatic request in the application on behalf of this user, using a consumer and without having knowledge on the underlying identity.
Since:
2.0.0
  • Constructor Details

    • FunctionalUser

      public FunctionalUser(String identifier)
      Creates a new functional user instance for the given user identifier.
      Parameters:
      identifier - the user identifier.
  • Method Details

    • of

      public static Optional<FunctionalUser> of(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)
      Returns the functional user associated to the given consumer, if any.
      Parameters:
      consumer - a consumer.
      Returns:
      the functional user associated to the given consumer, Optional.empty() if none.
      See Also:
    • of

      public static Optional<FunctionalUser> of(Consumer consumer)
      Returns the functional user associated to the given consumer, if any.
      Parameters:
      consumer - a consumer.
      Returns:
      the functional user associated to the given consumer, Optional.empty() if none.
    • set

      public static void set(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer, Optional<FunctionalUser> user)
      Associates a functional user to the given consumer.
      Parameters:
      consumer - the consumer which must be associated to this functional user.
      user - the user to associate to the consumer, Optional.empty() if consumer should have no functional user.
      See Also:
    • getIdentifier

      public String getIdentifier()
      Returns the underlying user identifier.
      Returns:
      the user identifier.
    • toString

      public String toString()
      Overrides:
      toString in class Object