Interface ExecuteAsService
- All Superinterfaces:
Service
Changes the user context for a section of code.
The code section wrapped with this service call changes the executing user to the one specified.
For example: executeAsService.executeAsJavaSdkUser(()-> do something as Java SDK Service Account user);
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Interface for a command that returns no data, usually represented as a lambda expression. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Execute the command as the Java SDK Service Account.<T> T
executeAsJavaSdkUser
(Supplier<T> command) Execute the supplier as the Java SDK Service Account and return any result.
-
Method Details
-
executeAsJavaSdkUser
Execute the command as the Java SDK Service Account.- Parameters:
command
- the command, usually in the form of a lambda expression
-
executeAsJavaSdkUser
Execute the supplier as the Java SDK Service Account and return any result.- Type Parameters:
T
- the type of the supplied command- Parameters:
command
- the command, usually in the form of a lambda expression- Returns:
- the result produced by the supplier passed in after executing
-