Class RequestAwareCurrentSessionInfoFactory.RequestAwareCurrentSessionInfo

java.lang.Object
io.datarouter.auth.session.RequestAwareCurrentSessionInfoFactory.RequestAwareCurrentSessionInfo
Enclosing class:
RequestAwareCurrentSessionInfoFactory

public static class RequestAwareCurrentSessionInfoFactory.RequestAwareCurrentSessionInfo extends Object
This is a wrapper of CurrentSessionInfo that does not require passing the request to every method.
  • Constructor Details

    • RequestAwareCurrentSessionInfo

      public RequestAwareCurrentSessionInfo(CurrentSessionInfo currentSessionInfo, javax.servlet.ServletRequest request)
  • Method Details

    • findNonEmptyUsername

      public Optional<String> findNonEmptyUsername()
    • getNonEmptyUsernameOrElse

      public String getNonEmptyUsernameOrElse(String other)
    • getSession

      public Optional<? extends Session> getSession()
    • getRequiredSession

      public Session getRequiredSession()
    • getRoles

      public Set<Role> getRoles()
    • hasRole

      public boolean hasRole(Role role)
    • hasRole

      public boolean hasRole(RoleEnum<?> role)
    • hasAnyRole

      public boolean hasAnyRole(Collection<Role> targetRoles)
    • hasAnyRoleEnum

      public boolean hasAnyRoleEnum(Collection<RoleEnum<?>> targetRoles)