public class NotAuthorizedException extends ClientErrorException
Authorization
HTTP header is missing in the request,Authorization
header - then the exception indicates
that authorization has been refused for the credentials contained in the request header.Constructor and Description |
---|
NotAuthorizedException(java.lang.Object challenge,
java.lang.Object... moreChallenges)
Construct a new "not authorized" exception.
|
NotAuthorizedException(Response response)
Construct a new "not authorized" exception.
|
NotAuthorizedException(Response response,
java.lang.Throwable cause)
Construct a new "not authorized" exception.
|
NotAuthorizedException(java.lang.String message,
java.lang.Object challenge,
java.lang.Object... moreChallenges)
Construct a new "not authorized" exception.
|
NotAuthorizedException(java.lang.String message,
Response response)
Construct a new "not authorized" exception.
|
NotAuthorizedException(java.lang.String message,
Response response,
java.lang.Throwable cause)
Construct a new "not authorized" exception.
|
NotAuthorizedException(java.lang.String message,
java.lang.Throwable cause,
java.lang.Object challenge,
java.lang.Object... moreChallenges)
Construct a new "not authorized" exception.
|
NotAuthorizedException(java.lang.Throwable cause,
java.lang.Object challenge,
java.lang.Object... moreChallenges)
Construct a new "not authorized" exception.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Object> |
getChallenges()
Get the list of authorization challenges associated with the exception and applicable to the resource requested by
the client.
|
getResponse
public NotAuthorizedException(java.lang.Object challenge, java.lang.Object... moreChallenges)
challenge
- authorization challenge applicable to the resource requested by the client.moreChallenges
- additional authorization challenge applicable to the requested resource.java.lang.NullPointerException
- in case the challenge
parameter is null
.public NotAuthorizedException(java.lang.String message, java.lang.Object challenge, java.lang.Object... moreChallenges)
message
- the detail message (which is saved for later retrieval by the Throwable.getMessage()
method).challenge
- authorization challenge applicable to the resource requested by the client.moreChallenges
- additional authorization challenge applicable to the requested resource.java.lang.NullPointerException
- in case the challenge
parameter is null
.public NotAuthorizedException(Response response)
response
- error response.java.lang.IllegalArgumentException
- in case the status code set in the response is not HTTP 401
.public NotAuthorizedException(java.lang.String message, Response response)
message
- the detail message (which is saved for later retrieval by the Throwable.getMessage()
method).response
- error response.java.lang.IllegalArgumentException
- in case the status code set in the response is not HTTP 401
.public NotAuthorizedException(java.lang.Throwable cause, java.lang.Object challenge, java.lang.Object... moreChallenges)
cause
- the underlying cause of the exception.challenge
- authorization challenge applicable to the requested resource.moreChallenges
- additional authorization challenge applicable to the requested resource.public NotAuthorizedException(java.lang.String message, java.lang.Throwable cause, java.lang.Object challenge, java.lang.Object... moreChallenges)
message
- the detail message (which is saved for later retrieval by the Throwable.getMessage()
method).cause
- the underlying cause of the exception.challenge
- authorization challenge applicable to the requested resource.moreChallenges
- additional authorization challenge applicable to the requested resource.public NotAuthorizedException(Response response, java.lang.Throwable cause)
response
- error response.cause
- the underlying cause of the exception.java.lang.IllegalArgumentException
- in case the status code set in the response is not HTTP 401
.public NotAuthorizedException(java.lang.String message, Response response, java.lang.Throwable cause)
message
- the detail message (which is saved for later retrieval by the Throwable.getMessage()
method).response
- error response.cause
- the underlying cause of the exception.java.lang.IllegalArgumentException
- in case the status code set in the response is not HTTP 401
.public java.util.List<java.lang.Object> getChallenges()