10Duke Scale SDK for Java
|
Base class for providing an easy to read and handle exception creation.
Utilizes the following exceptions with the correct error codes during creation
Static Public Member Functions | |
static ApiException | createApiException (final int statusCode, final String message) |
Builder for API exceptions that are missing error code. | |
static ApiException | createApiException (final int statusCode, final String errorCode, final String message, final Throwable cause) |
Create a new API exception with detail given by arguments. | |
static ApiException | createApiException (final int statusCode, final String errorCode, final String message, final Throwable cause, final ErrorResponseBody responseBody) |
Create a new API exception with detail given by arguments.Outcome is the same as calling the equivalent constructor for ApiException. | |
static SdkException | internalError (final String message) |
Creates a new SdkException with errorCode set to SDK_INTERNAL_ERROR_CODE. | |
static SdkException | internalError (final String message, final Throwable cause) |
Creates a new SdkException with errorCode set to SDK_INTERNAL_ERROR_CODE. | |
static SdkException | internalTimeoutError (final String message) |
Creates a new SdkException with errorCode set to SDK_TIMEOUT_ERROR_CODE. | |
static SdkException | internalTimeoutError (final String message, final Throwable cause) |
Creates a new SdkException with errorCode set to SDK_TIMEOUT_ERROR_CODE. | |
static ApiException | badRequest (final Throwable cause) |
Tells the client that the request is not valid. | |
static ApiException | badRequest (final String message) |
Tells the client that the request is not valid. | |
static ApiException | badRequest (final String message, final Throwable cause) |
Tells the client that the request is not valid generally. | |
static ApiException | forbidden (final String message) |
Tells the client that the server refuses to authorize the request. | |
static ApiException | conflict (final Throwable cause) |
Tells the client that the service state does not allow the requested data access. | |
static ApiException | conflict (final String message) |
Tells the client that the service state does not allow the requested data access. | |
static ApiException | conflict (final String message, final Throwable cause) |
Tells the client that the service state does not allow the requested data access. | |
static ApiException | internalServerError (final String message) |
Tells the client that the server encountered an unexpected issue while fulfilling the request. | |
static ApiException | internalServerError (final String message, final Throwable cause) |
Tells the client that the server encountered an unexpected issue while fulfilling the request. | |
static ApiException | notFound (final String message) |
Tells the client that the requested resource does not exist. | |
static ApiException | tooManyRequests () |
Tells the client that it has made too many requests and the request rate should be reduced. | |
static ApiException | tooManyRequests (final String message) |
Tells the client that it has made too many requests and the request rate should be reduced. | |
static ApiException | unauthorized () |
Tell client to authenticate. | |
static TokenException | invalidJwtToken () |
Tells that JWT token is invalid. | |
static TokenException | invalidJwtToken (final String message, final Throwable cause) |
Tells that JWT token is invalid. | |
static TokenException | invalidJwtHeader () |
Tells that JWT token contains an invalid header. | |
static TokenException | invalidJwtHeader (final String message, final Throwable cause) |
Tells that JWT token contains an invalid header. | |
static TokenException | invalidJwtPayload () |
Tells that JWT token contains an invalid payload. | |
static TokenException | invalidJwtSignature () |
Tells that JWT token contains an invalid signature. | |
static TokenException | notActiveJwtToken () |
Tells that JWT token is not active. | |
static TokenException | invalidJwtAlgorithm () |
Tells that JWT token algorithm is not valid. | |
static TokenException | invalidJwtAudience () |
Tells that JWT token audience is not valid. | |
static TokenException | invalidJwtIssuer () |
Tells that JWT token issuer is not valid. | |
static TokenException | invalidJwtIssuedAt () |
Tells that JWT token issued at is not valid. | |
static TokenException | invalidJwtId () |
Tells that JWT token JWT id is not valid. | |
static TokenException | missingRequiredJwtClaim () |
Tells that JWT token is missing a required claim. | |
static TokenException | missingRequiredJwtClaim (final String message, final Throwable cause) |
Tells that JWT token is missing a required claim. | |
static TokenException | missingJwtSigningKey () |
Tells that JWT signing key is null or empty. | |
static TokenException | missingJwtSigningKey (final String message, final Throwable cause) |
Tells that JWT signing key is null or empty. | |
static TokenException | missingJwtVerificationKey () |
Tells that JWT verification key is null or empty. | |
static TokenException | missingJwtVerificationKey (final String message, final Throwable cause) |
Tells that JWT verification key is null or empty. | |
static ConfigException | missingConfig (final String message) |
Tells that configuration is missing. | |
static ConfigException | invalidConfig (final String message) |
Tells that configuration is invalid. | |
Static Public Attributes | |
static final int | DEFAULT_API_STATUS |
static final String | DEFAULT_API_ERROR_CODE |
static final String | SDK_INTERNAL_ERROR_CODE = "internal_error" |
static final String | SDK_TIMEOUT_ERROR_CODE = "timeout_error" |
|
static |
Tells the client that the request is not valid.
The request must not be repeated as such as it will reproduce the same outcome.
message | detailed message of the error. |
ApiException
.
|
static |
Tells the client that the request is not valid generally.
message | detailed message of the error. |
cause | nested cause. |
ApiException
.
|
static |
Tells the client that the request is not valid.
The request must not be repeated as such as it will reproduce the same outcome.
cause | nested cause. |
ApiException
.
|
static |
Tells the client that the service state does not allow the requested data access.
This can be for example due to an unique key constraint failure.
message | detailed message of the error. |
ApiException
.
|
static |
Tells the client that the service state does not allow the requested data access.
This can be for example due to an unique key constraint failure.
message | detailed message of the error. |
cause | nested cause. |
ApiException
.
|
static |
Tells the client that the service state does not allow the requested data access.
This can be for example due to an unique key constraint failure.
cause | nested cause. |
ApiException
.
|
static |
Create a new API exception with detail given by arguments.
Outcome is the same as calling the equivalent constructor for ApiException.
statusCode | status code from HTTP response. |
errorCode | brief message of the error. |
message | detailed message of the error. |
cause | nested cause. |
ApiException
.
|
static |
Create a new API exception with detail given by arguments.Outcome is the same as calling the equivalent constructor for ApiException.
statusCode | status code from HTTP response. |
errorCode | brief message of the error. |
message | detailed message of the error. |
cause | nested cause. |
responseBody | body of the error response. |
ApiException
.
|
static |
Builder for API exceptions that are missing error code.
Maps the statusCode to a HttpResponseStatus.Status reason phrase or sets the error code to HttpResponseStatus.Status.INTERNAL_SERVER_ERROR.getReasonPhrase()
if the mapping fails.
statusCode | status code from HTTP response. |
message | detailed message of the error. |
ApiException
.
|
static |
Tells the client that the server refuses to authorize the request.
message | detailed message of the error. |
ApiException
.
|
static |
Creates a new SdkException with errorCode set to SDK_INTERNAL_ERROR_CODE.
Passes the value of the message argument to the JDK exception base class.
message | detailed message of the error. |
tenduke.sdk.core.exception.TokenException
.
|
static |
Creates a new SdkException with errorCode set to SDK_INTERNAL_ERROR_CODE.
Passes the values of the message argument and throwable cause to the JDK exception base class.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
.
|
static |
Tells the client that the server encountered an unexpected issue while fulfilling the request.
message | detailed message of the error. |
ApiException
.
|
static |
Tells the client that the server encountered an unexpected issue while fulfilling the request.
message | detailed message of the error. |
cause | nested cause. |
ApiException
.
|
static |
Creates a new SdkException with errorCode set to SDK_TIMEOUT_ERROR_CODE.
Passes the value of the message argument to the JDK exception base class.
message | detailed message of the error. |
tenduke.sdk.core.exception.TokenException
.
|
static |
Creates a new SdkException with errorCode set to SDK_TIMEOUT_ERROR_CODE.
Passes the values of the message argument and throwable cause to the JDK exception base class.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
.
|
static |
Tells that configuration is invalid.
message | detailed message of the error. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token algorithm is not valid.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token audience is not valid.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token contains an invalid header.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token contains an invalid header.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token JWT id is not valid.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token issued at is not valid.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token issuer is not valid.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token contains an invalid payload.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token contains an invalid signature.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token is invalid.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token is invalid.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that configuration is missing.
message | detailed message of the error. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT signing key is null or empty.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT signing key is null or empty.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT verification key is null or empty.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT verification key is null or empty.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token is missing a required claim.
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token is missing a required claim.
message | detailed message of the error. |
cause | nested cause. |
tenduke.sdk.core.exception.TokenException
|
static |
Tells that JWT token is not active.
tenduke.sdk.core.exception.TokenException
|
static |
Tells the client that the requested resource does not exist.
message | detailed message of the error. |
ApiException
.
|
static |
Tells the client that it has made too many requests and the request rate should be reduced.
ApiException
.
|
static |
Tells the client that it has made too many requests and the request rate should be reduced.
message | detailed message of the error. |
ApiException
.
|
static |
Tell client to authenticate.
Must also include WWW-Authenticate header that describes how to authenticate.
ApiException
.
|
static |
|
static |
|
static |
|
static |