Class FederationAPIError
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.ErrorObject
-
- com.nimbusds.openid.connect.sdk.federation.api.FederationAPIError
-
- All Implemented Interfaces:
Serializable
@Immutable public class FederationAPIError extends ErrorObject
Federation API error.- OpenID Connect Federation 1.0, section 6.4.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FederationAPIError(OperationType operationType, String code, String description)
Creates a new federation API error.FederationAPIError(OperationType operationType, String code, String description, int httpStatusCode)
Creates a new federation API error.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description OperationType
getOperationType()
Returns the operation type.static FederationAPIError
parse(HTTPResponse httpResponse)
Parses a federation API error object from the specified HTTP response.static FederationAPIError
parse(net.minidev.json.JSONObject jsonObject)
Parses a federation API error object from the specified JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns a JSON object representation of this error object.FederationAPIError
withStatusCode(int httpStatusCode)
Returns a copy of this federation API error with the specified HTTP status code.-
Methods inherited from class com.nimbusds.oauth2.sdk.ErrorObject
appendDescription, equals, getCode, getDescription, getHTTPStatusCode, getURI, hashCode, isLegal, isLegal, parse, setDescription, setHTTPStatusCode, setURI, toHTTPResponse, toParameters, toString
-
-
-
-
Constructor Detail
-
FederationAPIError
public FederationAPIError(OperationType operationType, String code, String description)
Creates a new federation API error.- Parameters:
operationType
- The operation type,null
if not specified.code
- The error code,null
if not specified.description
- The error description,null
if not specified.
-
FederationAPIError
public FederationAPIError(OperationType operationType, String code, String description, int httpStatusCode)
Creates a new federation API error.- Parameters:
operationType
- The operation type,null
if not specified.code
- The error code,null
if not specified.description
- The error description,null
if not specified.httpStatusCode
- The HTTP status code, zero if not specified.
-
-
Method Detail
-
getOperationType
public OperationType getOperationType()
Returns the operation type.- Returns:
- The operation type,
null
if not specified.
-
withStatusCode
public FederationAPIError withStatusCode(int httpStatusCode)
Returns a copy of this federation API error with the specified HTTP status code.- Parameters:
httpStatusCode
- The HTTP status code, zero if not specified.- Returns:
- The new federation API error.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Description copied from class:ErrorObject
Returns a JSON object representation of this error object.Example:
{ "error" : "invalid_grant", "error_description" : "Invalid resource owner credentials" }
- Overrides:
toJSONObject
in classErrorObject
- Returns:
- The JSON object.
-
parse
public static FederationAPIError parse(net.minidev.json.JSONObject jsonObject)
Parses a federation API error object from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The federation API error object.
-
parse
public static FederationAPIError parse(HTTPResponse httpResponse)
Parses a federation API error object from the specified HTTP response.- Parameters:
httpResponse
- The HTTP response to parse. Must not benull
.- Returns:
- The federation API error object.
-
-