
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 reasonIOExceptionpublic OHttpResponseWrapper writeHeaders(String iContentType) throws IOException
iContentType - Response's content typeIOExceptionpublic OHttpResponseWrapper writeHeaders(String iContentType, boolean iKeepAlive) throws IOException
iContentType - Response's content typeiKeepAlive - Use the keep-alive of the connectionIOExceptionpublic OHttpResponseWrapper writeLine(String iContent) throws IOException
iContent - Content to send as stringIOExceptionpublic OHttpResponseWrapper writeContent(String iContent) throws IOException
iContent - Content to send as stringIOExceptionpublic OHttpResponseWrapper writeRecords(List<OIdentifiable> iRecords) throws IOException
iRecords - List of records to serializeIOExceptionpublic OHttpResponseWrapper writeRecords(Object iRecords, String iFetchPlan) throws IOException
iRecords - List of records to serializeiFetchPlan - Fetch plan to specify nested recordsIOExceptionpublic OHttpResponseWrapper writeRecord(ORecord iRecord) throws IOException
iRecord - Record to serializeIOExceptionpublic OHttpResponseWrapper writeRecord(ORecord iRecord, String iFetchPlan) throws IOException
iRecord - Record to serializeiFetchPlan - Fetch plan to specify nested recordsIOExceptionpublic 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
CollectionIOExceptionpublic 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 headersIOExceptionpublic 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 bytesIOExceptionpublic 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 nameIOExceptionpublic OHttpResponseWrapper flush() throws IOException
IOExceptionpublic 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–2025 OrientDB. All rights reserved.