Class ServerResponse<T extends ScimObjectNode>

java.lang.Object
de.captaingoldfish.scim.sdk.client.response.ServerResponse<T>
Direct Known Subclasses:
ListBuilder.ListServerResponse

public class ServerResponse<T extends ScimObjectNode> extends Object
represents a response from the server

create at: 01.05.2020
Author:
Pascal Knüppel
  • Constructor Details

  • Method Details

    • getResource

      public T 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

      public <R extends ScimObjectNode> R getResource(Class<R> responseType)
      tries to resolve the returned resource as scim object
      Parameters:
      responseType - the type of the node which might be of type User, Group, BulkResponse or any other type that extends ScimObjectNode
      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

      public ErrorResponse getErrorResponse()
      will be instantiated if the response contains a scim json structure with a schemas-element that contains the value SchemaUris.ERROR_URI
    • getHttpHeaders

      public Map<String,String> getHttpHeaders()
      the headers of the response
    • getResponseBody

      public String 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

      protected Class<T> getType()
      the expected response type
    • getRequiredResponseHeaders

      protected Map<String,String> getRequiredResponseHeaders()
      these headers are expected within the response in order to make sure that the content-type of a response matches a scim response