Interface RestDocumentState<T_DOCUMENT extends RestDocument>
-
- All Known Implementing Classes:
RestWebServiceDocumentState
public interface RestDocumentState<T_DOCUMENT extends RestDocument>An instance of
RestDocumentStaterepresents the internal state of aRestDocument, that has been uploaded to a webPDF server.The
RestDocumentStateallows aRestDocumentto access and publish the state, without violating the exclusive update rights of theDocumentManager.
(i.e. TheDocumentManagershall always be the only entity, that is allowed to change the internal state of an uploaded document.)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull HistoryEntryactiveHistory()Returns the currently activeHistoryEntry.@NotNull DocumentFilegetDocumentFile()Returns theDocumentFileof the managedRestDocument.@NotNull StringgetDocumentId()Returns the document ID of the managedRestDocument.@NotNull DocumentManager<T_DOCUMENT>getDocumentManager()Returns the owningDocumentManager.@NotNull List<HistoryEntry>getHistory()Returns theHistoryEntrys of the managedRestDocument.@NotNull HistoryEntrygetHistoryEntry(int historyId)Returns aHistoryEntryfrom the internal history map, by given history ID.intgetHistorySize()Returns the number of knownHistoryEntrys for thisRestWebServiceDocument.@NotNull HistoryEntrylastHistory()Returns the most recentHistoryEntry.voidsetDocumentFile(@NotNull DocumentFile documentFile)Sets theDocumentFileof the managedRestDocument.voidsetHistory(@NotNull HistoryEntry[] historyEntries)Replaces the internally storedHistoryEntrylist of the managedRestDocumentvoidupdateHistoryEntry(@NotNull HistoryEntry historyEntry)Updates the givenHistoryEntryin the internally managed document history.
-
-
-
Method Detail
-
getDocumentId
@NotNull @NotNull String getDocumentId()
Returns the document ID of the managedRestDocument.- Returns:
- The document ID of the managed
RestDocument.
-
getDocumentFile
@NotNull @NotNull DocumentFile getDocumentFile()
Returns theDocumentFileof the managedRestDocument.- Returns:
- The
DocumentFileof the managedRestDocument.
-
setDocumentFile
void setDocumentFile(@NotNull @NotNull DocumentFile documentFile)Sets theDocumentFileof the managedRestDocument.- Parameters:
documentFile- the newDocumentFileof the managedRestDocument.
-
getHistory
@NotNull @NotNull List<HistoryEntry> getHistory()
Returns theHistoryEntrys of the managedRestDocument.- Returns:
- The
HistoryEntrys of the managedRestDocument.
-
setHistory
void setHistory(@NotNull @NotNull HistoryEntry[] historyEntries) throws ResultExceptionReplaces the internally storedHistoryEntrylist of the managedRestDocument- Parameters:
historyEntries- The newHistoryEntrys to be set.- Throws:
ResultException- Shall be thrown, when updating the document history failed.
-
getHistoryEntry
@NotNull @NotNull HistoryEntry getHistoryEntry(int historyId) throws ResultException
Returns aHistoryEntryfrom the internal history map, by given history ID.- Parameters:
historyId- The history ID of theHistoryEntrythat shall be returned.- Returns:
- A
HistoryEntryrepresenting a historic state of the uploaded resource. - Throws:
ResultException- Shall be thrown, should accessing the document history fail.
-
updateHistoryEntry
void updateHistoryEntry(@NotNull @NotNull HistoryEntry historyEntry) throws ResultExceptionUpdates the givenHistoryEntryin the internally managed document history.- Parameters:
historyEntry- TheHistoryEntrycontaining the values to be set.- Throws:
ResultException- Shall be thrown, when updating the document history failed.
-
lastHistory
@NotNull @NotNull HistoryEntry lastHistory() throws ResultException
Returns the most recentHistoryEntry.- Returns:
- The most recent
HistoryEntry. - Throws:
ResultException- Shall be thrown, when updating the document history failed.
-
getHistorySize
int getHistorySize()
Returns the number of knownHistoryEntrys for thisRestWebServiceDocument.- Returns:
- The number of known
HistoryEntrys for thisRestWebServiceDocument.
-
activeHistory
@NotNull @NotNull HistoryEntry activeHistory() throws ResultException
Returns the currently activeHistoryEntry.- Returns:
- The currently active
HistoryEntry. - Throws:
ResultException- Shall be thrown, when updating the document history failed.
-
getDocumentManager
@NotNull @NotNull DocumentManager<T_DOCUMENT> getDocumentManager()
Returns the owningDocumentManager.- Returns:
- The owning
DocumentManager.
-
-