|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
javax.ws.rs.WebApplicationException
javax.ws.rs.ClientErrorException
javax.ws.rs.NotAuthorizedException
public class NotAuthorizedException
A runtime exception indicating request authorization failure caused by one of the following scenarios:
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 Summary | |
---|---|
NotAuthorizedException(Object challenge,
Object... moreChallenges)
Construct a new "not authorized" exception. |
|
NotAuthorizedException(Response response)
Construct a new "not authorized" exception. |
|
NotAuthorizedException(Response response,
Throwable cause)
Construct a new "not authorized" exception. |
|
NotAuthorizedException(Throwable cause,
Object challenge,
Object... moreChallenges)
Construct a new "not authorized" exception. |
Method Summary | |
---|---|
List<Object> |
getChallenges()
Get the list of authorization challenges associated with the exception and applicable to the resource requested by the client. |
Methods inherited from class javax.ws.rs.WebApplicationException |
---|
getResponse |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NotAuthorizedException(Object challenge, Object... moreChallenges)
challenge
- authorization challenge applicable to the resource requested
by the client.moreChallenges
- additional authorization challenge applicable to the
requested resource.
NullPointerException
- in case the challenge
parameter is null
.public NotAuthorizedException(Response response)
response
- error response.
IllegalArgumentException
- in case the status code set in the response
is not HTTP 401
.public NotAuthorizedException(Throwable cause, Object challenge, 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(Response response, Throwable cause)
response
- error response.cause
- the underlying cause of the exception.
IllegalArgumentException
- in case the status code set in the response
is not HTTP 401
.Method Detail |
---|
public List<Object> getChallenges()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |