java.lang.Object
org.elasticsearch.xpack.core.security.authz.store.RoleRetrievalResult

public final class RoleRetrievalResult extends Object
The result of attempting to retrieve roles from a roles provider. The result can either be successful or a failure. A successful result indicates that no errors occurred while retrieving roles, even if none of the requested roles could be found. A failure indicates an error occurred while retrieving the results but the error is not fatal and the request may be able to continue.
  • Method Details

    • getDescriptors

      public Set<RoleDescriptor> getDescriptors()
      Returns:
      the resolved descriptors or null if there was a failure
    • getFailure

      @Nullable public Exception getFailure()
      Returns:
      the failure or null if retrieval succeeded
    • isSuccess

      public boolean isSuccess()
      Returns:
      true if the retrieval succeeded
    • success

      public static RoleRetrievalResult success(Set<RoleDescriptor> descriptors)
      Creates a successful result with the provided RoleDescriptor set, which must be non-null
    • failure

      public static RoleRetrievalResult failure(Exception e)
      Creates a failed result with the provided non-null exception