Class CacheableResponse
- java.lang.Object
-
- com.synopsys.integration.blackduck.http.client.cache.CacheableResponse
-
- All Implemented Interfaces:
com.synopsys.integration.rest.response.Response,java.io.Closeable,java.lang.AutoCloseable
public class CacheableResponse extends java.lang.Object implements com.synopsys.integration.rest.response.Response
-
-
Constructor Summary
Constructors Constructor Description CacheableResponse(com.synopsys.integration.rest.request.Request request, com.synopsys.integration.rest.response.Response response, org.apache.commons.collections4.map.LRUMap<com.synopsys.integration.rest.request.Request,com.synopsys.integration.rest.response.Response> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.apache.http.client.methods.CloseableHttpResponsegetActualResponse()java.io.InputStreamgetContent()java.lang.StringgetContentEncoding()java.lang.LonggetContentLength()java.lang.StringgetContentString()java.lang.StringgetContentString(java.nio.charset.Charset encoding)java.lang.StringgetContentType()java.util.Map<java.lang.String,java.lang.String>getHeaders()java.lang.StringgetHeaderValue(java.lang.String name)longgetLastModified()org.apache.http.client.methods.HttpUriRequestgetRequest()intgetStatusCode()java.lang.StringgetStatusMessage()booleanisStatusCodeError()booleanisStatusCodeSuccess()voidthrowExceptionForError()
-
-
-
Constructor Detail
-
CacheableResponse
public CacheableResponse(com.synopsys.integration.rest.request.Request request, com.synopsys.integration.rest.response.Response response, org.apache.commons.collections4.map.LRUMap<com.synopsys.integration.rest.request.Request,com.synopsys.integration.rest.response.Response> cache)
-
-
Method Detail
-
getRequest
public org.apache.http.client.methods.HttpUriRequest getRequest()
- Specified by:
getRequestin interfacecom.synopsys.integration.rest.response.Response
-
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCodein interfacecom.synopsys.integration.rest.response.Response
-
isStatusCodeSuccess
public boolean isStatusCodeSuccess()
- Specified by:
isStatusCodeSuccessin interfacecom.synopsys.integration.rest.response.Response
-
isStatusCodeError
public boolean isStatusCodeError()
- Specified by:
isStatusCodeErrorin interfacecom.synopsys.integration.rest.response.Response
-
getStatusMessage
public java.lang.String getStatusMessage()
- Specified by:
getStatusMessagein interfacecom.synopsys.integration.rest.response.Response
-
getContent
public java.io.InputStream getContent() throws com.synopsys.integration.exception.IntegrationException- Specified by:
getContentin interfacecom.synopsys.integration.rest.response.Response- Throws:
com.synopsys.integration.exception.IntegrationException
-
getContentString
public java.lang.String getContentString() throws com.synopsys.integration.exception.IntegrationException- Specified by:
getContentStringin interfacecom.synopsys.integration.rest.response.Response- Throws:
com.synopsys.integration.exception.IntegrationException
-
getContentString
public java.lang.String getContentString(java.nio.charset.Charset encoding) throws com.synopsys.integration.exception.IntegrationException- Specified by:
getContentStringin interfacecom.synopsys.integration.rest.response.Response- Throws:
com.synopsys.integration.exception.IntegrationException
-
getContentLength
public java.lang.Long getContentLength()
- Specified by:
getContentLengthin interfacecom.synopsys.integration.rest.response.Response
-
getContentEncoding
public java.lang.String getContentEncoding()
- Specified by:
getContentEncodingin interfacecom.synopsys.integration.rest.response.Response
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentTypein interfacecom.synopsys.integration.rest.response.Response
-
getHeaders
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
- Specified by:
getHeadersin interfacecom.synopsys.integration.rest.response.Response
-
getHeaderValue
public java.lang.String getHeaderValue(java.lang.String name)
- Specified by:
getHeaderValuein interfacecom.synopsys.integration.rest.response.Response
-
getActualResponse
public org.apache.http.client.methods.CloseableHttpResponse getActualResponse()
- Specified by:
getActualResponsein interfacecom.synopsys.integration.rest.response.Response
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacecom.synopsys.integration.rest.response.Response- Throws:
java.io.IOException
-
getLastModified
public long getLastModified() throws com.synopsys.integration.exception.IntegrationException- Specified by:
getLastModifiedin interfacecom.synopsys.integration.rest.response.Response- Throws:
com.synopsys.integration.exception.IntegrationException
-
throwExceptionForError
public void throwExceptionForError() throws com.synopsys.integration.rest.exception.IntegrationRestException- Specified by:
throwExceptionForErrorin interfacecom.synopsys.integration.rest.response.Response- Throws:
com.synopsys.integration.rest.exception.IntegrationRestException
-
-