public class OutputStreamHandle extends BaseHandle<OperationNotSupported,OutputStreamSender> implements BinaryWriteHandle, GenericWriteHandle, JSONWriteHandle, TextWriteHandle, XMLWriteHandle, StructureWriteHandle, TriplesWriteHandle
An OutputStreamHandle generates output during writing.
You define a class that implements the OutputStreamSender interface. When the client is ready to write to the server, it calls the write() method of the class with an OutputStream. That is, the write() method generates the output to be written to the server. The OutputStreamSender implementer is typically an anonymous class.
Initialize the OutputStreamHandle with the OutputStreamSender implementer before passing the OutputStreamHandle to the write() method of a document manager.
UNKNOWN_LENGTH| Constructor and Description |
|---|
OutputStreamHandle()
Zero-argument constructor.
|
OutputStreamHandle(OutputStreamSender sender)
Initializes the handle with an outputstream sender providing the callback that writes content to the database via an output stream.
|
| Modifier and Type | Method and Description |
|---|---|
OutputStreamSender |
get()
Returns the output stream sender that writes the content.
|
boolean |
isResendable()
Returns whether the content can be resent to the output stream if the request must be retried.
|
void |
set(OutputStreamSender sender)
Assigns an output stream sender providing the callback that writes content to the database via an output stream.
|
void |
setResendable(boolean resendable)
Specifies whether the content can be resent to the output stream if the request must be retried.
|
OutputStreamHandle |
with(OutputStreamSender sender)
Assigns an output stream sender providing the callback that writes content to the database and returns the handle as a fluent convenience.
|
OutputStreamHandle |
withFormat(Format format)
Specifies the format of the content and returns the handle as a fluent convenience.
|
OutputStreamHandle |
withMimetype(String mimetype)
Specifies the mime type of the content and returns the handle as a fluent convenience.
|
OutputStreamHandle |
withResendable(boolean resendable)
Specifies whether the content can be resent to the output stream and returns the handle as a fluent convenience.
|
getByteLength, getFormat, getMimetype, getServerTimestamp, setByteLength, setFormat, setMimetype, setServerTimestamppublic OutputStreamHandle()
Zero-argument constructor.
public OutputStreamHandle(OutputStreamSender sender)
Initializes the handle with an outputstream sender providing the callback that writes content to the database via an output stream.
sender - the processor that sends content to the databasepublic OutputStreamHandle withFormat(Format format)
Specifies the format of the content and returns the handle as a fluent convenience.
format - the format of the contentpublic OutputStreamHandle withMimetype(String mimetype)
Specifies the mime type of the content and returns the handle as a fluent convenience.
mimetype - the mime type of the contentpublic boolean isResendable()
Returns whether the content can be resent to the output stream if the request must be retried. The default is false.
isResendable in class com.marklogic.client.impl.HandleImplementation<OperationNotSupported,OutputStreamSender>public void setResendable(boolean resendable)
Specifies whether the content can be resent to the output stream if the request must be retried.
setResendable in class com.marklogic.client.impl.HandleImplementation<OperationNotSupported,OutputStreamSender>resendable - true if the content can be sent againpublic OutputStreamHandle withResendable(boolean resendable)
Specifies whether the content can be resent to the output stream and returns the handle as a fluent convenience.
resendable - true if the content can be sent againpublic OutputStreamSender get()
Returns the output stream sender that writes the content.
public void set(OutputStreamSender sender)
Assigns an output stream sender providing the callback that writes content to the database via an output stream.
sender - the output stream senderpublic OutputStreamHandle with(OutputStreamSender sender)
Assigns an output stream sender providing the callback that writes content to the database and returns the handle as a fluent convenience.
sender - the output stream senderCopyright © 2013-2017 MarkLogic Corporation.