public class OHttpResponseWrapper extends Object
Constructor and Description |
---|
OHttpResponseWrapper(OHttpResponse iResponse) |
Modifier and Type | Method and Description |
---|---|
OHttpResponseWrapper |
flush()
Flushes the content to the TCP/IP socket.
|
String[] |
getAdditionalResponseHeaders() |
String |
getCharacterSet()
Returns the response's character set used.
|
int |
getCode() |
String |
getContent() |
String |
getContentType() |
String |
getHeader()
Returns the response's additional headers.
|
String |
getHttpVersion() |
OutputStream |
getOutputStream() |
OHttpResponse |
getResponse() |
OHttpResponseWrapper |
send(int iCode,
String iReason,
String iContentType,
Object iContent)
Sends the complete HTTP response in one call.
|
OHttpResponseWrapper |
send(int iCode,
String iReason,
String iContentType,
Object iContent,
String iHeaders)
Sends the complete HTTP response in one call specifying additional headers.
|
OHttpResponseWrapper |
sendStream(int iCode,
String iReason,
String iContentType,
InputStream iContent,
long iSize)
Sends the complete HTTP response in one call specifying a stream as content.
|
OHttpResponseWrapper |
sendStream(int iCode,
String iReason,
String iContentType,
InputStream iContent,
long iSize,
String iFileName)
Sends the complete HTTP response in one call specifying a stream as content.
|
OHttpResponseWrapper |
setCharacterSet(String iCharacterSet)
Sets the response's character set.
|
void |
setCode(int code) |
void |
setContent(String content) |
void |
setContentType(String contentType) |
OHttpResponseWrapper |
setHeader(String iHeader)
Sets the response's additional headers to send back.
|
OHttpResponseWrapper |
writeContent(String iContent)
Writes content directly to the response.
|
OHttpResponseWrapper |
writeHeaders(String iContentType)
Sets the response's headers using the keep-alive.
|
OHttpResponseWrapper |
writeHeaders(String iContentType,
boolean iKeepAlive)
Sets the response's headers specifying when using the keep-alive or not.
|
OHttpResponseWrapper |
writeLine(String iContent)
Writes a line in the response.
|
OHttpResponseWrapper |
writeRecord(ORecord iRecord)
Writes a record as response.
|
OHttpResponseWrapper |
writeRecord(ORecord iRecord,
String iFetchPlan)
Writes a record as response.
|
OHttpResponseWrapper |
writeRecords(List<OIdentifiable> iRecords)
Writes records as response.
|
OHttpResponseWrapper |
writeRecords(Object iRecords,
String iFetchPlan)
Writes records as response specifying a fetch-plan to serialize nested records.
|
OHttpResponseWrapper |
writeStatus(int iHttpCode,
String iReason)
Sets the response's status as HTTP code and reason.
|
public OHttpResponseWrapper(OHttpResponse iResponse)
iResponse
- public OHttpResponse getResponse()
public String getHeader()
public OHttpResponseWrapper setHeader(String iHeader)
iHeader
- String containing the headerpublic String getCharacterSet()
public OHttpResponseWrapper setCharacterSet(String iCharacterSet)
iCharacterSet
- String containing the charset to usepublic String getHttpVersion()
public String[] getAdditionalResponseHeaders()
public OutputStream getOutputStream()
public OHttpResponseWrapper writeStatus(int iHttpCode, String iReason) throws IOException
iHttpCode
- Response's HTTP codeiReason
- Response's reasonIOException
public OHttpResponseWrapper writeHeaders(String iContentType) throws IOException
iContentType
- Response's content typeIOException
public OHttpResponseWrapper writeHeaders(String iContentType, boolean iKeepAlive) throws IOException
iContentType
- Response's content typeiKeepAlive
- Use the keep-alive of the connectionIOException
public OHttpResponseWrapper writeLine(String iContent) throws IOException
iContent
- Content to send as stringIOException
public OHttpResponseWrapper writeContent(String iContent) throws IOException
iContent
- Content to send as stringIOException
public OHttpResponseWrapper writeRecords(List<OIdentifiable> iRecords) throws IOException
iRecords
- List of records to serializeIOException
public OHttpResponseWrapper writeRecords(Object iRecords, String iFetchPlan) throws IOException
iRecords
- List of records to serializeiFetchPlan
- Fetch plan to specify nested recordsIOException
public OHttpResponseWrapper writeRecord(ORecord iRecord) throws IOException
iRecord
- Record to serializeIOException
public OHttpResponseWrapper writeRecord(ORecord iRecord, String iFetchPlan) throws IOException
iRecord
- Record to serializeiFetchPlan
- Fetch plan to specify nested recordsIOException
public OHttpResponseWrapper send(int iCode, String iReason, String iContentType, Object iContent) throws IOException
iCode
- HTTP response's CodeiReason
- Response's reasoniContentType
- Response's content typeiContent
- Content to send. Content can be a string for plain text, binary data to return
directly binary information, OIdentifiable for a single record and
CollectionIOException
public OHttpResponseWrapper send(int iCode, String iReason, String iContentType, Object iContent, String iHeaders) throws IOException
iCode
- HTTP response's CodeiReason
- Response's reasoniContentType
- Response's content typeiContent
- Content to send. Content can be a string for plain text, binary data to return
directly binary information, OIdentifiable for a single record and
CollectioniHeaders
- Response's additional headersIOException
public OHttpResponseWrapper sendStream(int iCode, String iReason, String iContentType, InputStream iContent, long iSize) throws IOException
iCode
- HTTP response's CodeiReason
- Response's reasoniContentType
- Response's content typeiContent
- java.io.InputStream objectiSize
- Content size in bytesIOException
public OHttpResponseWrapper sendStream(int iCode, String iReason, String iContentType, InputStream iContent, long iSize, String iFileName) throws IOException
iCode
- HTTP response's CodeiReason
- Response's reasoniContentType
- Response's content typeiContent
- java.io.InputStream objectiSize
- Content size in bytesiFileName
- Optional file nameIOException
public OHttpResponseWrapper flush() throws IOException
IOException
public String getContentType()
public void setContentType(String contentType)
public String getContent()
public void setContent(String content)
public int getCode()
public void setCode(int code)
Copyright © 2009–2020 OrientDB. All rights reserved.