Add getters for collection and mode in MongoItemWriter

Resolves #3973
This commit is contained in:
Santiago Molano
2021-08-15 13:11:33 -05:00
committed by Mahmoud Ben Hassine
parent 83b2a2adf9
commit 5e515473de

View File

@@ -121,6 +121,15 @@ public class MongoItemWriter<T> implements ItemWriter<T>, InitializingBean {
this.mode = mode;
}
/**
* Get the operating {@link Mode} of the item writer.
* @return the operating mode
* @since 5.1
*/
public Mode getMode() {
return mode;
}
/**
* Set the {@link MongoOperations} to be used to save items to be written.
* @param template the template implementation to be used.
@@ -146,6 +155,15 @@ public class MongoItemWriter<T> implements ItemWriter<T>, InitializingBean {
this.collection = collection;
}
/**
* Get the Mongo collection name.
* @return the collection name
* @since 5.1
*/
public String getCollection() {
return collection;
}
/**
* If a transaction is active, buffer items to be written just before commit.
* Otherwise write items using the provided template.