public class DocumentMetadataHandle extends BaseHandle<java.io.InputStream,OutputStreamSender> implements OutputStreamSender, BufferableHandle, DocumentMetadataReadHandle, DocumentMetadataWriteHandle
Modifier and Type | Class and Description |
---|---|
static class |
DocumentMetadataHandle.Capability
A document operation restricted to users with a
role.
|
static interface |
DocumentMetadataHandle.DocumentCollections
Represents the collections for a database
document.
|
static interface |
DocumentMetadataHandle.DocumentMetadataValues
Represents the metadata-values for a database
document.
|
static interface |
DocumentMetadataHandle.DocumentPermissions
Represents the permissions for a database
document.
|
static interface |
DocumentMetadataHandle.DocumentProperties
Represents the properties for a database
document.
|
UNKNOWN_LENGTH
Constructor and Description |
---|
DocumentMetadataHandle()
Zero-argument constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
fromBuffer(byte[] buffer)
fromBuffer() populates DocumentMetadataHandle
from a byte array buffer.
|
DocumentMetadataHandle.DocumentCollections |
getCollections()
Returns a container for the collections for the
document as read from the server or modified locally.
|
DocumentMetadataHandle.DocumentMetadataValues |
getMetadataValues()
Returns a container for the metadata-values for
the document as read from the server or modified locally.
|
DocumentMetadataHandle.DocumentPermissions |
getPermissions()
Returns a container for the permissions on the
document as read from the server or modified locally.
|
DocumentMetadataHandle.DocumentProperties |
getProperties()
Returns a container for the properties of the
document as read from the server or modified locally.
|
int |
getQuality()
Returns the quality of the document.
|
protected
java.lang.Class<java.io.InputStream> |
receiveAs() |
protected void |
receiveContent(java.io.InputStream content) |
protected OutputStreamSender |
sendContent() |
void |
setCollections(DocumentMetadataHandle.DocumentCollections collections)
Locally assigns a container with document
collections.
|
void |
setFormat(Format format)
Restricts the format used parsing and
serializing the metadata.
|
void |
setMetadataValues(DocumentMetadataHandle.DocumentMetadataValues metadataValues)
Locally assigns a container with document
metadata-values.
|
void |
setPermissions(DocumentMetadataHandle.DocumentPermissions permissions)
Locally assigns a container with document
permissions.
|
void |
setProperties(DocumentMetadataHandle.DocumentProperties properties)
Locally assigns a container with document
properties.
|
void |
setQuality(int quality)
Specifies the quality of the document, which
affects search weighting.
|
byte[] |
toBuffer()
Copies the content of the handle to a byte array
buffer encoded in UTF-8.
|
java.lang.String |
toString()
Returns the document metadata as an XML
string.
|
DocumentMetadataHandle |
withCollections(java.lang.String... collections)
Locally adds the collections to the current
collections for the document.
|
DocumentMetadataHandle |
withMetadataValue(java.lang.String key,
java.lang.String value)
Locally adds the metadata-value to the current
metadata-values for the document.
|
DocumentMetadataHandle |
withPermission(java.lang.String role,
DocumentMetadataHandle.Capability... capabilities)
Locally adds the role and its capabilities to
the current permissions for the document.
|
DocumentMetadataHandle |
withProperty(javax.xml.namespace.QName name,
java.lang.Object value)
Locally adds the property name and value to the
current properties for the document.
|
DocumentMetadataHandle |
withProperty(java.lang.String name,
java.lang.Object value)
Locally adds the property name and value to the
current properties for the document.
|
DocumentMetadataHandle |
withQuality(int quality)
Locally specifies the match quality for the
document.
|
void |
write(java.io.OutputStream out)
Implements a callback to write content to the
provided output stream for sending to the database server.
|
getByteLength,
getFormat,
getMimetype,
getServerTimestamp,
setByteLength,
setMimetype,
setServerTimestamp
public DocumentMetadataHandle()
public DocumentMetadataHandle.DocumentCollections getCollections()
public void setCollections(DocumentMetadataHandle.DocumentCollections collections)
collections
- the document collectionspublic DocumentMetadataHandle withCollections(java.lang.String... collections)
collections
- the document collectionspublic DocumentMetadataHandle.DocumentPermissions getPermissions()
public void setPermissions(DocumentMetadataHandle.DocumentPermissions permissions)
permissions
- the document permissionspublic DocumentMetadataHandle withPermission(java.lang.String role, DocumentMetadataHandle.Capability... capabilities)
role
- the role for users permitted to access the
documentcapabilities
- the permissions to be granted to
users with the rolepublic DocumentMetadataHandle.DocumentProperties getProperties()
public void setProperties(DocumentMetadataHandle.DocumentProperties properties)
properties
- the document propertiespublic DocumentMetadataHandle withProperty(javax.xml.namespace.QName name, java.lang.Object value)
name
- the namespaced QName identifying the
propertyvalue
- the value of the propertypublic DocumentMetadataHandle withProperty(java.lang.String name, java.lang.Object value)
name
- the simple string name identifying the
propertyvalue
- the value of the propertypublic int getQuality()
public void setQuality(int quality)
quality
- the document qualitypublic DocumentMetadataHandle withQuality(int quality)
quality
- the document qualitypublic DocumentMetadataHandle.DocumentMetadataValues getMetadataValues()
public void setMetadataValues(DocumentMetadataHandle.DocumentMetadataValues metadataValues)
metadataValues
- the document metadata-valuespublic DocumentMetadataHandle withMetadataValue(java.lang.String key, java.lang.String value)
key
- the key of metadata-valuevalue
- the value of metadata-valuepublic void setFormat(Format format)
setFormat
in interface ContentDescriptor
setFormat
in class BaseHandle<java.io.InputStream,OutputStreamSender>
format
- the format of the contentpublic void fromBuffer(byte[] buffer)
fromBuffer
in interface BufferableHandle
buffer
- the byte arraypublic byte[] toBuffer()
BufferableHandle
toBuffer
in interface BufferableHandle
public java.lang.String toString()
toString
in
class java.lang.Object
protected java.lang.Class<java.io.InputStream> receiveAs()
receiveAs
in
class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>
protected void receiveContent(java.io.InputStream content)
receiveContent
in
class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>
protected OutputStreamSender sendContent()
sendContent
in
class com.marklogic.client.impl.HandleImplementation<java.io.InputStream,OutputStreamSender>
public void write(java.io.OutputStream out) throws java.io.IOException
OutputStreamSender
write
in interface OutputStreamSender
out
- the output stream receiving the contentjava.io.IOException
- if io problems ariseCopyright © 2024 MarkLogic Corporation. All Rights Reserved.