Interface DocumentManager<T_REST_DOCUMENT extends RestDocument>
-
- Type Parameters:
T_REST_DOCUMENT- TheRestDocumenttype managed by theDocumentManager.
- All Known Implementing Classes:
AbstractDocumentManager,RestWebServiceDocumentManager
public interface DocumentManager<T_REST_DOCUMENT extends RestDocument>A class implementingDocumentManagerallows to monitor and interact with theRestDocuments uploaded to aRestSessionof the webPDF server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description T_REST_DOCUMENTcompressDocuments(@NotNull DocumentFileCompress fileCompress)Compresses a list ofRestDocuments selected by documentId or file filter into a new archive document in the document storage.booleancontainsDocument(@NotNull String documentId)voiddeleteDocument(@NotNull String documentId)Deletes theRestDocumentwith the given document ID from the webPDF server.voiddownloadDocument(@NotNull String documentId, @NotNull OutputStream outputStream)Downloads theRestDocumentwith the given document ID and writes it to the givenOutputStream.voiddownloadDocument(@Nullable RestDocument document, @NotNull OutputStream outputStream)Deprecated.@NotNull List<T_REST_DOCUMENT>extractDocument(@NotNull String documentId, @NotNull DocumentFileExtract fileExtract)Extracts theRestDocumentwith the given document ID in the document storage.T_REST_DOCUMENTgetDocument(@NotNull String documentId)Returns theRestDocumentthat is known to theDocumentManagerfor the given document ID.@NotNull List<HistoryEntry>getDocumentHistory(@NotNull String documentId)Returns theHistoryEntrys known for theRestDocumentwith the given document ID.@NotNull HistoryEntrygetDocumentHistoryEntry(@NotNull String documentId, int historyId)Returns theHistoryEntrywith the given history ID for theRestDocumentwith the given document ID.@NotNull StringgetDocumentID(@NotNull DocumentFile document)Returns the document ID the givenDocumentFileis known by to thisDocumentManager.@NotNull DocumentInfogetDocumentInfo(@NotNull String documentId, @NotNull DocumentInfoType infoType)Returns information about the document selected by documentId in the document storage.@NotNull List<T_REST_DOCUMENT>getDocuments()Returns a list of allRestDocuments known to thisDocumentManager.@NotNull RestSession<T_REST_DOCUMENT>getSession()booleanisDocumentHistoryActive()Checks whether a document history is collected for managedRestDocuments.T_REST_DOCUMENTrenameDocument(@NotNull String documentId, @NotNull String fileName)Rename theRestDocumentwith the given document ID.voidsetDocumentHistoryActive(boolean documentHistoryActive)Sets whether a document history shall be collected for managedRestDocuments.@NotNull List<T_REST_DOCUMENT>synchronize()Synchronizes theRestDocuments of thisDocumentManagerwith the actually uploaded documents of the webPDF server.@NotNull List<T_REST_DOCUMENT>synchronize(@NotNull List<DocumentFile> fileList)Synchronizes theRestDocuments of thisDocumentManagerwith the actually uploaded documents of the webPDF server or with the given fileList.T_REST_DOCUMENTsynchronizeDocument(@NotNull DocumentFile documentFile)@Nullable HistoryEntryupdateDocumentHistory(@NotNull String documentId, @NotNull HistoryEntry historyEntry)Updates the history of theRestDocumentwith the given document ID using the givenHistoryEntry.T_REST_DOCUMENTupdateDocumentSecurity(@NotNull String documentId, @NotNull PdfPasswordType passwordType)Updates the security information of a selected document in the server´s document storage.T_REST_DOCUMENTuploadDocument(@NotNull File file)Uploads the givenFileto the webPDF server, adds it to thisDocumentManagerand returns the resultingRestDocumenthandle.T_REST_DOCUMENTuploadDocument(@NotNull InputStream data, @NotNull String fileName)Uploads the givenInputStreamto the webPDF server as a document resource with the given file name, adds it to thisDocumentManagerand returns the resultingRestDocumenthandle.
-
-
-
Method Detail
-
getSession
@NotNull @NotNull RestSession<T_REST_DOCUMENT> getSession()
- Returns:
- The
RestSessiontheDocumentManageris managingRestDocuments for.
-
synchronizeDocument
@NotNull T_REST_DOCUMENT synchronizeDocument(@NotNull @NotNull DocumentFile documentFile) throws ResultException
- Returns:
- The synchronized
RestDocument. - Throws:
ResultException- Shall be thrown upon a synchronization failure.
-
synchronize
@NotNull @NotNull List<T_REST_DOCUMENT> synchronize(@NotNull @NotNull List<DocumentFile> fileList) throws ResultException
Synchronizes theRestDocuments of thisDocumentManagerwith the actually uploaded documents of the webPDF server or with the given fileList.- Parameters:
fileList- ADocumentFilelist to sync thisDocumentManagerwith- Returns:
- A list of the synchronized
RestDocuments. - Throws:
ResultException- Shall be thrown upon a synchronization failure.
-
synchronize
@NotNull @NotNull List<T_REST_DOCUMENT> synchronize() throws ResultException
Synchronizes theRestDocuments of thisDocumentManagerwith the actually uploaded documents of the webPDF server.- Returns:
- A list of the synchronized
RestDocuments. - Throws:
ResultException- Shall be thrown upon a synchronization failure.
-
getDocumentID
@NotNull @NotNull String getDocumentID(@NotNull @NotNull DocumentFile document) throws ResultException
Returns the document ID the givenDocumentFileis known by to thisDocumentManager.- Parameters:
document- TheDocumentFilea document ID shall be found for.- Returns:
- The document ID mapped to the given
DocumentFile. - Throws:
ResultException- Shall be thrown, if requesting the document ID failed.
-
getDocument
@NotNull T_REST_DOCUMENT getDocument(@NotNull @NotNull String documentId) throws ResultException
Returns theRestDocumentthat is known to theDocumentManagerfor the given document ID.- Parameters:
documentId- The document ID aRestDocumentshall be found for.- Returns:
- The
RestDocumentmapped to the given document ID. - Throws:
ResultException- Shall be thrown, if requesting the document failed.
-
getDocuments
@NotNull @NotNull List<T_REST_DOCUMENT> getDocuments()
Returns a list of allRestDocuments known to thisDocumentManager.- Returns:
- A list of all
RestDocuments known to thisDocumentManager.
-
containsDocument
boolean containsDocument(@NotNull @NotNull String documentId)- Parameters:
documentId- The document ID, that shall be checked for existence.- Returns:
true, if thisDocumentManagercontains aRestDocumentwith the given ID.
-
downloadDocument
void downloadDocument(@NotNull @NotNull String documentId, @NotNull @NotNull OutputStream outputStream) throws ResultExceptionDownloads theRestDocumentwith the given document ID and writes it to the givenOutputStream.- Parameters:
documentId- The document ID of theRestDocumentto download.outputStream- TheOutputStreamto write the downloadedRestDocumentto.- Throws:
ResultException- Shall be thrown, should the download have failed.
-
downloadDocument
@Deprecated void downloadDocument(@Nullable @Nullable RestDocument document, @NotNull @NotNull OutputStream outputStream) throws ResultException
Deprecated.Downloads theRestDocumentand writes it to the givenOutputStream.- Parameters:
document- TheRestDocumentto download.outputStream- TheOutputStreamto write the downloadedRestDocumentto.- Throws:
ResultException- Shall be thrown, should the download have failed.
-
uploadDocument
@NotNull T_REST_DOCUMENT uploadDocument(@NotNull @NotNull File file) throws ResultException
Uploads the givenFileto the webPDF server, adds it to thisDocumentManagerand returns the resultingRestDocumenthandle.- Parameters:
file- TheFileto upload.- Returns:
- The resulting
RestDocumenthandle. - Throws:
ResultException- Shall be thrown, should the upload have failed.
-
uploadDocument
@NotNull T_REST_DOCUMENT uploadDocument(@NotNull @NotNull InputStream data, @NotNull @NotNull String fileName) throws ResultException
Uploads the givenInputStreamto the webPDF server as a document resource with the given file name, adds it to thisDocumentManagerand returns the resultingRestDocumenthandle.- Parameters:
data- The documentInputStreamto upload.fileName- The name of the uploaded document.- Returns:
- The resulting
RestDocumenthandle. - Throws:
ResultException- Shall be thrown, should the upload have failed.
-
deleteDocument
void deleteDocument(@NotNull @NotNull String documentId) throws ResultExceptionDeletes theRestDocumentwith the given document ID from the webPDF server.- Parameters:
documentId- The document ID of theRestDocumentto delete.- Throws:
ResultException- Shall be thrown, should deleting the document have failed.
-
renameDocument
@NotNull T_REST_DOCUMENT renameDocument(@NotNull @NotNull String documentId, @NotNull @NotNull String fileName) throws ResultException
Rename theRestDocumentwith the given document ID.- Parameters:
documentId- The document ID of theRestDocumentto rename.fileName- The new name for theRestDocument.- Returns:
- The resulting
RestDocumenthandle. - Throws:
ResultException- Shall be thrown, should renaming the document have failed.
-
isDocumentHistoryActive
boolean isDocumentHistoryActive()
Checks whether a document history is collected for managedRestDocuments.- Returns:
trueshould collecting the document history be active.
-
setDocumentHistoryActive
void setDocumentHistoryActive(boolean documentHistoryActive) throws ResultExceptionSets whether a document history shall be collected for managedRestDocuments.- Parameters:
documentHistoryActive-trueshould collecting the document history be activated.- Throws:
ResultException
-
getDocumentHistory
@NotNull @NotNull List<HistoryEntry> getDocumentHistory(@NotNull @NotNull String documentId) throws ResultException
Returns theHistoryEntrys known for theRestDocumentwith the given document ID.- Parameters:
documentId- The document ID of theRestDocumentthe history shall be requested for.- Returns:
- The
HistoryEntrys known for the selectedRestDocument. - Throws:
ResultException- Shall be thrown, should requesting the document history have failed.
-
getDocumentHistoryEntry
@NotNull @NotNull HistoryEntry getDocumentHistoryEntry(@NotNull @NotNull String documentId, int historyId) throws ResultException
Returns theHistoryEntrywith the given history ID for theRestDocumentwith the given document ID.- Parameters:
documentId- The document ID of theRestDocumenttheHistoryEntryshall be requested for.historyId- The history ID of theHistoryEntry, that shall be requested.- Returns:
- The selected
HistoryEntry. - Throws:
ResultException- Shall be thrown, should requesting the document history have failed.
-
updateDocumentHistory
@Nullable @Nullable HistoryEntry updateDocumentHistory(@NotNull @NotNull String documentId, @NotNull @NotNull HistoryEntry historyEntry) throws ResultException
Updates the history of theRestDocumentwith the given document ID using the givenHistoryEntry.- Parameters:
documentId- The document ID of theRestDocumentto update.historyEntry- TheHistoryEntryto update the contained values for.- Returns:
- The updated
HistoryEntry. - Throws:
ResultException- Shall be thrown, should updating the document history have failed.
-
updateDocumentSecurity
@NotNull T_REST_DOCUMENT updateDocumentSecurity(@NotNull @NotNull String documentId, @NotNull @NotNull PdfPasswordType passwordType) throws ResultException
Updates the security information of a selected document in the server´s document storage.- Parameters:
documentId- The unique documentId of the document in the server´s document storage.passwordType- The security information to update the document with- Returns:
- The updated
RestDocument. - Throws:
ResultException- Shall be thrown, should updating the document security have failed.
-
getDocumentInfo
@NotNull @NotNull DocumentInfo getDocumentInfo(@NotNull @NotNull String documentId, @NotNull @NotNull DocumentInfoType infoType) throws ResultException
Returns information about the document selected by documentId in the document storage.- Parameters:
documentId- The unique documentId of the document in the server´s document storage.infoType- Detailed information for the document referenced by the unique documentId in the server´s document storage.- Returns:
- The requested document
DocumentInfo - Throws:
ResultException- Shall be thrown, should fetching the document info have failed.
-
extractDocument
@NotNull @NotNull List<T_REST_DOCUMENT> extractDocument(@NotNull @NotNull String documentId, @NotNull @NotNull DocumentFileExtract fileExtract) throws ResultException
Extracts the
RestDocumentwith the given document ID in the document storage.- The document referenced by documentId must be a valid archive. If not, the operation will be aborted.
- For each file in the archive, a new DocumentFile is created in the document storage with a new documentId.
- Each newly created DocumentFile holds as parentDocumentId the documentId of the archive.
- Parameters:
documentId- The document ID of theRestDocumentto extract.fileExtract-DocumentFileExtractsettings for unpacking the archive document.- Returns:
- A list of the extracted
RestDocuments. - Throws:
ResultException- Shall be thrown, should the extraction has failed.
-
compressDocuments
@NotNull T_REST_DOCUMENT compressDocuments(@NotNull @NotNull DocumentFileCompress fileCompress) throws ResultException
Compresses a list of
RestDocuments selected by documentId or file filter into a new archive document in the document storage.- The list of documents that should be in the archive are selected via the documentId or a file filter.
- The selection specifications can be made individually or together and act additively in the order documentId and then file filter.
- If the id is invalid for documents selected via documentId or documents are locked, then the call is aborted with an error.
- The created archive is stored as a new document with a new documentId in the document storage.
- Parameters:
fileCompress- TheDocumentFileCompresssettings for creating the archive document and for selecting and filtering the documents to be added to the archive.- Returns:
- The compressed
RestDocument. - Throws:
ResultException- Shall be thrown, should the compression have failed.
-
-