Class OpsViewManager.CloseableClientResponse
java.lang.Object
ecmwf.common.opsview.OpsViewManager.CloseableClientResponse
- All Implemented Interfaces:
Closeable, AutoCloseable
- Enclosing class:
OpsViewManager
A wrapper around
HttpResponse that implements Closeable.-
Constructor Summary
ConstructorsConstructorDescriptionCloseableClientResponse(HttpResponse<String> response) Constructs a new CloseableClientResponse wrapping the given response. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the response.<T> TReads and returns the entity from the response.Returns the HTTP status message of the response.intReturns the HTTP status code of the response.
-
Constructor Details
-
CloseableClientResponse
Constructs a new CloseableClientResponse wrapping the given response.- Parameters:
response- the response to wrap; must not be null
-
-
Method Details
-
getStatusCode
public int getStatusCode()Returns the HTTP status code of the response.- Returns:
- the HTTP status code
-
getMessage
Returns the HTTP status message of the response.- Returns:
- the status message
-
getEntity
Reads and returns the entity from the response.- Type Parameters:
T- the type of the entity- Parameters:
t- the class of the entity- Returns:
- the entity deserialized as the given class
- Throws:
IOException- Signals that an I/O exception has occurred.
-
close
public void close()Closes the response.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-