Class UserContext.Factory

java.lang.Object
org.graylog.security.UserContext.Factory
Enclosing class:
UserContext

public static class UserContext.Factory extends Object
  • Constructor Details

    • Factory

      @Inject public Factory(UserService userService)
  • Method Details

    • create

      public UserContext create() throws UserContextMissingException
      Create a UserContext from the currently accessible Shiro Subject available to the calling code depending on runtime environment. This should only be called from within an existing Shiro context. If a UserContext is needed from an environment where there is no existing context, the code can be run using: UserContext.runAs(String username, Callable)
      Returns:
      a user context reflecting the currently executing user.
      Throws:
      UserContextMissingException
    • create

      public UserContext create(org.apache.shiro.subject.Subject subject)