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 + "'"); } }
private void bindAccountStore() { if (accountStoreType.equalsIgnoreCase("memory")) { bind(AccountStore.class).to(MemoryStore.class).in(Singleton.class); } 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 + "'"); } }
/** * Binds the CertPathStore implementation to the store specified in the * properties. */ private void bindCertPathStore() { 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 + "'"); } }