Search in sources :

Example 1 with GroupModule

use of com.google.gerrit.server.group.GroupModule in project gerrit by GerritCodeReview.

the class BatchProgramModule method configure.

@SuppressWarnings("rawtypes")
@Override
protected void configure() {
    install(reviewDbModule);
    install(new DiffExecutorModule());
    install(new ReceiveCommitsExecutorModule());
    install(BatchUpdate.module());
    install(PatchListCacheImpl.module());
    // Plugins are not loaded and we're just running through each change
    // once, so don't worry about cache removal.
    bind(new TypeLiteral<DynamicSet<CacheRemovalListener>>() {
    }).toInstance(DynamicSet.<CacheRemovalListener>emptySet());
    bind(new TypeLiteral<DynamicMap<Cache<?, ?>>>() {
    }).toInstance(DynamicMap.<Cache<?, ?>>emptyMap());
    bind(new TypeLiteral<List<CommentLinkInfo>>() {
    }).toProvider(CommentLinkProvider.class).in(SINGLETON);
    bind(new TypeLiteral<DynamicMap<ChangeQueryProcessor.ChangeAttributeFactory>>() {
    }).toInstance(DynamicMap.<ChangeQueryProcessor.ChangeAttributeFactory>emptyMap());
    bind(String.class).annotatedWith(CanonicalWebUrl.class).toProvider(CanonicalWebUrlProvider.class);
    bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class).toProvider(DisableReverseDnsLookupProvider.class).in(SINGLETON);
    bind(Realm.class).to(FakeRealm.class);
    bind(IdentifiedUser.class).toProvider(Providers.<IdentifiedUser>of(null));
    bind(ReplacePatchSetSender.Factory.class).toProvider(Providers.<ReplacePatchSetSender.Factory>of(null));
    bind(CurrentUser.class).to(IdentifiedUser.class);
    factory(MergeUtil.Factory.class);
    factory(PatchSetInserter.Factory.class);
    factory(RebaseChangeOp.Factory.class);
    // As Reindex is a batch program, don't assume the index is available for
    // the change cache.
    bind(SearchingChangeCacheImpl.class).toProvider(Providers.<SearchingChangeCacheImpl>of(null));
    bind(new TypeLiteral<ImmutableSet<GroupReference>>() {
    }).annotatedWith(AdministrateServerGroups.class).toInstance(ImmutableSet.<GroupReference>of());
    bind(new TypeLiteral<Set<AccountGroup.UUID>>() {
    }).annotatedWith(GitUploadPackGroups.class).toInstance(Collections.<AccountGroup.UUID>emptySet());
    bind(new TypeLiteral<Set<AccountGroup.UUID>>() {
    }).annotatedWith(GitReceivePackGroups.class).toInstance(Collections.<AccountGroup.UUID>emptySet());
    install(new BatchGitModule());
    install(new DefaultPermissionBackendModule());
    install(new DefaultCacheFactory.Module());
    install(new ExternalIdModule());
    install(new GroupModule());
    install(new NoteDbModule(cfg));
    install(new PrologModule());
    install(AccountByEmailCacheImpl.module());
    install(AccountCacheImpl.module());
    install(GroupCacheImpl.module());
    install(GroupIncludeCacheImpl.module());
    install(ProjectCacheImpl.module());
    install(SectionSortCache.module());
    install(ChangeKindCacheImpl.module());
    install(MergeabilityCacheImpl.module());
    install(TagCache.module());
    factory(CapabilityCollection.Factory.class);
    factory(CapabilityControl.Factory.class);
    factory(ChangeData.Factory.class);
    factory(ProjectState.Factory.class);
    bind(ChangeJson.Factory.class).toProvider(Providers.<ChangeJson.Factory>of(null));
    bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
}
Also used : ImmutableSet(com.google.common.collect.ImmutableSet) Set(java.util.Set) DynamicSet(com.google.gerrit.extensions.registration.DynamicSet) CurrentUser(com.google.gerrit.server.CurrentUser) CapabilityControl(com.google.gerrit.server.account.CapabilityControl) NoteDbModule(com.google.gerrit.server.notedb.NoteDbModule) DefaultCacheFactory(com.google.gerrit.server.cache.h2.DefaultCacheFactory) AdministrateServerGroups(com.google.gerrit.server.config.AdministrateServerGroups) GroupModule(com.google.gerrit.server.group.GroupModule) CacheRemovalListener(com.google.gerrit.server.cache.CacheRemovalListener) TypeLiteral(com.google.inject.TypeLiteral) ImmutableSet(com.google.common.collect.ImmutableSet) GitUploadPackGroups(com.google.gerrit.server.config.GitUploadPackGroups) MergeUtil(com.google.gerrit.server.git.MergeUtil) List(java.util.List) DefaultPermissionBackendModule(com.google.gerrit.server.project.DefaultPermissionBackendModule) FakeRealm(com.google.gerrit.server.account.FakeRealm) Realm(com.google.gerrit.server.account.Realm) CommentLinkProvider(com.google.gerrit.server.project.CommentLinkProvider) SearchingChangeCacheImpl(com.google.gerrit.server.git.SearchingChangeCacheImpl) ChangeJson(com.google.gerrit.server.change.ChangeJson) GitReceivePackGroups(com.google.gerrit.server.config.GitReceivePackGroups) DisableReverseDnsLookupProvider(com.google.gerrit.server.config.DisableReverseDnsLookupProvider) PrologModule(com.google.gerrit.rules.PrologModule) CanonicalWebUrl(com.google.gerrit.server.config.CanonicalWebUrl) ChangeQueryProcessor(com.google.gerrit.server.query.change.ChangeQueryProcessor) DefaultCacheFactory(com.google.gerrit.server.cache.h2.DefaultCacheFactory) RebaseChangeOp(com.google.gerrit.server.change.RebaseChangeOp) CapabilityCollection(com.google.gerrit.server.account.CapabilityCollection) IdentifiedUser(com.google.gerrit.server.IdentifiedUser) ChangeData(com.google.gerrit.server.query.change.ChangeData) AccountVisibilityProvider(com.google.gerrit.server.account.AccountVisibilityProvider) AccountGroup(com.google.gerrit.reviewdb.client.AccountGroup) PatchSetInserter(com.google.gerrit.server.change.PatchSetInserter) ExternalIdModule(com.google.gerrit.server.account.externalids.ExternalIdModule) DiffExecutorModule(com.google.gerrit.server.patch.DiffExecutorModule) ProjectState(com.google.gerrit.server.project.ProjectState) ReceiveCommitsExecutorModule(com.google.gerrit.server.git.ReceiveCommitsExecutorModule) ReplacePatchSetSender(com.google.gerrit.server.mail.send.ReplacePatchSetSender) TagCache(com.google.gerrit.server.git.TagCache) SectionSortCache(com.google.gerrit.server.project.SectionSortCache) Cache(com.google.common.cache.Cache)

Example 2 with GroupModule

use of com.google.gerrit.server.group.GroupModule in project gerrit by GerritCodeReview.

the class GerritGlobalModule method configure.

@Override
protected void configure() {
    bind(EmailExpander.class).toProvider(EmailExpanderProvider.class).in(SINGLETON);
    bind(IdGenerator.class);
    bind(RulesCache.class);
    bind(BlameCache.class).to(BlameCacheImpl.class);
    bind(Sequences.class);
    install(authModule);
    install(AccountByEmailCacheImpl.module());
    install(AccountCacheImpl.module());
    install(BatchUpdate.module());
    install(ChangeKindCacheImpl.module());
    install(ConflictsCacheImpl.module());
    install(GroupCacheImpl.module());
    install(GroupIncludeCacheImpl.module());
    install(MergeabilityCacheImpl.module());
    install(PatchListCacheImpl.module());
    install(ProjectCacheImpl.module());
    install(SectionSortCache.module());
    install(SubmitStrategy.module());
    install(TagCache.module());
    install(OAuthTokenCache.module());
    install(new AccessControlModule());
    install(new CmdLineParserModule());
    install(new EmailModule());
    install(new ExternalIdModule());
    install(new GitModule());
    install(new GroupModule());
    install(new NoteDbModule(cfg));
    install(new PrologModule());
    install(new SshAddressesModule());
    install(ThreadLocalRequestContext.module());
    bind(AccountResolver.class);
    factory(AddReviewerSender.Factory.class);
    factory(DeleteReviewerSender.Factory.class);
    factory(AddKeySender.Factory.class);
    factory(CapabilityCollection.Factory.class);
    factory(CapabilityControl.Factory.class);
    factory(ChangeData.Factory.class);
    factory(ChangeJson.AssistedFactory.class);
    factory(CreateChangeSender.Factory.class);
    factory(GroupDetailFactory.Factory.class);
    factory(GroupMembers.Factory.class);
    factory(EmailMerge.Factory.class);
    factory(MergedSender.Factory.class);
    factory(MergeUtil.Factory.class);
    factory(PatchScriptFactory.Factory.class);
    factory(PluginUser.Factory.class);
    factory(ProjectNode.Factory.class);
    factory(ProjectState.Factory.class);
    factory(RegisterNewEmailSender.Factory.class);
    factory(ReplacePatchSetSender.Factory.class);
    factory(SetAssigneeSender.Factory.class);
    bind(PermissionCollection.Factory.class);
    bind(AccountVisibility.class).toProvider(AccountVisibilityProvider.class).in(SINGLETON);
    factory(ProjectOwnerGroupsProvider.Factory.class);
    bind(AuthBackend.class).to(UniversalAuthBackend.class).in(SINGLETON);
    DynamicSet.setOf(binder(), AuthBackend.class);
    bind(GroupControl.Factory.class).in(SINGLETON);
    bind(GroupControl.GenericFactory.class).in(SINGLETON);
    bind(FileTypeRegistry.class).to(MimeUtilFileTypeRegistry.class);
    bind(ToolsCatalog.class);
    bind(EventFactory.class);
    bind(TransferConfig.class);
    bind(GcConfig.class);
    bind(ChangeCleanupConfig.class);
    bind(ApprovalsUtil.class);
    bind(RuntimeInstance.class).toProvider(VelocityRuntimeProvider.class);
    bind(SoyTofu.class).annotatedWith(MailTemplates.class).toProvider(MailSoyTofuProvider.class);
    bind(FromAddressGenerator.class).toProvider(FromAddressGeneratorProvider.class).in(SINGLETON);
    bind(Boolean.class).annotatedWith(DisableReverseDnsLookup.class).toProvider(DisableReverseDnsLookupProvider.class).in(SINGLETON);
    bind(PatchSetInfoFactory.class);
    bind(IdentifiedUser.GenericFactory.class).in(SINGLETON);
    bind(AccountControl.Factory.class);
    install(new AuditModule());
    bind(UiActions.class);
    install(new com.google.gerrit.server.access.Module());
    install(new com.google.gerrit.server.account.Module());
    install(new com.google.gerrit.server.api.Module());
    install(new com.google.gerrit.server.change.Module());
    install(new com.google.gerrit.server.config.Module());
    install(new com.google.gerrit.server.group.Module());
    install(new com.google.gerrit.server.project.Module());
    bind(GitReferenceUpdated.class);
    DynamicMap.mapOf(binder(), new TypeLiteral<Cache<?, ?>>() {
    });
    DynamicSet.setOf(binder(), CacheRemovalListener.class);
    DynamicMap.mapOf(binder(), CapabilityDefinition.class);
    DynamicSet.setOf(binder(), GitReferenceUpdatedListener.class);
    DynamicSet.setOf(binder(), AssigneeChangedListener.class);
    DynamicSet.setOf(binder(), ChangeAbandonedListener.class);
    DynamicSet.setOf(binder(), CommentAddedListener.class);
    DynamicSet.setOf(binder(), DraftPublishedListener.class);
    DynamicSet.setOf(binder(), HashtagsEditedListener.class);
    DynamicSet.setOf(binder(), ChangeMergedListener.class);
    DynamicSet.setOf(binder(), ChangeRestoredListener.class);
    DynamicSet.setOf(binder(), ChangeRevertedListener.class);
    DynamicSet.setOf(binder(), ReviewerAddedListener.class);
    DynamicSet.setOf(binder(), ReviewerDeletedListener.class);
    DynamicSet.setOf(binder(), VoteDeletedListener.class);
    DynamicSet.setOf(binder(), RevisionCreatedListener.class);
    DynamicSet.setOf(binder(), TopicEditedListener.class);
    DynamicSet.setOf(binder(), AgreementSignupListener.class);
    DynamicSet.setOf(binder(), PluginEventListener.class);
    DynamicSet.setOf(binder(), ReceivePackInitializer.class);
    DynamicSet.setOf(binder(), PostReceiveHook.class);
    DynamicSet.setOf(binder(), PreUploadHook.class);
    DynamicSet.setOf(binder(), PostUploadHook.class);
    DynamicSet.setOf(binder(), AccountIndexedListener.class);
    DynamicSet.setOf(binder(), ChangeIndexedListener.class);
    DynamicSet.setOf(binder(), GroupIndexedListener.class);
    DynamicSet.setOf(binder(), NewProjectCreatedListener.class);
    DynamicSet.setOf(binder(), ProjectDeletedListener.class);
    DynamicSet.setOf(binder(), GarbageCollectorListener.class);
    DynamicSet.setOf(binder(), HeadUpdatedListener.class);
    DynamicSet.setOf(binder(), UsageDataPublishedListener.class);
    DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to(ReindexAfterRefUpdate.class);
    DynamicSet.bind(binder(), GitReferenceUpdatedListener.class).to(ProjectConfigEntry.UpdateChecker.class);
    DynamicSet.setOf(binder(), EventListener.class);
    DynamicSet.bind(binder(), EventListener.class).to(EventsMetrics.class);
    DynamicSet.setOf(binder(), UserScopedEventListener.class);
    DynamicSet.setOf(binder(), CommitValidationListener.class);
    DynamicSet.setOf(binder(), ChangeMessageModifier.class);
    DynamicSet.setOf(binder(), RefOperationValidationListener.class);
    DynamicSet.setOf(binder(), OnSubmitValidationListener.class);
    DynamicSet.setOf(binder(), MergeValidationListener.class);
    DynamicSet.setOf(binder(), ProjectCreationValidationListener.class);
    DynamicSet.setOf(binder(), GroupCreationValidationListener.class);
    DynamicSet.setOf(binder(), HashtagValidationListener.class);
    DynamicSet.setOf(binder(), OutgoingEmailValidationListener.class);
    DynamicItem.itemOf(binder(), AvatarProvider.class);
    DynamicSet.setOf(binder(), LifecycleListener.class);
    DynamicSet.setOf(binder(), TopMenu.class);
    DynamicSet.setOf(binder(), MessageOfTheDay.class);
    DynamicMap.mapOf(binder(), DownloadScheme.class);
    DynamicMap.mapOf(binder(), DownloadCommand.class);
    DynamicMap.mapOf(binder(), CloneCommand.class);
    DynamicMap.mapOf(binder(), ReviewerSuggestion.class);
    DynamicSet.setOf(binder(), ExternalIncludedIn.class);
    DynamicMap.mapOf(binder(), ProjectConfigEntry.class);
    DynamicSet.setOf(binder(), PatchSetWebLink.class);
    DynamicSet.setOf(binder(), ParentWebLink.class);
    DynamicSet.setOf(binder(), FileWebLink.class);
    DynamicSet.setOf(binder(), FileHistoryWebLink.class);
    DynamicSet.setOf(binder(), DiffWebLink.class);
    DynamicSet.setOf(binder(), ProjectWebLink.class);
    DynamicSet.setOf(binder(), BranchWebLink.class);
    DynamicMap.mapOf(binder(), OAuthLoginProvider.class);
    DynamicItem.itemOf(binder(), OAuthTokenEncrypter.class);
    DynamicSet.setOf(binder(), AccountExternalIdCreator.class);
    DynamicSet.setOf(binder(), WebUiPlugin.class);
    DynamicItem.itemOf(binder(), AccountPatchReviewStore.class);
    DynamicSet.setOf(binder(), AssigneeValidationListener.class);
    DynamicSet.setOf(binder(), ActionVisitor.class);
    DynamicMap.mapOf(binder(), MailFilter.class);
    bind(MailFilter.class).annotatedWith(Exports.named("ListMailFilter")).to(ListMailFilter.class);
    factory(UploadValidators.Factory.class);
    DynamicSet.setOf(binder(), UploadValidationListener.class);
    DynamicMap.mapOf(binder(), ChangeQueryBuilder.ChangeOperatorFactory.class);
    DynamicMap.mapOf(binder(), ChangeQueryBuilder.ChangeHasOperandFactory.class);
    DynamicMap.mapOf(binder(), ChangeQueryProcessor.ChangeAttributeFactory.class);
    install(new GitwebConfig.LegacyModule(cfg));
    bind(AnonymousUser.class);
    factory(AbandonOp.Factory.class);
    factory(RefOperationValidators.Factory.class);
    factory(OnSubmitValidators.Factory.class);
    factory(MergeValidators.Factory.class);
    factory(ProjectConfigValidator.Factory.class);
    factory(NotesBranchUtil.Factory.class);
    factory(ReplaceOp.Factory.class);
    factory(MergedByPushOp.Factory.class);
    factory(GitModules.Factory.class);
    factory(VersionedAuthorizedKeys.Factory.class);
    factory(MergeOp.Factory.class);
    bind(AccountManager.class);
    factory(ChangeUserName.Factory.class);
    bind(new TypeLiteral<List<CommentLinkInfo>>() {
    }).toProvider(CommentLinkProvider.class).in(SINGLETON);
    bind(ReloadPluginListener.class).annotatedWith(UniqueAnnotations.create()).to(PluginConfigFactory.class);
}
Also used : NoteDbModule(com.google.gerrit.server.notedb.NoteDbModule) GroupModule(com.google.gerrit.server.group.GroupModule) MergeOp(com.google.gerrit.server.git.MergeOp) EmailModule(com.google.gerrit.server.mail.EmailModule) FileTypeRegistry(com.google.gerrit.server.mime.FileTypeRegistry) MimeUtilFileTypeRegistry(com.google.gerrit.server.mime.MimeUtilFileTypeRegistry) SetAssigneeSender(com.google.gerrit.server.mail.send.SetAssigneeSender) UniversalAuthBackend(com.google.gerrit.server.auth.UniversalAuthBackend) RuntimeInstance(org.apache.velocity.runtime.RuntimeInstance) FromAddressGeneratorProvider(com.google.gerrit.server.mail.send.FromAddressGeneratorProvider) List(java.util.List) DeleteReviewerSender(com.google.gerrit.server.mail.send.DeleteReviewerSender) CapabilityCollection(com.google.gerrit.server.account.CapabilityCollection) AbandonOp(com.google.gerrit.server.git.AbandonOp) GitModules(com.google.gerrit.server.git.GitModules) ChangeData(com.google.gerrit.server.query.change.ChangeData) GitReferenceUpdatedListener(com.google.gerrit.extensions.events.GitReferenceUpdatedListener) MergedSender(com.google.gerrit.server.mail.send.MergedSender) MailTemplates(com.google.gerrit.server.mail.send.MailTemplates) AddReviewerSender(com.google.gerrit.server.mail.send.AddReviewerSender) PatchScriptFactory(com.google.gerrit.server.patch.PatchScriptFactory) ExternalIdModule(com.google.gerrit.server.account.externalids.ExternalIdModule) ProjectState(com.google.gerrit.server.project.ProjectState) ChangeUserName(com.google.gerrit.server.account.ChangeUserName) AuditModule(com.google.gerrit.audit.AuditModule) CmdLineParserModule(com.google.gerrit.server.CmdLineParserModule) GroupMembers(com.google.gerrit.server.account.GroupMembers) ReplacePatchSetSender(com.google.gerrit.server.mail.send.ReplacePatchSetSender) ProjectConfigValidator(com.google.gerrit.server.git.validators.MergeValidators.ProjectConfigValidator) TagCache(com.google.gerrit.server.git.TagCache) BlameCache(com.google.gitiles.blame.BlameCache) RulesCache(com.google.gerrit.rules.RulesCache) OAuthTokenCache(com.google.gerrit.server.auth.oauth.OAuthTokenCache) SectionSortCache(com.google.gerrit.server.project.SectionSortCache) Cache(com.google.common.cache.Cache) PermissionCollection(com.google.gerrit.server.project.PermissionCollection) OnSubmitValidators(com.google.gerrit.server.git.validators.OnSubmitValidators) CapabilityControl(com.google.gerrit.server.account.CapabilityControl) AddKeySender(com.google.gerrit.server.mail.send.AddKeySender) GroupDetailFactory(com.google.gerrit.server.account.GroupDetailFactory) EventFactory(com.google.gerrit.server.events.EventFactory) PatchSetInfoFactory(com.google.gerrit.server.patch.PatchSetInfoFactory) PatchScriptFactory(com.google.gerrit.server.patch.PatchScriptFactory) SshAddressesModule(com.google.gerrit.server.ssh.SshAddressesModule) UploadValidators(com.google.gerrit.server.git.validators.UploadValidators) RegisterNewEmailSender(com.google.gerrit.server.mail.send.RegisterNewEmailSender) MergeUtil(com.google.gerrit.server.git.MergeUtil) AccountControl(com.google.gerrit.server.account.AccountControl) ReplaceOp(com.google.gerrit.server.git.ReplaceOp) RefOperationValidators(com.google.gerrit.server.git.validators.RefOperationValidators) EventListener(com.google.gerrit.common.EventListener) UserScopedEventListener(com.google.gerrit.common.UserScopedEventListener) PluginEventListener(com.google.gerrit.extensions.events.PluginEventListener) MergeValidators(com.google.gerrit.server.git.validators.MergeValidators) CommentLinkProvider(com.google.gerrit.server.project.CommentLinkProvider) ChangeQueryBuilder(com.google.gerrit.server.query.change.ChangeQueryBuilder) AccessControlModule(com.google.gerrit.server.project.AccessControlModule) ChangeJson(com.google.gerrit.server.change.ChangeJson) PrologModule(com.google.gerrit.rules.PrologModule) ChangeQueryProcessor(com.google.gerrit.server.query.change.ChangeQueryProcessor) GitModule(com.google.gerrit.server.git.GitModule) CreateChangeSender(com.google.gerrit.server.mail.send.CreateChangeSender) GroupDetailFactory(com.google.gerrit.server.account.GroupDetailFactory) BlameCache(com.google.gitiles.blame.BlameCache) AccountVisibilityProvider(com.google.gerrit.server.account.AccountVisibilityProvider) NotesBranchUtil(com.google.gerrit.server.git.NotesBranchUtil) ProjectNode(com.google.gerrit.server.project.ProjectNode) VersionedAuthorizedKeys(com.google.gerrit.server.account.VersionedAuthorizedKeys) EmailMerge(com.google.gerrit.server.git.EmailMerge) MergedByPushOp(com.google.gerrit.server.git.MergedByPushOp) PluginUser(com.google.gerrit.server.PluginUser)

Aggregations

Cache (com.google.common.cache.Cache)2 PrologModule (com.google.gerrit.rules.PrologModule)2 AccountVisibilityProvider (com.google.gerrit.server.account.AccountVisibilityProvider)2 CapabilityCollection (com.google.gerrit.server.account.CapabilityCollection)2 CapabilityControl (com.google.gerrit.server.account.CapabilityControl)2 ExternalIdModule (com.google.gerrit.server.account.externalids.ExternalIdModule)2 ChangeJson (com.google.gerrit.server.change.ChangeJson)2 MergeUtil (com.google.gerrit.server.git.MergeUtil)2 TagCache (com.google.gerrit.server.git.TagCache)2 GroupModule (com.google.gerrit.server.group.GroupModule)2 ReplacePatchSetSender (com.google.gerrit.server.mail.send.ReplacePatchSetSender)2 NoteDbModule (com.google.gerrit.server.notedb.NoteDbModule)2 CommentLinkProvider (com.google.gerrit.server.project.CommentLinkProvider)2 ProjectState (com.google.gerrit.server.project.ProjectState)2 SectionSortCache (com.google.gerrit.server.project.SectionSortCache)2 ChangeData (com.google.gerrit.server.query.change.ChangeData)2 ChangeQueryProcessor (com.google.gerrit.server.query.change.ChangeQueryProcessor)2 List (java.util.List)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 AuditModule (com.google.gerrit.audit.AuditModule)1