R - the set of handles for reading the document content from the databaseW - the set of handles for writing the document content to the databasepublic interface DocumentManager<R extends AbstractReadHandle,W extends AbstractWriteHandle>
A Document Manager provides database operations on a document.
| Modifier and Type | Interface and Description |
|---|---|
static class |
DocumentManager.Metadata
The Metadata enumeration specifies the categories of metadata read from or written to the database.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearMetadataCategories()
Clears the metadata categories.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle)
Creates a database document with metadata and content and a uri assigned by the server.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
ServerTransform transform)
Creates a database document with metadata and content and a uri assigned by the server as transformed on the server.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
ServerTransform transform,
Transaction transaction)
Creates a database document with metadata and content and a uri assigned by the server in an open database transaction as transformed on the server.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
Transaction transaction) |
DocumentDescriptor |
create(DocumentUriTemplate template,
W contentHandle)
Creates a database document with a uri assigned by the server.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
W contentHandle,
ServerTransform transform)
Creates a database document with a uri assigned by the server as transformed on the server.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
W contentHandle,
ServerTransform transform,
Transaction transaction)
Creates a database document with a uri assigned by the server in an open database transaction as transformed on the server.
|
DocumentDescriptor |
create(DocumentUriTemplate template,
W contentHandle,
Transaction transaction)
Creates a database document with a uri assigned by the server in an open database transaction.
|
DocumentDescriptor |
createAs(DocumentUriTemplate template,
DocumentMetadataWriteHandle metadataHandle,
Object content)
Creates a database document with a uri assigned by the server from an object of an IO class.
|
DocumentDescriptor |
createAs(DocumentUriTemplate template,
DocumentMetadataWriteHandle metadataHandle,
Object content,
ServerTransform transform)
Creates a database document with a uri assigned by the server from an object of an IO class.
|
DocumentDescriptor |
createAs(DocumentUriTemplate template,
Object content)
Creates a database document with a uri assigned by the server from an object of an IO class.
|
DocumentDescriptor |
createAs(DocumentUriTemplate template,
Object content,
ServerTransform transform)
Creates a database document with a uri assigned by the server from an object of an IO class.
|
void |
delete(DocumentDescriptor desc)
Deletes the document metadata and content from the database
|
void |
delete(DocumentDescriptor desc,
Transaction transaction)
Deletes the document metadata and content from an open database transaction
|
void |
delete(String... uris)
Deletes the documents’ metadata and content
|
void |
delete(String docId)
Deletes the document metadata and content from the database
|
void |
delete(String docId,
Transaction transaction)
Deletes the document metadata and content from an open database transaction
|
void |
delete(Transaction transaction,
String... uris)
Deletes the documents’ metadata and content from an open database transaction
|
DocumentDescriptor |
exists(String docId)
Checks whether a document exists and gets its byte length, format, mimetype, and version if it does.
|
DocumentDescriptor |
exists(String docId,
Transaction transaction)
Checks whether a document exists in an open transaction and gets its byte length, format, mimetype, and version if it does.
|
Format |
getContentFormat()
Gets the default format of the managed documents
|
Set<DocumentManager.Metadata> |
getMetadataCategories()
Returns the categories of metadata to read, write, patch, or search.
|
Format |
getNonDocumentFormat()
Returns the format (if set) for the search response from
search and metadata available from DocumentPage.next().getMetadata(handle) (assuming setMetadataCategories has been called to request specific metadata). |
long |
getPageLength()
Get the maximum number of records to return in a page from calls to
search |
ServerTransform |
getReadTransform()
Returns the transform for read requests that don’t specify a transform.
|
QueryManager.QueryView |
getSearchView()
Returns the view types included in a SearchReadHandle populated by calls to
search |
ServerTransform |
getWriteTransform()
Returns the transform for write requests that don’t specify a transform.
|
DocumentDescriptor |
newDescriptor(String uri)
Creates a document descriptor for identifying the uri of a document, its format and mimetype, and its version.
|
DocumentUriTemplate |
newDocumentUriTemplate(String extension)
Creates a document uri template for assigning a uri to a document.
|
DocumentMetadataPatchBuilder |
newPatchBuilder(Format pathFormat)
For XMLDocumentManager or JSONDocumentManager, creates a builder for specifying changes to the document and metadata of a document.
|
DocumentWriteSet |
newWriteSet() |
void |
patch(DocumentDescriptor desc,
DocumentPatchHandle patch)
Modifies the metadata or content of a document.
|
void |
patch(DocumentDescriptor desc,
DocumentPatchHandle patch,
Transaction transaction)
Modifies the metadata or content of a document within an open database transaction on the server.
|
void |
patch(String docId,
DocumentPatchHandle patch)
Modifies the metadata or content of a document within an open database transaction on the server.
|
void |
patch(String docId,
DocumentPatchHandle patch,
Transaction transaction)
Modifies the metadata or content of a document within an open database transaction on the server.
|
void |
patchAs(String docId,
Object patch)
Modifies the metadata or content of a document within an open database transaction on the server.
|
<T extends R> |
read(DocumentDescriptor desc,
DocumentMetadataReadHandle metadataHandle,
T contentHandle)
Reads the document metadata and content from the database in the representations provided by the handles
|
<T extends R> |
read(DocumentDescriptor desc,
DocumentMetadataReadHandle metadataHandle,
T contentHandle,
ServerTransform transform)
Reads the document metadata and content from the database as transformed on the server.
|
<T extends R> |
read(DocumentDescriptor desc,
DocumentMetadataReadHandle metadataHandle,
T contentHandle,
ServerTransform transform,
Transaction transaction)
Reads the document metadata and content from an open database transaction as transformed on the server.
|
<T extends R> |
read(DocumentDescriptor desc,
DocumentMetadataReadHandle metadataHandle,
T contentHandle,
Transaction transaction)
Reads the document metadata and content from an open database transaction in the representations provided by the handles
|
<T extends R> |
read(DocumentDescriptor desc,
T contentHandle)
Reads the document content from the database in the representations provided by the handles
|
<T extends R> |
read(DocumentDescriptor desc,
T contentHandle,
ServerTransform transform)
Reads the document content from the database as transformed on the server.
|
<T extends R> |
read(DocumentDescriptor desc,
T contentHandle,
ServerTransform transform,
Transaction transaction)
Reads the document content from an open database transaction as transformed on the server.
|
<T extends R> |
read(DocumentDescriptor desc,
T contentHandle,
Transaction transaction)
Reads the document content from an open database transaction in the representation provided by the handle
|
DocumentPage |
read(ServerTransform transform,
String... uris)
Reads from the database a list of documents matching the provided uris.
|
DocumentPage |
read(ServerTransform transform,
Transaction transaction,
String... uris)
Reads from the database a list of documents matching the provided uris.
|
DocumentPage |
read(String... uris)
Reads from the database a list of documents matching the provided uris.
|
<T extends R> |
read(String docId,
DocumentMetadataReadHandle metadataHandle,
T contentHandle)
Reads the document metadata and content from the database in the representations provided by the handles
|
<T extends R> |
read(String docId,
DocumentMetadataReadHandle metadataHandle,
T contentHandle,
ServerTransform transform)
Reads the document metadata and content from the database as transformed on the server.
|
<T extends R> |
read(String docId,
DocumentMetadataReadHandle metadataHandle,
T contentHandle,
ServerTransform transform,
Transaction transaction)
Reads the document metadata and content from an open database transaction as transformed on the server.
|
<T extends R> |
read(String docId,
DocumentMetadataReadHandle metadataHandle,
T contentHandle,
Transaction transaction)
Reads the document metadata and content from an open database transaction in the representations provided by the handles
|
<T extends R> |
read(String docId,
T contentHandle)
Reads the document content from the database in the representation provided by the handle
|
<T extends R> |
read(String docId,
T contentHandle,
ServerTransform transform)
Reads the document content from the database as transformed on the server.
|
<T extends R> |
read(String docId,
T contentHandle,
ServerTransform transform,
Transaction transaction)
Reads the document content from an open database transaction as transformed on the server.
|
<T extends R> |
read(String docId,
T contentHandle,
Transaction transaction)
Reads the document content from an open database transaction in the representation provided by the handle
|
DocumentPage |
read(Transaction transaction,
String... uris)
Reads from the database a list of documents matching the provided uris.
|
<T> T |
readAs(String docId,
Class<T> as)
Reads the document content from the database in the representation specified by the IO class.
|
<T> T |
readAs(String docId,
Class<T> as,
ServerTransform transform)
Reads the document content from the database in the representation specified by the IO class.
|
<T> T |
readAs(String docId,
DocumentMetadataReadHandle metadataHandle,
Class<T> as)
Reads the document metadata and content from the database in the representation specified by the IO class.
|
<T> T |
readAs(String docId,
DocumentMetadataReadHandle metadataHandle,
Class<T> as,
ServerTransform transform)
Reads the document metadata and content from the database in the representation specified by the IO class.
|
DocumentPage |
readMetadata(String... uris)
Reads from the database the metadata for a list of documents matching the provided uris.
|
<T extends DocumentMetadataReadHandle> |
readMetadata(String docId,
T metadataHandle)
Reads the document metadata from the database in the representation provided by the handle
|
<T extends DocumentMetadataReadHandle> |
readMetadata(String docId,
T metadataHandle,
Transaction transaction)
Reads the document metadata from an open database transaction in the representation provided by the handle
|
DocumentPage |
readMetadata(Transaction transaction,
String... uris)
Reads from the database the metadata for a list of documents matching the provided uris.
|
DocumentPage |
search(QueryDefinition querydef,
long start)
Just like
QueryManager.search but return complete documents via iterable DocumentPage. |
DocumentPage |
search(QueryDefinition querydef,
long start,
SearchReadHandle searchHandle)
Just like
QueryManager.search but return complete documents via iterable DocumentPage. |
DocumentPage |
search(QueryDefinition querydef,
long start,
SearchReadHandle searchHandle,
Transaction transaction)
Just like
QueryManager.search(QueryDefinition, SearchReadHandle, long, Transaction) but return complete documents via iterable DocumentPage. |
DocumentPage |
search(QueryDefinition querydef,
long start,
Transaction transaction)
Just like
QueryManager.search but return complete documents via iterable DocumentPage. |
void |
setContentFormat(Format format)
Sets the default format of the managed documents
|
void |
setMetadataCategories(DocumentManager.Metadata... categories)
Specifies the categories of metadata to read, write, patch, or search.
|
void |
setMetadataCategories(Set<DocumentManager.Metadata> categories)
Specifies the categories of metadata to read, write, patch, or search.
|
void |
setNonDocumentFormat(Format nonDocumentFormat)
Specifies the format for the search response from
search and metadata available from DocumentPage.next().getMetadata(handle) (assuming setMetadataCategories has been called to request specific metadata). |
void |
setPageLength(long length)
Specifies the maximum number of documents that can appear in any page of the query results, overriding any maximum specified in the query options.
|
void |
setReadTransform(ServerTransform transform)
Specifies a transform for read requests that don’t specify a transform.
|
void |
setSearchView(QueryManager.QueryView view)
Specifies the view types included in a SearchReadHandle populated by calls to
search |
void |
setWriteTransform(ServerTransform transform)
Specifies a transform for write requests that don’t specify a transform.
|
void |
startLogging(RequestLogger logger)
Starts debugging client requests.
|
void |
stopLogging()
Stops debugging client requests.
|
void |
write(DocumentDescriptor desc,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle)
Writes the document metadata and content to the database from the representations provided by the handles
|
void |
write(DocumentDescriptor desc,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
ServerTransform transform)
Writes the document metadata and content to the database as transformed on the server.
|
void |
write(DocumentDescriptor desc,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
ServerTransform transform,
Transaction transaction)
Writes the document metadata and content to an open database transaction as transformed on the server.
|
void |
write(DocumentDescriptor desc,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
Transaction transaction)
Writes the document metadata and content to an open database transaction from the representations provided by the handles
|
void |
write(DocumentDescriptor desc,
W contentHandle)
Writes the document content to the database from the representation provided by the handle
|
void |
write(DocumentDescriptor desc,
W contentHandle,
ServerTransform transform)
Writes the document content to the database as transformed on the server.
|
void |
write(DocumentDescriptor desc,
W contentHandle,
ServerTransform transform,
Transaction transaction)
Writes the document content to an open database transaction as transformed on the server.
|
void |
write(DocumentDescriptor desc,
W contentHandle,
Transaction transaction)
Writes the document content to an open database transaction from the representation provided by the handle
|
void |
write(DocumentWriteSet writeSet)
Write a set of documents and metadata to the server via REST API bulk capabilities.
|
void |
write(DocumentWriteSet writeSet,
ServerTransform transform)
Write a set of documents and metadata to the server via REST API bulk capabilities.
|
void |
write(DocumentWriteSet writeSet,
ServerTransform transform,
Transaction transaction)
Write a set of documents and metadata to the server via REST API bulk capabilities.
|
void |
write(DocumentWriteSet writeSet,
Transaction transaction)
Write a set of documents and metadata to the server via REST API bulk capabilities.
|
void |
write(String docId,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle)
Writes the document metadata and content to the database from the representations provided by the handles
|
void |
write(String docId,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
ServerTransform transform)
Writes the document metadata and content to the database as transformed on the server.
|
void |
write(String docId,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
ServerTransform transform,
Transaction transaction)
Writes the document metadata and content to an open database transaction as transformed on the server.
|
void |
write(String docId,
DocumentMetadataWriteHandle metadataHandle,
W contentHandle,
Transaction transaction)
Writes the document metadata and content to an open database transaction from the representations provided by the handles
|
void |
write(String docId,
W contentHandle)
Writes the document content to the database from the representation provided by the handle
|
void |
write(String docId,
W contentHandle,
ServerTransform transform)
Writes the document content to the database as transformed on the server.
|
void |
write(String docId,
W contentHandle,
ServerTransform transform,
Transaction transaction)
Writes the document content to an open database transaction as transformed on the server.
|
void |
write(String docId,
W contentHandle,
Transaction transaction)
Writes the document content to an open database transaction from the representation provided by the handle
|
void |
writeAs(String docId,
DocumentMetadataWriteHandle metadataHandle,
Object content)
Writes the document content to the database from an object of an IO class.
|
void |
writeAs(String docId,
DocumentMetadataWriteHandle metadataHandle,
Object content,
ServerTransform transform)
Writes the document content to the database from an object of an IO class.
|
void |
writeAs(String docId,
Object content)
Writes the document content to the database from an object of an IO class.
|
void |
writeAs(String docId,
Object content,
ServerTransform transform)
Writes the document content to the database from an object of an IO class.
|
void |
writeDefaultMetadata(String docId)
Reverts the document metadata in the database to the defaults
|
void |
writeDefaultMetadata(String docId,
Transaction transaction)
Reverts the document metadata in an open database transaction to the defaults
|
void |
writeMetadata(String docId,
DocumentMetadataWriteHandle metadataHandle)
Writes the document metadata to the database from the representation provided by the handle
|
void |
writeMetadata(String docId,
DocumentMetadataWriteHandle metadataHandle,
Transaction transaction)
Writes the document metadata to an open database transaction from the representation provided by the handle
|
DocumentDescriptor newDescriptor(String uri)
Creates a document descriptor for identifying the uri of a document, its format and mimetype, and its version.
uri - the identifier for the documentDocumentUriTemplate newDocumentUriTemplate(String extension)
Creates a document uri template for assigning a uri to a document.
extension - the identifier for the documentDocumentMetadataPatchBuilder newPatchBuilder(Format pathFormat)
For XMLDocumentManager or JSONDocumentManager, creates a builder for specifying changes to the document and metadata of a document. For GenericDocumentManager, TextDocumentManager, and BinaryDocumentManager, creates a builder for specifying changes to only the metadata of a document since binary and text documents cannot be changed with patches.
pathFormat - the patch path language. Set to JSON for JSONPath or XML for XPath.DocumentDescriptor exists(String docId) throws ForbiddenUserException, FailedRequestException
Checks whether a document exists and gets its byte length, format, mimetype, and version if it does.
To call exists(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
docId - the URI identifier for the documentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor exists(String docId, Transaction transaction) throws ForbiddenUserException, FailedRequestException
Checks whether a document exists in an open transaction and gets its byte length, format, mimetype, and version if it does.
To call exists(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
docId - the URI identifier for the documenttransaction - a open transaction under which the document may have been created or deletedForbiddenUserExceptionFailedRequestException<T> T readAs(String docId, Class<T> as) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from the database in the representation specified by the IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itdocId - the URI identifier for the documentas - the IO class for reading the content of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T> T readAs(String docId, Class<T> as, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from the database in the representation specified by the IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itdocId - the URI identifier for the documentas - the IO class for reading the content of the documenttransform - a server transform to modify the document contentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T> T readAs(String docId, DocumentMetadataReadHandle metadataHandle, Class<T> as) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from the database in the representation specified by the IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itdocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentas - the IO class for reading the content of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T> T readAs(String docId, DocumentMetadataReadHandle metadataHandle, Class<T> as, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from the database in the representation specified by the IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
T - the type of object that will be returned by the handle registered for itdocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentas - the IO class for reading the content of the documenttransform - a server transform to modify the document contentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, T contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from the database in the representation provided by the handle
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentcontentHandle - a handle for reading the content of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, T contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from the database as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, T contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from the database in the representations provided by the handles
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for reading the content of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, T contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from the database as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, DocumentMetadataReadHandle metadataHandle, T contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from the database in the representations provided by the handles
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from the database as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from the database in the representations provided by the handles
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from the database as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, T contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from an open database transaction in the representation provided by the handle
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentcontentHandle - a handle for reading the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, T contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from an open database transaction as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, T contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from an open database transaction in the representation provided by the handle
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for reading the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, T contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document content from an open database transaction as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, DocumentMetadataReadHandle metadataHandle, T contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from an open database transaction in the representations provided by the handles
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(String docId, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from an open database transaction as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from an open database transaction in the representations provided by the handles
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends R> T read(DocumentDescriptor desc, DocumentMetadataReadHandle metadataHandle, T contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata and content from an open database transaction as transformed on the server.
To call read(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of content handle to returndesc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for reading the metadata of the documentcontentHandle - a handle for reading the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionDocumentPage read(String... uris)
Reads from the database a list of documents matching the provided uris. Allows iteration across matching documents and metadata (only if setMetadataCategories has been called to request metadata). To find out how many of your uris matched, call the DocumentPage.size() method.
uris - the database uris identifying documents to retrieveDocumentPage read(ServerTransform transform, String... uris)
Reads from the database a list of documents matching the provided uris. Allows iteration across matching documents and metadata (only if setMetadataCategories has been called to request metadata). To find out how many of your uris matched, call the DocumentPage.size() method.
transform - the transform to be run on the server on each document (must already be installed)uris - the database uris identifying documents to retrieveDocumentPage read(Transaction transaction, String... uris)
Reads from the database a list of documents matching the provided uris. Allows iteration across matching documents and metadata (only if setMetadataCategories has been called to request metadata). To find out how many of your uris matched, call the DocumentPage.size() method.
transaction - the transaction in which this read is participatinguris - the database uris identifying documents to retrieveDocumentPage read(ServerTransform transform, Transaction transaction, String... uris)
Reads from the database a list of documents matching the provided uris. Allows iteration across matching documents and metadata (only if setMetadataCategories has been called to request metadata). To find out how many of your uris matched, call the DocumentPage.size() method.
transform - the transform to be run on the server on each document (must already be installed)transaction - the transaction in which this read is participatinguris - the database uris identifying documents to retrieveDocumentPage readMetadata(String... uris)
Reads from the database the metadata for a list of documents matching the provided uris. Allows iteration across the metadata for matching documents (only if setMetadataCategories has been called to request metadata). To find out how many of your uris matched, call the DocumentPage.size() method.
uris - the database uris identifying documentsDocumentPage readMetadata(Transaction transaction, String... uris)
Reads from the database the metadata for a list of documents matching the provided uris. Allows iteration across the metadata for matching documents (only if setMetadataCategories has been called to request metadata). To find out how many of your uris matched, call the DocumentPage.size() method.
transaction - the transaction in which this read is participatinguris - the database uris identifying documentsDocumentPage search(QueryDefinition querydef, long start)
Just like QueryManager.search but return complete documents via iterable DocumentPage. Retrieves up to getPageLength() documents in each DocumentPage. If setMetadataCategories has been called, populates metadata for each result in the format specified by setNonDocumentFormat.
querydef - the definition of query criteria and query optionsstart - the offset of the first document in the page (where 1 is the first result)DocumentPage search(QueryDefinition querydef, long start, Transaction transaction)
Just like QueryManager.search but return complete documents via iterable DocumentPage. Retrieves up to getPageLength() documents in each DocumentPage. If setMetadataCategories has been called, populates metadata for each result in the format specified by setNonDocumentFormat.
querydef - the definition of query criteria and query optionsstart - the offset of the first document in the page (where 1 is the first result)transaction - an open transaction for matching documentsDocumentPage search(QueryDefinition querydef, long start, SearchReadHandle searchHandle)
Just like QueryManager.search but return complete documents via iterable DocumentPage. Retrieves up to getPageLength() documents in each DocumentPage. If searchHandle is not null, requests a search response and populates searchHandle with it. If setMetadataCategories has been called, populates metadata for each result in the format specified by setNonDocumentFormat.
querydef - the definition of query criteria and query optionsstart - the offset of the first document in the page (where 1 is the first result)searchHandle - a handle for reading the search response which will include view types specified by setSearchView and format specified by setNonDocumentFormatDocumentPage search(QueryDefinition querydef, long start, SearchReadHandle searchHandle, Transaction transaction)
Just like QueryManager.search(QueryDefinition, SearchReadHandle, long, Transaction) but return complete documents via iterable DocumentPage. Retrieves up to getPageLength() documents in each DocumentPage. If searchHandle is not null, requests a search response and populates searchHandle with it. If setMetadataCategories has been called, populates metadata for each result in the format specified by setNonDocumentFormat.
querydef - the definition of query criteria and query optionsstart - the offset of the first document in the page (where 1 is the first result)searchHandle - a handle for reading the search response which will include view types specified by setSearchView and format specified by setNonDocumentFormattransaction - an open transaction for matching documentslong getPageLength()
Get the maximum number of records to return in a page from calls to search
searchvoid setPageLength(long length)
Specifies the maximum number of documents that can appear in any page of the query results, overriding any maximum specified in the query options.
length - the maximum number of records to return in a page from calls to searchFormat getNonDocumentFormat()
Returns the format (if set) for the search response from search and metadata available from DocumentPage.next().getMetadata(handle) (assuming setMetadataCategories has been called to request specific metadata). If setNonDocumentFormat has not been called, the server default format will be used.
void setNonDocumentFormat(Format nonDocumentFormat)
Specifies the format for the search response from search and metadata available from DocumentPage.next().getMetadata(handle) (assuming setMetadataCategories has been called to request specific metadata). If setNonDocumentFormat is not called, the server default format will be used.
nonDocumentFormat - the format to useQueryManager.QueryView getSearchView()
Returns the view types included in a SearchReadHandle populated by calls to search
searchvoid setSearchView(QueryManager.QueryView view)
Specifies the view types included in a SearchReadHandle populated by calls to search
view - the view types included in a SearchReadHandle populated by calls to searchDocumentWriteSet newWriteSet()
void write(DocumentWriteSet writeSet)
Write a set of documents and metadata to the server via REST API bulk capabilities.
writeSet - the set of documents and metadata to writevoid write(DocumentWriteSet writeSet, ServerTransform transform)
Write a set of documents and metadata to the server via REST API bulk capabilities.
writeSet - the set of documents and metadata to writetransform - a server transform to modify the contents of each documentvoid write(DocumentWriteSet writeSet, Transaction transaction)
Write a set of documents and metadata to the server via REST API bulk capabilities.
writeSet - the set of documents and metadata to writetransaction - an open transaction under which the documents will be writtenvoid write(DocumentWriteSet writeSet, ServerTransform transform, Transaction transaction)
Write a set of documents and metadata to the server via REST API bulk capabilities.
writeSet - the set of documents and metadata to writetransform - a server transform to modify the contents of each documenttransaction - an open transaction under which the documents will be writtenvoid writeAs(String docId, Object content) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
docId - the URI identifier for the documentcontent - an IO representation of the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeAs(String docId, Object content, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
docId - the URI identifier for the documentcontent - an IO representation of the document contenttransform - a server transform to modify the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeAs(String docId, DocumentMetadataWriteHandle metadataHandle, Object content) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentcontent - an IO representation of the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid writeAs(String docId, DocumentMetadataWriteHandle metadataHandle, Object content, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentcontent - an IO representation of the document contenttransform - a server transform to modify the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, W contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database from the representation provided by the handle
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentcontentHandle - a handle for writing the content of the documentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, W contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, W contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database from the representation provided by the handle
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for writing the content of the documentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, W contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to the database as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, DocumentMetadataWriteHandle metadataHandle, W contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to the database from the representations provided by the handles
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to the database as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, DocumentMetadataWriteHandle metadataHandle, W contentHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to the database from the representations provided by the handles
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to the database as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contentResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, W contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to an open database transaction from the representation provided by the handle
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentcontentHandle - a handle for writing the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, W contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to an open database transaction as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, W contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to an open database transaction from the representation provided by the handle
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for writing the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, W contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document content to an open database transaction as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, DocumentMetadataWriteHandle metadataHandle, W contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to an open database transaction from the representations provided by the handles
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(String docId, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to an open database transaction as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, DocumentMetadataWriteHandle metadataHandle, W contentHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to an open database transaction from the representations provided by the handles
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid write(DocumentDescriptor desc, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata and content to an open database transaction as transformed on the server.
To call write(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentmetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundExceptionForbiddenUserExceptionFailedRequestExceptionvoid delete(String docId) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Deletes the document metadata and content from the database
To call delete(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid delete(String docId, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Deletes the document metadata and content from an open database transaction
To call delete(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid delete(String... uris) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Deletes the documents’ metadata and content
To call delete(), an application must authenticate as rest-writer or rest-admin.
uris - the identifiers for the documents to deleteResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid delete(Transaction transaction, String... uris) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Deletes the documents’ metadata and content from an open database transaction
To call delete(), an application must authenticate as rest-writer or rest-admin.
transaction - an open transactionuris - the identifiers for the documents to deleteResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid delete(DocumentDescriptor desc) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Deletes the document metadata and content from the database
To call delete(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid delete(DocumentDescriptor desc, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Deletes the document metadata and content from an open database transaction
To call delete(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor createAs(DocumentUriTemplate template, Object content) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
template - the template for constructing the document uricontent - an IO representation of the document contentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor createAs(DocumentUriTemplate template, Object content, ServerTransform transform) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
template - the template for constructing the document uricontent - an IO representation of the document contenttransform - a server transform to modify the document contentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor createAs(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, Object content) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
template - the template for constructing the document urimetadataHandle - a handle for writing the metadata of the documentcontent - an IO representation of the document contentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor createAs(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, Object content, ServerTransform transform) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server from an object of an IO class.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
template - the template for constructing the document urimetadataHandle - a handle for writing the metadata of the documentcontent - an IO representation of the document contenttransform - a server transform to modify the document contentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, W contentHandle) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server.
template - the template for constructing the document uricontentHandle - a handle for writing the content of the documentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, W contentHandle, ServerTransform transform) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server as transformed on the server.
template - the template for constructing the document uricontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, W contentHandle, Transaction transaction) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server in an open database transaction.
template - the template for constructing the document uricontentHandle - a handle for writing the content of the documenttransaction - a open transaction under which the document may have been created or deletedForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, W contentHandle, ServerTransform transform, Transaction transaction) throws ForbiddenUserException, FailedRequestException
Creates a database document with a uri assigned by the server in an open database transaction as transformed on the server.
template - the template for constructing the document uricontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, W contentHandle) throws ForbiddenUserException, FailedRequestException
Creates a database document with metadata and content and a uri assigned by the server.
template - the template for constructing the document urimetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform) throws ForbiddenUserException, FailedRequestException
Creates a database document with metadata and content and a uri assigned by the server as transformed on the server.
template - the template for constructing the document urimetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contentForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, W contentHandle, Transaction transaction) throws ForbiddenUserException, FailedRequestException
template - the template for constructing the document urimetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransaction - a open transaction under which the document may have been created or deletedForbiddenUserExceptionFailedRequestExceptionDocumentDescriptor create(DocumentUriTemplate template, DocumentMetadataWriteHandle metadataHandle, W contentHandle, ServerTransform transform, Transaction transaction) throws ForbiddenUserException, FailedRequestException
Creates a database document with metadata and content and a uri assigned by the server in an open database transaction as transformed on the server.
template - the template for constructing the document urimetadataHandle - a handle for writing the metadata of the documentcontentHandle - a handle for writing the content of the documenttransform - a server transform to modify the document contenttransaction - a open transaction under which the document may have been created or deletedForbiddenUserExceptionFailedRequestExceptionvoid patchAs(String docId, Object patch) throws ForbiddenUserException, FailedRequestException
Modifies the metadata or content of a document within an open database transaction on the server. Content can only be modified for JSON or XML documents. You must use the setMetadataCategories() method to specify whether the patch includes metadata. An IO representation such as a string, input stream, or XML DOM specifies the patch as content.
The IO class must have been registered before creating the database client. By default, the provided handles that implement ContentHandle are registered.
docId - the URI identifier for the documentpatch - an IO representation of the patchForbiddenUserExceptionFailedRequestExceptionvoid patch(String docId, DocumentPatchHandle patch)
Modifies the metadata or content of a document within an open database transaction on the server. Content can only be modified for JSON or XML documents. When sending a raw JSON or XML patch, you must use the setMetadataCategories() method to specify whether the patch includes metadata.
To call patch(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentpatch - a handle for writing the modification to the document metadata or contentvoid patch(String docId, DocumentPatchHandle patch, Transaction transaction)
Modifies the metadata or content of a document within an open database transaction on the server. Content can only be modified for JSON or XML documents. When sending a raw JSON or XML patch, you must use the setMetadataCategories() method to specify whether the patch includes metadata.
To call patch(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentpatch - a handle for writing the modification to the document metadata or contenttransaction - a open transactionvoid patch(DocumentDescriptor desc, DocumentPatchHandle patch)
Modifies the metadata or content of a document. Content can only be modified for JSON or XML documents. When sending a raw JSON or XML patch, you must use the setMetadataCategories() method to specify whether the patch includes metadata.
To call patch(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentpatch - a handle for writing the modification to the document metadata or contentvoid patch(DocumentDescriptor desc, DocumentPatchHandle patch, Transaction transaction)
Modifies the metadata or content of a document within an open database transaction on the server. Content can only be modified for JSON or XML documents. When sending a raw JSON or XML patch, you must use the setMetadataCategories() method to specify whether the patch includes metadata.
To call patch(), an application must authenticate as rest-writer or rest-admin.
desc - a descriptor for the URI identifier, format, and mimetype of the documentpatch - a handle for writing the modification to the document metadata or contenttransaction - a open transaction<T extends DocumentMetadataReadHandle> T readMetadata(String docId, T metadataHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata from the database in the representation provided by the handle
To call readMetadata(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of DocumentMetadataReadHandle to returndocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestException<T extends DocumentMetadataReadHandle> T readMetadata(String docId, T metadataHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reads the document metadata from an open database transaction in the representation provided by the handle
To call readMetadata(), an application must authenticate as rest-reader, rest-writer, or rest-admin.
T - the type of DocumentMetadataReadHandle to returndocId - the URI identifier for the documentmetadataHandle - a handle for reading the metadata of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid writeMetadata(String docId, DocumentMetadataWriteHandle metadataHandle) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata to the database from the representation provided by the handle
To call writeMetadata(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid writeMetadata(String docId, DocumentMetadataWriteHandle metadataHandle, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Writes the document metadata to an open database transaction from the representation provided by the handle
To call writeMetadata(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentmetadataHandle - a handle for writing the metadata of the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid writeDefaultMetadata(String docId) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reverts the document metadata in the database to the defaults
To call writeDefaultMetadata(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documentResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionvoid writeDefaultMetadata(String docId, Transaction transaction) throws ResourceNotFoundException, ForbiddenUserException, FailedRequestException
Reverts the document metadata in an open database transaction to the defaults
To call writeDefaultMetadata(), an application must authenticate as rest-writer or rest-admin.
docId - the URI identifier for the documenttransaction - a open transaction under which the document may have been created or deletedResourceNotFoundException - if the document is not foundForbiddenUserExceptionFailedRequestExceptionFormat getContentFormat()
Gets the default format of the managed documents
void setContentFormat(Format format)
Sets the default format of the managed documents
format - the default format for documents supported by this document managerSet<DocumentManager.Metadata> getMetadataCategories()
Returns the categories of metadata to read, write, patch, or search.
void setMetadataCategories(Set<DocumentManager.Metadata> categories)
Specifies the categories of metadata to read, write, patch, or search.
categories - the set of metadata categoriesvoid setMetadataCategories(DocumentManager.Metadata... categories)
Specifies the categories of metadata to read, write, patch, or search.
categories - the set of metadata categoriesvoid clearMetadataCategories()
Clears the metadata categories.
ServerTransform getReadTransform()
Returns the transform for read requests that don’t specify a transform.
void setReadTransform(ServerTransform transform)
Specifies a transform for read requests that don’t specify a transform.
transform - the name of the transformServerTransform getWriteTransform()
Returns the transform for write requests that don’t specify a transform.
void setWriteTransform(ServerTransform transform)
Specifies a transform for write requests that don’t specify a transform.
transform - the name of the transformvoid startLogging(RequestLogger logger)
Starts debugging client requests. You can suspend and resume debugging output using the methods of the logger.
logger - the logger that receives debugging outputvoid stopLogging()
Stops debugging client requests.
Copyright © 2013-2017 MarkLogic Corporation.