Package org.waveprotocol.box.server.persistence.mongodb

Examples of org.waveprotocol.box.server.persistence.mongodb.MongoDbProvider


  /**
   * Returns a {@link MongoDbProvider} instance.
   */
  public MongoDbProvider getMongoDbProvider() {
    if (mongoDbProvider == null) {
      mongoDbProvider = new MongoDbProvider(mongoDBHost, mongoDBPort, mongoDBdatabase);
    }
    return mongoDbProvider;
  }
View Full Code Here


    if (signerInfoStoreType.equalsIgnoreCase("memory")) {
      bind(CertPathStore.class).to(MemoryStore.class).in(Singleton.class);
    } else if (signerInfoStoreType.equalsIgnoreCase("file")) {
      bind(CertPathStore.class).to(FileSignerInfoStore.class).in(Singleton.class);
    } else if (signerInfoStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(CertPathStore.class).toInstance(mongoDbProvider.provideMongoDbStore());
    } else {
      throw new RuntimeException(
          "Invalid certificate path store type: '" + signerInfoStoreType + "'");
    }
  }
View Full Code Here

  private void bindAttachmentStore() {
    if (attachmentStoreType.equalsIgnoreCase("disk")) {
      bind(AttachmentStore.class).to(FileAttachmentStore.class).in(Singleton.class);
    } else if (attachmentStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(AttachmentStore.class).toInstance(mongoDbProvider.provideMongoDbStore());
    } else {
      throw new RuntimeException("Invalid attachment store type: '" + attachmentStoreType + "'");
    }
  }
View Full Code Here

    } else if (accountStoreType.equalsIgnoreCase("file")) {
      bind(AccountStore.class).to(FileAccountStore.class).in(Singleton.class);
    } else if (accountStoreType.equalsIgnoreCase("fake")) {
      bind(AccountStore.class).to(FakePermissiveAccountStore.class).in(Singleton.class);
    } else if (accountStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(AccountStore.class).toInstance(mongoDbProvider.provideMongoDbStore());
    } else {
      throw new RuntimeException("Invalid account store type: '" + accountStoreType + "'");
    }
  }
View Full Code Here

    if (deltaStoreType.equalsIgnoreCase("memory")) {
      bind(DeltaStore.class).to(MemoryDeltaStore.class).in(Singleton.class);
    } else if (deltaStoreType.equalsIgnoreCase("file")) {
      bind(DeltaStore.class).to(FileDeltaStore.class).in(Singleton.class);
    } else if (deltaStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(DeltaStore.class).toInstance(mongoDbProvider.provideMongoDbDeltaStore());
    } else {
      throw new RuntimeException("Invalid delta store type: '" + deltaStoreType + "'");
    }
  }
View Full Code Here

  /**
   * Returns a {@link MongoDbProvider} instance.
   */
  public MongoDbProvider getMongoDbProvider() {
    if (mongoDbProvider == null) {
      mongoDbProvider = new MongoDbProvider();
    }
    return mongoDbProvider;
  }
View Full Code Here

    if (signerInfoStoreType.equalsIgnoreCase("memory")) {
      bind(CertPathStore.class).to(MemoryStore.class).in(Singleton.class);
    } else if (signerInfoStoreType.equalsIgnoreCase("file")) {
      bind(CertPathStore.class).to(FileSignerInfoStore.class).in(Singleton.class);
    } else if (signerInfoStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(CertPathStore.class).toInstance(mongoDbProvider.provideMongoDbStore());
    } else {
      throw new RuntimeException(
          "Invalid certificate path store type: '" + signerInfoStoreType + "'");
    }
  }
View Full Code Here

  private void bindAttachmentStore() {
    if (attachmentStoreType.equalsIgnoreCase("disk")) {
      bind(AttachmentStore.class).to(FileAttachmentStore.class).in(Singleton.class);
    } else if (attachmentStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(AttachmentStore.class).toInstance(mongoDbProvider.provideMongoDbStore());
    } else {
      throw new RuntimeException("Invalid attachment store type: '" + attachmentStoreType + "'");
    }
  }
View Full Code Here

    } else if (accountStoreType.equalsIgnoreCase("file")) {
      bind(AccountStore.class).to(FileAccountStore.class).in(Singleton.class);
    } else if (accountStoreType.equalsIgnoreCase("fake")) {
      bind(AccountStore.class).to(FakePermissiveAccountStore.class).in(Singleton.class);
    } else if (accountStoreType.equalsIgnoreCase("mongodb")) {
      MongoDbProvider mongoDbProvider = getMongoDbProvider();
      bind(AccountStore.class).toInstance(mongoDbProvider.provideMongoDbStore());
    } else {
      throw new RuntimeException("Invalid account store type: '" + accountStoreType + "'");
    }
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.server.persistence.mongodb.MongoDbProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.