Package com.sodius.oslc.server.oauth
Class FunctionalUser
java.lang.Object
com.sodius.oslc.server.oauth.FunctionalUser
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
ConstructorsConstructorDescriptionFunctionalUser(String identifier) Creates a new functional user instance for the given user identifier. -
Method Summary
Modifier and TypeMethodDescriptionReturns the underlying user identifier.static Optional<FunctionalUser> 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 voidset(org.eclipse.lyo.server.oauth.core.consumer.LyoOAuthConsumer consumer, Optional<FunctionalUser> user) Associates a functional user to the given consumer.toString()
-
Constructor Details
-
FunctionalUser
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
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
Returns the underlying user identifier.- Returns:
- the user identifier.
-
toString
-