Interface ExecuteAsService

All Superinterfaces:
Service

public interface ExecuteAsService extends 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 Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Interface for a command that returns no data, usually represented as a lambda expression.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Execute the command as the Java SDK Service Account.
    <T> T
    Execute the supplier as the Java SDK Service Account and return any result.
  • Method Details

    • executeAsJavaSdkUser

      void executeAsJavaSdkUser(ExecuteAsService.CommandNoReturn command)
      Execute the command as the Java SDK Service Account.
      Parameters:
      command - the command, usually in the form of a lambda expression
    • executeAsJavaSdkUser

      <T> T executeAsJavaSdkUser(Supplier<T> command)
      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