Package com.microstrategy.webapi.restApi
Class IServerResponseImpl
- java.lang.Object
-
- com.microstrategy.webapi.restApi.IServerResponseImpl
-
- All Implemented Interfaces:
SimpleResponseWrapper
,java.io.Closeable
,java.lang.AutoCloseable
public class IServerResponseImpl extends java.lang.Object implements SimpleResponseWrapper
IServer specific Response handling Only predefined headers would be parsed
-
-
Constructor Summary
Constructors Constructor Description IServerResponseImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.lang.String
getBody()
Returns response body as String.java.io.InputStream
getBodyAsStream()
Returns response body as Stream.java.lang.String
getContentType()
returns content-type header valuejava.util.Map<java.lang.String,java.util.List<java.lang.String>>
getHeaders()
Returns filtered response headersint
getStatusCode()
Returns HTTP response status codevoid
setResponse(okhttp3.Response response)
populate responsejava.lang.String
toString()
-
-
-
Method Detail
-
getStatusCode
public int getStatusCode()
Returns HTTP response status code- Specified by:
getStatusCode
in interfaceSimpleResponseWrapper
- Returns:
- response status code
-
getContentType
public java.lang.String getContentType()
returns content-type header value- Specified by:
getContentType
in interfaceSimpleResponseWrapper
- Returns:
- content-type header value
-
getBody
public java.lang.String getBody() throws java.io.IOException
Returns response body as String. Not multi-thread safe.- Specified by:
getBody
in interfaceSimpleResponseWrapper
- Returns:
- response body as String
- Throws:
java.io.IOException
-
getBodyAsStream
public java.io.InputStream getBodyAsStream()
Returns response body as Stream. Not multi-thread safe.- Specified by:
getBodyAsStream
in interfaceSimpleResponseWrapper
- Returns:
- response body as Stream
-
getHeaders
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getHeaders()
Returns filtered response headers- Specified by:
getHeaders
in interfaceSimpleResponseWrapper
- Returns:
- Response headers
-
setResponse
public void setResponse(okhttp3.Response response) throws java.io.IOException
populate response- Specified by:
setResponse
in interfaceSimpleResponseWrapper
- Throws:
java.io.IOException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-