Interface Scoped

All Known Implementing Classes:
FlexibleIdentityAssociation, SecurityIdentity

public interface Scoped
An identity configuration which can be applied on a scoped basis.
Author:
David M. Lloyd
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    runAs(Runnable action)
    Run an action under this identity.
    default <T> T
    runAs(Callable<T> action)
    Run an action under this identity.
    default <R> R
    Run an action under this identity.
    default <T, U> boolean
    runAsBiPredicate(BiPredicate<T,U> predicate, T param1, U param2)
    Run an action under this identity.
    <T, U> void
    runAsConsumer(BiConsumer<T,U> action, T parameter1, U parameter2)
    Run an action under this identity.
    default <T> void
    runAsConsumer(Consumer<T> action, T parameter)
    Run an action under this identity.
    <T, U, E extends Exception>
    void
    runAsConsumerEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> action, T parameter1, U parameter2)
    Run an action under this identity.
    default <T, E extends Exception>
    void
    runAsConsumerEx(org.wildfly.common.function.ExceptionConsumer<T,E> action, T parameter)
    Run an action under this identity.
    default <T, U, E extends Exception>
    boolean
    runAsExBiPredicate(org.wildfly.common.function.ExceptionBiPredicate<T,U,E> predicate, T param1, U param2)
    Run an action under this identity.
    default <R> R
    Run an action under this identity.
    default <T, E extends Exception>
    T
    runAsExIntFunction(org.wildfly.common.function.ExceptionIntFunction<T,E> action, int value)
    Run an action under this identity.
    default <T, E extends Exception>
    T
    runAsExLongFunction(org.wildfly.common.function.ExceptionLongFunction<T,E> action, long value)
    Run an action under this identity.
    default <T, E extends Exception>
    boolean
    runAsExPredicate(org.wildfly.common.function.ExceptionPredicate<T,E> predicate, T param)
    Run an action under this identity.
    <T, U, R> R
    runAsFunction(BiFunction<T,U,R> action, T parameter1, U parameter2)
    Run an action under this identity.
    default <T, R> R
    runAsFunction(Function<T,R> action, T parameter)
    Run an action under this identity.
    <T, U, R, E extends Exception>
    R
    runAsFunctionEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> action, T parameter1, U parameter2)
    Run an action under this identity.
    default <T, R, E extends Exception>
    R
    runAsFunctionEx(org.wildfly.common.function.ExceptionFunction<T,R,E> action, T parameter)
    Run an action under this identity.
    default <T> T
    runAsIntFunction(IntFunction<T> action, int value)
    Run an action under this identity.
    default <T> T
    runAsLongFunction(LongFunction<T> action, long value)
    Run an action under this identity.
    <T> void
    runAsObjIntConsumer(ObjIntConsumer<T> action, T parameter1, int parameter2)
    Run an action under this identity.
    <T, E extends Exception>
    void
    runAsObjIntConsumerEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> action, T parameter1, int parameter2)
    Run an action under this identity.
    default <T> boolean
    runAsPredicate(Predicate<T> predicate, T param)
    Run an action under this identity.
    default <T> T
    Run an action under this identity.
    default <T, E extends Exception>
    T
    runAsSupplierEx(org.wildfly.common.function.ExceptionSupplier<T,E> action)
    Run an action under this identity.
  • Method Details

    • runAs

      default void runAs(Runnable action)
      Run an action under this identity.
      Parameters:
      action - the action to run
    • runAs

      default <T> T runAs(Callable<T> action) throws Exception
      Run an action under this identity.
      Type Parameters:
      T - the action return type
      Parameters:
      action - the action to run
      Returns:
      the action result (may be null)
      Throws:
      Exception - if the action fails
    • runAsFunction

      default <T, R> R runAsFunction(Function<T,R> action, T parameter)
      Run an action under this identity.
      Type Parameters:
      R - the action return type
      T - the action parameter type
      Parameters:
      parameter - the parameter to pass to the action
      action - the action to run
      Returns:
      the action result (may be null)
    • runAsFunction

      <T, U, R> R runAsFunction(BiFunction<T,U,R> action, T parameter1, U parameter2)
      Run an action under this identity.
      Type Parameters:
      R - the action return type
      T - the action first parameter type
      U - the action second parameter type
      Parameters:
      parameter1 - the first parameter to pass to the action
      parameter2 - the second parameter to pass to the action
      action - the action to run
      Returns:
      the action result (may be null)
    • runAsConsumer

      default <T> void runAsConsumer(Consumer<T> action, T parameter)
      Run an action under this identity.
      Type Parameters:
      T - the action parameter type
      Parameters:
      parameter - the parameter to pass to the action
      action - the action to run
    • runAsConsumer

      <T, U> void runAsConsumer(BiConsumer<T,U> action, T parameter1, U parameter2)
      Run an action under this identity.
      Type Parameters:
      T - the action first parameter type
      U - the action second parameter type
      Parameters:
      parameter1 - the first parameter to pass to the action
      parameter2 - the second parameter to pass to the action
      action - the action to run
    • runAsObjIntConsumer

      <T> void runAsObjIntConsumer(ObjIntConsumer<T> action, T parameter1, int parameter2)
      Run an action under this identity.
      Type Parameters:
      T - the action first parameter type
      Parameters:
      parameter1 - the first parameter to pass to the action
      parameter2 - the second parameter to pass to the action
      action - the action to run
    • runAsSupplier

      default <T> T runAsSupplier(Supplier<T> action)
      Run an action under this identity.
      Type Parameters:
      T - the action return type
      Parameters:
      action - the action to run
      Returns:
      the action result (may be null)
    • runAsFunctionEx

      default <T, R, E extends Exception> R runAsFunctionEx(org.wildfly.common.function.ExceptionFunction<T,R,E> action, T parameter) throws E
      Run an action under this identity.
      Type Parameters:
      R - the action return type
      T - the action parameter type
      E - the action exception type
      Parameters:
      parameter - the parameter to pass to the action
      action - the action to run
      Returns:
      the action result (may be null)
      Throws:
      E - if the action throws this exception
    • runAsFunctionEx

      <T, U, R, E extends Exception> R runAsFunctionEx(org.wildfly.common.function.ExceptionBiFunction<T,U,R,E> action, T parameter1, U parameter2) throws E
      Run an action under this identity.
      Type Parameters:
      R - the action return type
      T - the action first parameter type
      U - the action second parameter type
      E - the action exception type
      Parameters:
      parameter1 - the first parameter to pass to the action
      parameter2 - the second parameter to pass to the action
      action - the action to run
      Returns:
      the action result (may be null)
      Throws:
      E - if the action throws this exception
    • runAsConsumerEx

      default <T, E extends Exception> void runAsConsumerEx(org.wildfly.common.function.ExceptionConsumer<T,E> action, T parameter) throws E
      Run an action under this identity.
      Type Parameters:
      T - the action parameter type
      E - the action exception type
      Parameters:
      parameter - the parameter to pass to the action
      action - the action to run
      Throws:
      E - if the action throws this exception
    • runAsConsumerEx

      <T, U, E extends Exception> void runAsConsumerEx(org.wildfly.common.function.ExceptionBiConsumer<T,U,E> action, T parameter1, U parameter2) throws E
      Run an action under this identity.
      Type Parameters:
      T - the action first parameter type
      U - the action second parameter type
      E - the action exception type
      Parameters:
      parameter1 - the first parameter to pass to the action
      parameter2 - the second parameter to pass to the action
      action - the action to run
      Throws:
      E - if the action throws this exception
    • runAsObjIntConsumerEx

      <T, E extends Exception> void runAsObjIntConsumerEx(org.wildfly.common.function.ExceptionObjIntConsumer<T,E> action, T parameter1, int parameter2) throws E
      Run an action under this identity.
      Type Parameters:
      T - the action first parameter type
      E - the action exception type
      Parameters:
      parameter1 - the first parameter to pass to the action
      parameter2 - the second parameter to pass to the action
      action - the action to run
      Throws:
      E - if the action throws this exception
    • runAsSupplierEx

      default <T, E extends Exception> T runAsSupplierEx(org.wildfly.common.function.ExceptionSupplier<T,E> action) throws E
      Run an action under this identity.
      Type Parameters:
      T - the action return type
      E - the action exception type
      Parameters:
      action - the action to run
      Returns:
      the action result (may be null)
      Throws:
      E - if the action throws this exception
    • runAsAction

      default <R> R runAsAction(PrivilegedAction<R> action)
      Run an action under this identity.
      Type Parameters:
      R - the return value type
      Parameters:
      action - the task to run (must not be null)
      Returns:
      the action return value
    • runAsExceptionAction

      default <R> R runAsExceptionAction(PrivilegedExceptionAction<R> action) throws PrivilegedActionException
      Run an action under this identity.
      Type Parameters:
      R - the return value type
      Parameters:
      action - the task to run (must not be null)
      Returns:
      the action return value
      Throws:
      PrivilegedActionException - if the action fails with an exception
    • runAsBiPredicate

      default <T, U> boolean runAsBiPredicate(BiPredicate<T,U> predicate, T param1, U param2)
      Run an action under this identity.
      Type Parameters:
      T - the first parameter type
      U - the second parameter type
      Parameters:
      predicate - the task to run (must not be null)
      param1 - the first parameter to pass to the task
      param2 - the second parameter to pass to the task
      Returns:
      the action return value
      Throws:
      UnsupportedOperationException - if this operation is not implemented
    • runAsExBiPredicate

      default <T, U, E extends Exception> boolean runAsExBiPredicate(org.wildfly.common.function.ExceptionBiPredicate<T,U,E> predicate, T param1, U param2) throws E
      Run an action under this identity.
      Type Parameters:
      T - the first parameter type
      U - the second parameter type
      E - the exception type
      Parameters:
      predicate - the task to run (must not be null)
      param1 - the first parameter to pass to the task
      param2 - the second parameter to pass to the task
      Returns:
      the action return value
      Throws:
      E - if an exception occurs in the task
      UnsupportedOperationException - if this operation is not implemented
    • runAsPredicate

      default <T> boolean runAsPredicate(Predicate<T> predicate, T param)
      Run an action under this identity.
      Type Parameters:
      T - the first parameter type
      Parameters:
      predicate - the task to run (must not be null)
      param - the parameter to pass to the task
      Returns:
      the action return value
    • runAsExPredicate

      default <T, E extends Exception> boolean runAsExPredicate(org.wildfly.common.function.ExceptionPredicate<T,E> predicate, T param) throws E
      Run an action under this identity.
      Type Parameters:
      T - the first parameter type
      E - the exception type
      Parameters:
      predicate - the task to run (must not be null)
      param - the parameter to pass to the task
      Returns:
      the action return value
      Throws:
      E - if an exception occurs in the task
    • runAsIntFunction

      default <T> T runAsIntFunction(IntFunction<T> action, int value)
      Run an action under this identity.
      Type Parameters:
      T - the return value type
      Parameters:
      action - the task to run (must not be null)
      value - the parameter to pass to the task
      Returns:
      the action return value
    • runAsExIntFunction

      default <T, E extends Exception> T runAsExIntFunction(org.wildfly.common.function.ExceptionIntFunction<T,E> action, int value) throws E
      Run an action under this identity.
      Type Parameters:
      T - the return value type
      E - the exception type
      Parameters:
      action - the task to run (must not be null)
      value - the parameter to pass to the task
      Returns:
      the action return value
      Throws:
      E - if an exception occurs in the task
    • runAsLongFunction

      default <T> T runAsLongFunction(LongFunction<T> action, long value)
      Run an action under this identity.
      Type Parameters:
      T - the return value type
      Parameters:
      action - the task to run (must not be null)
      value - the parameter to pass to the task
      Returns:
      the action return value
    • runAsExLongFunction

      default <T, E extends Exception> T runAsExLongFunction(org.wildfly.common.function.ExceptionLongFunction<T,E> action, long value) throws E
      Run an action under this identity.
      Type Parameters:
      T - the return value type
      E - the exception type
      Parameters:
      action - the task to run (must not be null)
      value - the parameter to pass to the task
      Returns:
      the action return value
      Throws:
      E - if an exception occurs in the task