Class ServerResponse<T extends ScimObjectNode>
java.lang.Object
de.captaingoldfish.scim.sdk.client.response.ServerResponse<T>
- Direct Known Subclasses:
ListBuilder.ListServerResponse
represents a response from the server
create at: 01.05.2020
create at: 01.05.2020
- Author:
- Pascal Knüppel
-
Constructor Summary
ConstructorsConstructorDescriptionServerResponse(HttpResponse httpResponse, boolean expectedResponseCode, Class<T> type, Function<HttpResponse, Boolean> isResponseParseable, Map<String, String> requiredResponseHeaders) -
Method Summary
Modifier and TypeMethodDescriptionwill be instantiated if the response contains a scim json structure with a schemas-element that contains the valueSchemaUris.ERROR_URIthe headers of the responseintthe status code of the responsethese headers are expected within the response in order to make sure that the content-type of a response matches a scim responsetries to resolve the returned resource as scim object<R extends ScimObjectNode>
RgetResource(Class<R> responseType) tries to resolve the returned resource as scim objectthe body of the responsegetType()the expected response typebooleanif the response was succesfulbooleanif this response is a valid scim response
-
Constructor Details
-
ServerResponse
public ServerResponse(HttpResponse httpResponse, boolean expectedResponseCode, Class<T> type, Function<HttpResponse, Boolean> isResponseParseable, Map<String, String> requiredResponseHeaders)
-
-
Method Details
-
getResource
tries to resolve the returned resource as scim object- Returns:
- the parsed resource that should be returned
- Throws:
IOException- if the response body is not a valid json document
-
getResource
tries to resolve the returned resource as scim object- Parameters:
responseType- the type of the node which might be of typeUser,Group,BulkResponseor any other type that extendsScimObjectNode- Returns:
- the parsed resource that should be returned
- Throws:
IOException- if the response body is not a valid json document
-
isValidScimResponse
public boolean isValidScimResponse()if this response is a valid scim response -
getErrorResponse
will be instantiated if the response contains a scim json structure with a schemas-element that contains the valueSchemaUris.ERROR_URI -
getHttpHeaders
the headers of the response -
getResponseBody
the body of the response -
getHttpStatus
public int getHttpStatus()the status code of the response -
isSuccess
public boolean isSuccess()if the response was succesful -
getType
the expected response type -
getRequiredResponseHeaders
these headers are expected within the response in order to make sure that the content-type of a response matches a scim response
-