Skip to content

Commit

Permalink
OAK-7073 - Expose readOnly status for MongoDocumentStore
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1818533 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
chetanmeh committed Dec 18, 2017
1 parent eeeef64 commit 2f64407
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ enum DocumentReadPreference {

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);
Expand Down Expand Up @@ -331,6 +334,10 @@ public MongoDocumentStore(DB db, MongoDocumentNodeStoreBuilderBase<?> builder) {
mongoStatus.getServerDetails());
}

public boolean isReadOnly() {
return readOnly;
}

@Override
public void finalize() throws Throwable {
super.finalize();
Expand Down

0 comments on commit 2f64407

Please sign in to comment.