Package com.cumulocity.sdk.client
Class ResponseParser
- java.lang.Object
-
- com.cumulocity.sdk.client.ResponseParser
-
public class ResponseParser extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
NO_ERROR_REPRESENTATION
-
Constructor Summary
Constructors Constructor Description ResponseParser()
ResponseParser(ResponseMapper mapper)
ResponseParser(ResponseMapper mapper, PlatformParameters platformParameters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkStatus(javax.ws.rs.core.Response response, int... expectedStatusCodes)
protected String
getErrorMessage(javax.ws.rs.core.Response response, int status)
protected String
getErrorRepresentation(javax.ws.rs.core.Response response)
protected boolean
isJsonResponse(javax.ws.rs.core.Response response)
<T extends ResourceRepresentation>
Tparse(javax.ws.rs.core.Response response, Class<T> type, int... expectedStatusCodes)
GId
parseIdFromLocation(javax.ws.rs.core.Response response)
<T> T
parseObject(javax.ws.rs.core.Response response, int expectedStatusCode, Class<T> type)
Object
write(Object object)
-
-
-
Field Detail
-
NO_ERROR_REPRESENTATION
public static final String NO_ERROR_REPRESENTATION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ResponseParser
public ResponseParser(ResponseMapper mapper, PlatformParameters platformParameters)
-
ResponseParser
public ResponseParser(ResponseMapper mapper)
-
ResponseParser
public ResponseParser()
-
-
Method Detail
-
parse
public <T extends ResourceRepresentation> T parse(javax.ws.rs.core.Response response, Class<T> type, int... expectedStatusCodes) throws SDKException
- Throws:
SDKException
-
parseObject
public <T> T parseObject(javax.ws.rs.core.Response response, int expectedStatusCode, Class<T> type) throws SDKException
- Throws:
SDKException
-
checkStatus
public void checkStatus(javax.ws.rs.core.Response response, int... expectedStatusCodes) throws SDKException
- Throws:
SDKException
-
getErrorMessage
protected String getErrorMessage(javax.ws.rs.core.Response response, int status)
-
getErrorRepresentation
protected String getErrorRepresentation(javax.ws.rs.core.Response response)
-
isJsonResponse
protected boolean isJsonResponse(javax.ws.rs.core.Response response)
-
parseIdFromLocation
public GId parseIdFromLocation(javax.ws.rs.core.Response response)
-
-