19
19
import com .marklogic .client .ForbiddenUserException ;
20
20
import com .marklogic .client .ResourceNotFoundException ;
21
21
import com .marklogic .client .Transaction ;
22
+ import com .marklogic .client .bitemporal .TemporalDescriptor ;
22
23
import com .marklogic .client .document .DocumentDescriptor ;
23
24
import com .marklogic .client .document .DocumentManager ;
24
25
import com .marklogic .client .document .DocumentUriTemplate ;
26
+ import com .marklogic .client .document .DocumentWriteSet ;
25
27
import com .marklogic .client .document .ServerTransform ;
26
28
import com .marklogic .client .io .marker .AbstractReadHandle ;
27
29
import com .marklogic .client .io .marker .AbstractWriteHandle ;
@@ -33,7 +35,7 @@ public interface TemporalDocumentManager<R extends AbstractReadHandle, W extends
33
35
* Just like {@link DocumentManager#create(DocumentUriTemplate, DocumentMetadataWriteHandle,
34
36
* AbstractWriteHandle, ServerTransform, Transaction) create} but create document
35
37
* 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 ">
37
39
* bitemporal data management</a>.
38
40
* @param template the template for constructing the document uri
39
41
* @param metadataHandle a handle for writing the metadata of the document
@@ -42,9 +44,10 @@ public interface TemporalDocumentManager<R extends AbstractReadHandle, W extends
42
44
* @param transaction an open transaction under which the document may have been created or deleted
43
45
* @param temporalCollection the name of the temporal collection existing in the database into
44
46
* 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
46
49
*/
47
- public DocumentDescriptor create (DocumentUriTemplate template ,
50
+ public TemporalDescriptor create (DocumentUriTemplate template ,
48
51
DocumentMetadataWriteHandle metadataHandle ,
49
52
W contentHandle ,
50
53
ServerTransform transform ,
@@ -56,7 +59,7 @@ public DocumentDescriptor create(DocumentUriTemplate template,
56
59
* Just like {@link DocumentManager#write(DocumentDescriptor, DocumentMetadataWriteHandle,
57
60
* AbstractWriteHandle, ServerTransform, Transaction) write} but write document
58
61
* 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 ">
60
63
* bitemporal data management</a>.
61
64
* @param desc a descriptor for the URI identifier, format, and mimetype of the document
62
65
* @param metadataHandle a handle for writing the metadata of the document
@@ -65,8 +68,9 @@ public DocumentDescriptor create(DocumentUriTemplate template,
65
68
* @param transaction an open transaction under which the document may have been created or deleted
66
69
* @param temporalCollection the name of the temporal collection existing in the database into
67
70
* which this document should be written
71
+ * @return the TemporalDescriptor with the temporal system time when the document was written
68
72
*/
69
- public void write (DocumentDescriptor desc ,
73
+ public TemporalDescriptor write (DocumentDescriptor desc ,
70
74
DocumentMetadataWriteHandle metadataHandle ,
71
75
W contentHandle ,
72
76
ServerTransform transform ,
@@ -78,7 +82,7 @@ public void write(DocumentDescriptor desc,
78
82
* Just like {@link DocumentManager#write(String, DocumentMetadataWriteHandle,
79
83
* AbstractWriteHandle, ServerTransform, Transaction) write} but write document
80
84
* 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 ">
82
86
* bitemporal data management</a>.
83
87
* @param docId the URI identifier for the document
84
88
* @param metadataHandle a handle for writing the metadata of the document
@@ -87,8 +91,9 @@ public void write(DocumentDescriptor desc,
87
91
* @param transaction an open transaction under which the document may have been created or deleted
88
92
* @param temporalCollection the name of the temporal collection existing in the database into
89
93
* which this document should be written
94
+ * @return the TemporalDescriptor with the temporal system time when the document was written
90
95
*/
91
- public void write (String docId ,
96
+ public TemporalDescriptor write (String docId ,
92
97
DocumentMetadataWriteHandle metadataHandle ,
93
98
W contentHandle ,
94
99
ServerTransform transform ,
@@ -99,29 +104,31 @@ public void write(String docId,
99
104
/**
100
105
* Just like {@link DocumentManager#delete(DocumentDescriptor, Transaction) delete} but delete
101
106
* 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 ">
103
108
* bitemporal data management</a>.
104
109
* @param desc a descriptor for the URI identifier, format, and mimetype of the document
105
110
* @param transaction an open transaction under which the document may have been created or deleted
106
111
* @param temporalCollection the name of the temporal collection existing in the database in
107
112
* which this document should be marked as deleted
113
+ * @return the TemporalDescriptor with the temporal system time when the document was deleted
108
114
*/
109
- public void delete (DocumentDescriptor desc ,
115
+ public TemporalDescriptor delete (DocumentDescriptor desc ,
110
116
Transaction transaction ,
111
117
String temporalCollection )
112
118
throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException ;
113
119
114
120
/**
115
121
* Just like {@link DocumentManager#delete(String, Transaction) delete} but delete
116
122
* 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 ">
118
124
* bitemporal data management</a>.
119
125
* @param docId the URI identifier for the document
120
126
* @param transaction an open transaction under which the document may have been created or deleted
121
127
* @param temporalCollection the name of the temporal collection existing in the database in
122
128
* which this document should be marked as deleted
129
+ * @return the TemporalDescriptor with the temporal system time when the document was deleted
123
130
*/
124
- public void delete (String docId ,
131
+ public TemporalDescriptor delete (String docId ,
125
132
Transaction transaction ,
126
133
String temporalCollection )
127
134
throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException ;
@@ -139,9 +146,10 @@ public void delete(String docId,
139
146
* @param temporalCollection the name of the temporal collection existing in the database into
140
147
* which this document should be written
141
148
* @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
143
151
*/
144
- public DocumentDescriptor create (DocumentUriTemplate template ,
152
+ public TemporalDescriptor create (DocumentUriTemplate template ,
145
153
DocumentMetadataWriteHandle metadataHandle ,
146
154
W contentHandle ,
147
155
ServerTransform transform ,
@@ -162,8 +170,9 @@ public DocumentDescriptor create(DocumentUriTemplate template,
162
170
* @param temporalCollection the name of the temporal collection existing in the database into
163
171
* which this document should be written
164
172
* @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
165
174
*/
166
- public void write (DocumentDescriptor desc ,
175
+ public TemporalDescriptor write (DocumentDescriptor desc ,
167
176
DocumentMetadataWriteHandle metadataHandle ,
168
177
W contentHandle ,
169
178
ServerTransform transform ,
@@ -184,8 +193,9 @@ public void write(DocumentDescriptor desc,
184
193
* @param temporalCollection the name of the temporal collection existing in the database into
185
194
* which this document should be written
186
195
* @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
187
197
*/
188
- public void write (String docId ,
198
+ public TemporalDescriptor write (String docId ,
189
199
DocumentMetadataWriteHandle metadataHandle ,
190
200
W contentHandle ,
191
201
ServerTransform transform ,
@@ -194,6 +204,25 @@ public void write(String docId,
194
204
java .util .Calendar systemTime )
195
205
throws ResourceNotFoundException , ForbiddenUserException , FailedRequestException ;
196
206
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
+
197
226
/**
198
227
* Just like {@link #delete(DocumentDescriptor, Transaction, String) delete} but delete
199
228
* document at a specified system time
@@ -202,8 +231,9 @@ public void write(String docId,
202
231
* @param temporalCollection the name of the temporal collection existing in the database in
203
232
* which this document should be marked as deleted
204
233
* @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
205
235
*/
206
- public void delete (DocumentDescriptor desc ,
236
+ public TemporalDescriptor delete (DocumentDescriptor desc ,
207
237
Transaction transaction ,
208
238
String temporalCollection ,
209
239
java .util .Calendar systemTime )
@@ -217,8 +247,9 @@ public void delete(DocumentDescriptor desc,
217
247
* @param temporalCollection the name of the temporal collection existing in the database in
218
248
* which this document should be marked as deleted
219
249
* @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
220
251
*/
221
- public void delete (String docId ,
252
+ public TemporalDescriptor delete (String docId ,
222
253
Transaction transaction ,
223
254
String temporalCollection ,
224
255
java .util .Calendar systemTime )
0 commit comments