This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MongoDbSpaceSynchronizationEndpoint extends SpaceSynchronizationEndpoint { | |
| private DB db = ... // MongoDB database object | |
| @Override | |
| public void onOperationsBatchSynchronization(final OperationsBatchData data) { | |
| // Get the MongoDB collection that will be used for persisting space documents | |
| DBCollection collection = db.getCollection("spaceDocuments"); | |
| // Persist each of the space documents in this batch | |
| for (DataSyncOperation operation : data.getBatchDataItems()) { | |
| // Handle only write operations which are document supported |