Expose readOnly status for MongoDocumentStore
@@ -230,7 +230,10 @@ public class MongoDocumentStore implements DocumentStore, RevisionListener {
private static final Key KEY_MODIFIED = new Key(MODIFIED_IN_SECS, null);
+ private final boolean readOnly;
+
public MongoDocumentStore(DB db, MongoDocumentNodeStoreBuilderBase<?> builder) {
+ this.readOnly = builder.getReadOnlyMode();
MongoStatus mongoStatus = builder.getMongoStatus();
if (mongoStatus == null) {
mongoStatus = new MongoStatus(db);
@@ -331,6 +334,10 @@ public class MongoDocumentStore implements DocumentStore, RevisionListener {
mongoStatus.getServerDetails());
}
+ public boolean isReadOnly() {
+ return readOnly;
+ }
+
@Override
public void finalize() throws Throwable {
super.finalize();
