1919import com .marklogic .client .ForbiddenUserException ;
2020import com .marklogic .client .ResourceNotFoundException ;
2121import com .marklogic .client .Transaction ;
22+ import com .marklogic .client .bitemporal .TemporalDescriptor ;
2223import com .marklogic .client .document .DocumentDescriptor ;
2324import com .marklogic .client .document .DocumentManager ;
2425import com .marklogic .client .document .DocumentUriTemplate ;
26+ import com .marklogic .client .document .DocumentWriteSet ;
2527import com .marklogic .client .document .ServerTransform ;
2628import com .marklogic .client .io .marker .AbstractReadHandle ;
2729import com .marklogic .client .io .marker .AbstractWriteHandle ;
@@ -33,7 +35,7 @@ public interface TemporalDocumentManager<R extends AbstractReadHandle, W extends
3335 * Just like {@link DocumentManager#create(DocumentUriTemplate, DocumentMetadataWriteHandle,
3436 * AbstractWriteHandle, ServerTransform, Transaction) create} but create document
3537 * in a temporalCollection, which will enforce all the rules of
36- * <a href="http://docs.marklogic.com/8.0/ guide/concepts/data-management#id_98803 ">
38+ * <a href="http://docs.marklogic.com/guide/temporal/managing ">
3739 * bitemporal data management</a>.
3840 * @param template the template for constructing the document uri
3941 * @param metadataHandle a handle for writing the metadata of the document
@@ -42,9 +44,10 @@ public interface TemporalDocumentManager<R extends AbstractReadHandle, W extends
4244 * @param transaction an open transaction under which the document may have been created or deleted
4345 * @param temporalCollection the name of the temporal collection existing in the database into
4446 * which this document should be written
45- * @return the database uri that identifies the created document
47+ * @return the TemporalDescriptor including the database uri that identifies the created document,
48+ * as well as the temporal system time when the document was created
4649 */
47- public DocumentDescriptor create (DocumentUriTemplate template ,
50+ public TemporalDescriptor create (DocumentUriTemplate template ,
4851 DocumentMetadataWriteHandle metadataHandle ,
4952 W contentHandle ,
5053 ServerTransform transform ,
@@ -56,7 +59,7 @@ public DocumentDescriptor create(DocumentUriTemplate template,
5659 * Just like {@link DocumentManager#write(DocumentDescriptor, DocumentMetadataWriteHandle,
5760 * AbstractWriteHandle, ServerTransform, Transaction) write} but write document
5861 * in a temporalCollection, which will enforce all the rules of
59- * <a href="http://docs.marklogic.com/8.0/ guide/concepts/data-management#id_98803 ">
62+ * <a href="http://docs.marklogic.com/guide/temporal/managing ">
6063 * bitemporal data management</a>.
6164 * @param desc a descriptor for the URI identifier, format, and mimetype of the document
6265 * @param metadataHandle a handle for writing the metadata of the document
@@ -65,8 +68,9 @@ public DocumentDescriptor create(DocumentUriTemplate template,
6568 * @param transaction an open transaction under which the document may have been created or deleted
6669 * @param temporalCollection the name of the temporal collection existing in the database into
6770 * which this document should be written
71+ * @return the TemporalDescriptor with the temporal system time when the document was written
6872 */
69- public void write (DocumentDescriptor desc ,
73+ public TemporalDescriptor write (DocumentDescriptor desc ,
7074 DocumentMetadataWriteHandle metadataHandle ,
7175 W contentHandle ,
7276 ServerTransform transform ,
@@ -78,7 +82,7 @@ public void write(DocumentDescriptor desc,
7882 * Just like {@link DocumentManager#write(String, DocumentMetadataWriteHandle,
7983 * AbstractWriteHandle, ServerTransform, Transaction) write} but write document
8084 * in a temporalCollection, which will enforce all the rules of
81- * <a href="http://docs.marklogic.com/8.0/ guide/concepts/data-management#id_98803 ">
85+ * <a href="http://docs.marklogic.com/guide/temporal/managing ">
8286 * bitemporal data management</a>.
8387 * @param docId the URI identifier for the document
8488 * @param metadataHandle a handle for writing the metadata of the document
@@ -87,8 +91,9 @@ public void write(DocumentDescriptor desc,
8791 * @param transaction an open transaction under which the document may have been created or deleted
8892 * @param temporalCollection the name of the temporal collection existing in the database into
8993 * which this document should be written
94+ * @return the TemporalDescriptor with the temporal system time when the document was written
9095 */
91- public void write (String docId ,
96+ public TemporalDescriptor write (String docId ,
9297 DocumentMetadataWriteHandle metadataHandle ,
9398 W contentHandle ,
9499 ServerTransform transform ,
@@ -99,29 +104,31 @@ public void write(String docId,
99104 /**
100105 * Just like {@link DocumentManager#delete(DocumentDescriptor, Transaction) delete} but delete
101106 * document in a temporalCollection, which will enforce all the rules of
102- * <a href="http://docs.marklogic.com/8.0/ guide/concepts/data-management#id_98803 ">
107+ * <a href="http://docs.marklogic.com/guide/temporal/managing ">
103108 * bitemporal data management</a>.
104109 * @param desc a descriptor for the URI identifier, format, and mimetype of the document
105110 * @param transaction an open transaction under which the document may have been created or deleted
106111 * @param temporalCollection the name of the temporal collection existing in the database in
107112 * which this document should be marked as deleted
113+ * @return the TemporalDescriptor with the temporal system time when the document was deleted
108114 */
109- public void delete (DocumentDescriptor desc ,
115+ public TemporalDescriptor delete (DocumentDescriptor desc ,
110116 Transaction transaction ,
111117 String temporalCollection )
112118 throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException ;
113119
114120 /**
115121 * Just like {@link DocumentManager#delete(String, Transaction) delete} but delete
116122 * document in a temporalCollection, which will enforce all the rules of
117- * <a href="http://docs.marklogic.com/8.0/ guide/concepts/data-management#id_98803 ">
123+ * <a href="http://docs.marklogic.com/guide/temporal/managing ">
118124 * bitemporal data management</a>.
119125 * @param docId the URI identifier for the document
120126 * @param transaction an open transaction under which the document may have been created or deleted
121127 * @param temporalCollection the name of the temporal collection existing in the database in
122128 * which this document should be marked as deleted
129+ * @return the TemporalDescriptor with the temporal system time when the document was deleted
123130 */
124- public void delete (String docId ,
131+ public TemporalDescriptor delete (String docId ,
125132 Transaction transaction ,
126133 String temporalCollection )
127134 throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException ;
@@ -139,9 +146,10 @@ public void delete(String docId,
139146 * @param temporalCollection the name of the temporal collection existing in the database into
140147 * which this document should be written
141148 * @param systemTime the application-specified system time with which this document will be marked
142- * @return the database uri that identifies the created document
149+ * @return the database uri that identifies the created document,
150+ * as well as the temporal system time when the document was created
143151 */
144- public DocumentDescriptor create (DocumentUriTemplate template ,
152+ public TemporalDescriptor create (DocumentUriTemplate template ,
145153 DocumentMetadataWriteHandle metadataHandle ,
146154 W contentHandle ,
147155 ServerTransform transform ,
@@ -162,8 +170,9 @@ public DocumentDescriptor create(DocumentUriTemplate template,
162170 * @param temporalCollection the name of the temporal collection existing in the database into
163171 * which this document should be written
164172 * @param systemTime the application-specified system time with which this document will be marked
173+ * @return the TemporalDescriptor with the temporal system time when the document was written
165174 */
166- public void write (DocumentDescriptor desc ,
175+ public TemporalDescriptor write (DocumentDescriptor desc ,
167176 DocumentMetadataWriteHandle metadataHandle ,
168177 W contentHandle ,
169178 ServerTransform transform ,
@@ -184,8 +193,9 @@ public void write(DocumentDescriptor desc,
184193 * @param temporalCollection the name of the temporal collection existing in the database into
185194 * which this document should be written
186195 * @param systemTime the application-specified system time with which this document will be marked
196+ * @return the TemporalDescriptor with the temporal system time when the document was written
187197 */
188- public void write (String docId ,
198+ public TemporalDescriptor write (String docId ,
189199 DocumentMetadataWriteHandle metadataHandle ,
190200 W contentHandle ,
191201 ServerTransform transform ,
@@ -194,6 +204,25 @@ public void write(String docId,
194204 java .util .Calendar systemTime )
195205 throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException ;
196206
207+ /**
208+ * Just like {@link DocumentManager#write(DocumentWriteSet, ServerTransform, Transaction)
209+ * write} but create document in a temporalCollection, which will enforce all the rules of
210+ * <a href="http://docs.marklogic.com/guide/temporal/managing">
211+ * bitemporal data management</a>.
212+ * @param writeSet the set of documents and metadata to write
213+ * @param transform a server transform to modify the contents of each document
214+ * @param transaction an open transaction under which the documents will be written
215+ * @param temporalCollection the name of the temporal collection existing in the database into
216+ * which this document should be written
217+ * @see <a href="http://docs.marklogic.com/guide/rest-dev/bulk">REST API -> Reading
218+ * and Writing Multiple Documents</a>
219+ */
220+ // TODO: do we return something for the temporal system time? is it per-document?
221+ public void write (DocumentWriteSet writeSet ,
222+ ServerTransform transform ,
223+ Transaction transaction ,
224+ String temporalCollection );
225+
197226 /**
198227 * Just like {@link #delete(DocumentDescriptor, Transaction, String) delete} but delete
199228 * document at a specified system time
@@ -202,8 +231,9 @@ public void write(String docId,
202231 * @param temporalCollection the name of the temporal collection existing in the database in
203232 * which this document should be marked as deleted
204233 * @param systemTime the application-specified system time with which this document will be marked
234+ * @return the TemporalDescriptor with the temporal system time when the document was deleted
205235 */
206- public void delete (DocumentDescriptor desc ,
236+ public TemporalDescriptor delete (DocumentDescriptor desc ,
207237 Transaction transaction ,
208238 String temporalCollection ,
209239 java .util .Calendar systemTime )
@@ -217,8 +247,9 @@ public void delete(DocumentDescriptor desc,
217247 * @param temporalCollection the name of the temporal collection existing in the database in
218248 * which this document should be marked as deleted
219249 * @param systemTime the application-specified system time with which this document will be marked
250+ * @return the TemporalDescriptor with the temporal system time when the document was deleted
220251 */
221- public void delete (String docId ,
252+ public TemporalDescriptor delete (String docId ,
222253 Transaction transaction ,
223254 String temporalCollection ,
224255 java .util .Calendar systemTime )
0 commit comments