Package com.cloudera.cdp.client
Class ResourceResponse
java.lang.Object
com.cloudera.cdp.client.BaseResponse
com.cloudera.cdp.client.CdpResponse
com.cloudera.cdp.client.ResourceResponse
- All Implemented Interfaces:
AutoCloseable
-
Field Summary
Fields inherited from class com.cloudera.cdp.client.CdpResponse
ALTUS_HEADER_REQUESTID, CDP_HEADER_REQUESTID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Get the message entity Java instance.jakarta.ws.rs.core.Response.StatusTypeGet the complete status information associated with the response.booleanCheck if there is an entity available in the response.Read the message entity input stream as an instance of specified Java type.readEntity(Annotation[] annotations) Read the message entity input stream as an instance of specified Java type.Methods inherited from class com.cloudera.cdp.client.CdpResponse
getRequestIdMethods inherited from class com.cloudera.cdp.client.BaseResponse
getHttpCode, getResponseHeaders
-
Constructor Details
-
ResourceResponse
public ResourceResponse()
-
-
Method Details
-
getStatusInfo
public jakarta.ws.rs.core.Response.StatusType getStatusInfo()Get the complete status information associated with the response.- Returns:
- the response status information. The returned value is never
null.
-
getEntity
Get the message entity Java instance. Returnsnullif the message does not contain an entity body. If the entity is represented by an un-consumedinput streamthe method will return the input stream.- Returns:
- the message entity or
nullif message does not contain an entity body (i.e. whenhasEntity()returnsfalse). - See Also:
-
readEntity
Read the message entity input stream as an instance of specified Java type.- Returns:
- the message entity.
-
readEntity
Read the message entity input stream as an instance of specified Java type.- Parameters:
annotations- annotations that will be passed to theMessageBodyReader.- Returns:
- the message entity.
- See Also:
-
hasEntity
public boolean hasEntity()Check if there is an entity available in the response. The method returnstrueif the entity is present, returnsfalseotherwise.- Returns:
trueif there is an entity present in the message,falseotherwise.- See Also:
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-