Package com.sodius.oslc.server.oauth
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 Summary
Constructors Constructor Description FunctionalUser(String identifier)
Creates a new functional user instance for the given user identifier.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getIdentifier()
Returns the underlying user identifier.static Optional<FunctionalUser>
of(Consumer consumer)
Returns the functional user associated to the given consumer, if any.static Optional<FunctionalUser>
of(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer)
Returns the functional user associated to the given consumer, if any.static void
set(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer, Optional<FunctionalUser> user)
Associates a functional user to the given consumer.String
toString()
-
-
-
Constructor Detail
-
FunctionalUser
public FunctionalUser(String identifier)
Creates a new functional user instance for the given user identifier.- Parameters:
identifier
- the user identifier.
-
-
Method Detail
-
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:
set(LyoOAuthConsumer, Optional)
-
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:
of(LyoOAuthConsumer)
-
getIdentifier
public String getIdentifier()
Returns the underlying user identifier.- Returns:
- the user identifier.
-
-