Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 9f5c536

Browse files
committed
#99 BatchHandler can be customized on RestBatchWriter
1 parent bfd1ff3 commit 9f5c536

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/main/java/com/marklogic/client/ext/batch/RestBatchWriter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public RestBatchWriter(List<DatabaseClient> databaseClients) {
3939
this.databaseClients = databaseClients;
4040
}
4141

42+
public RestBatchWriter(List<DatabaseClient> databaseClients, boolean releaseDatabaseClients, BatchHandler batchHandler) {
43+
this(databaseClients);
44+
this.releaseDatabaseClients = releaseDatabaseClients;
45+
this.batchHandler = batchHandler;
46+
}
47+
4248
@Override
4349
public void write(List<? extends DocumentWriteOperation> items) {
4450
initialize();
@@ -116,4 +122,8 @@ protected ServerTransform getServerTransform() {
116122
public void setContentFormat(Format contentFormat) {
117123
this.contentFormat = contentFormat;
118124
}
125+
126+
public void setBatchHandler(BatchHandler batchHandler) {
127+
this.batchHandler = batchHandler;
128+
}
119129
}

0 commit comments

Comments
 (0)