Search in sources :

Example 1 with MessageSearchIndex

use of org.apache.james.mailbox.store.search.MessageSearchIndex in project tmail-backend by linagora.

the class DeleteEncryptedProjectionHookTest method createMailboxManager.

CassandraMailboxManager createMailboxManager(CassandraMailboxSessionMapperFactory mapperFactory) {
    Preconditions.checkNotNull(encryptedEmailContentStore);
    InVMEventBus eventBus = new InVMEventBus(new InVmEventDelivery(new RecordingMetricFactory()), EventBusTestFixture.RETRY_BACKOFF_CONFIGURATION, new MemoryEventDeadLetters());
    StoreRightManager storeRightManager = new StoreRightManager(mapperFactory, new UnionMailboxACLResolver(), eventBus);
    StoreMailboxAnnotationManager annotationManager = new StoreMailboxAnnotationManager(mapperFactory, storeRightManager);
    SessionProviderImpl sessionProvider = new SessionProviderImpl(mock(Authenticator.class), mock(Authorizator.class));
    QuotaComponents quotaComponents = QuotaComponents.disabled(sessionProvider, mapperFactory);
    AttachmentContentLoader attachmentContentLoader = null;
    MessageSearchIndex index = new SimpleMessageSearchIndex(mapperFactory, mapperFactory, new DefaultTextExtractor(), attachmentContentLoader);
    StoreMessageIdManager messageIdManager = new StoreMessageIdManager(storeRightManager, mapperFactory, eventBus, quotaComponents.getQuotaManager(), new DefaultUserQuotaRootResolver(sessionProvider, mapperFactory), PreDeletionHooks.NO_PRE_DELETION_HOOK);
    DeleteEncryptedProjectionHook preDeleteEncryptedProjectionHook = new DeleteEncryptedProjectionHook(encryptedEmailContentStore, sessionProvider, messageIdManager, mapperFactory);
    PreDeletionHooks preDeletionHooks = new PreDeletionHooks(ImmutableSet.of(preDeleteEncryptedProjectionHook), new RecordingMetricFactory());
    CassandraMailboxManager cassandraMailboxManager = new CassandraMailboxManager(mapperFactory, sessionProvider, new NoMailboxPathLocker(), new MessageParser(), new CassandraMessageId.Factory(), eventBus, annotationManager, storeRightManager, quotaComponents, index, MailboxManagerConfiguration.DEFAULT, preDeletionHooks, new NaiveThreadIdGuessingAlgorithm());
    eventBus.register(new MailboxAnnotationListener(mapperFactory, sessionProvider));
    eventBus.register(mapperFactory.deleteMessageListener());
    return cassandraMailboxManager;
}
Also used : InVmEventDelivery(org.apache.james.events.delivery.InVmEventDelivery) SimpleMessageSearchIndex(org.apache.james.mailbox.store.search.SimpleMessageSearchIndex) MessageSearchIndex(org.apache.james.mailbox.store.search.MessageSearchIndex) MessageParser(org.apache.james.mailbox.store.mail.model.impl.MessageParser) RecordingMetricFactory(org.apache.james.metrics.tests.RecordingMetricFactory) StoreRightManager(org.apache.james.mailbox.store.StoreRightManager) DefaultTextExtractor(org.apache.james.mailbox.store.extractor.DefaultTextExtractor) PreDeletionHooks(org.apache.james.mailbox.store.PreDeletionHooks) StoreMessageIdManager(org.apache.james.mailbox.store.StoreMessageIdManager) MemoryEventDeadLetters(org.apache.james.events.MemoryEventDeadLetters) StoreMailboxAnnotationManager(org.apache.james.mailbox.store.StoreMailboxAnnotationManager) CassandraMessageId(org.apache.james.mailbox.cassandra.ids.CassandraMessageId) Authorizator(org.apache.james.mailbox.Authorizator) Authenticator(org.apache.james.mailbox.Authenticator) DefaultUserQuotaRootResolver(org.apache.james.mailbox.store.quota.DefaultUserQuotaRootResolver) SimpleMessageSearchIndex(org.apache.james.mailbox.store.search.SimpleMessageSearchIndex) UnionMailboxACLResolver(org.apache.james.mailbox.acl.UnionMailboxACLResolver) SessionProviderImpl(org.apache.james.mailbox.store.SessionProviderImpl) AttachmentContentLoader(org.apache.james.mailbox.AttachmentContentLoader) QuotaComponents(org.apache.james.mailbox.store.quota.QuotaComponents) NaiveThreadIdGuessingAlgorithm(org.apache.james.mailbox.store.mail.NaiveThreadIdGuessingAlgorithm) CassandraMailboxManager(org.apache.james.mailbox.cassandra.CassandraMailboxManager) MailboxAnnotationListener(org.apache.james.mailbox.store.event.MailboxAnnotationListener) NoMailboxPathLocker(org.apache.james.mailbox.store.NoMailboxPathLocker) InVMEventBus(org.apache.james.events.InVMEventBus)

Aggregations

InVMEventBus (org.apache.james.events.InVMEventBus)1 MemoryEventDeadLetters (org.apache.james.events.MemoryEventDeadLetters)1 InVmEventDelivery (org.apache.james.events.delivery.InVmEventDelivery)1 AttachmentContentLoader (org.apache.james.mailbox.AttachmentContentLoader)1 Authenticator (org.apache.james.mailbox.Authenticator)1 Authorizator (org.apache.james.mailbox.Authorizator)1 UnionMailboxACLResolver (org.apache.james.mailbox.acl.UnionMailboxACLResolver)1 CassandraMailboxManager (org.apache.james.mailbox.cassandra.CassandraMailboxManager)1 CassandraMessageId (org.apache.james.mailbox.cassandra.ids.CassandraMessageId)1 NoMailboxPathLocker (org.apache.james.mailbox.store.NoMailboxPathLocker)1 PreDeletionHooks (org.apache.james.mailbox.store.PreDeletionHooks)1 SessionProviderImpl (org.apache.james.mailbox.store.SessionProviderImpl)1 StoreMailboxAnnotationManager (org.apache.james.mailbox.store.StoreMailboxAnnotationManager)1 StoreMessageIdManager (org.apache.james.mailbox.store.StoreMessageIdManager)1 StoreRightManager (org.apache.james.mailbox.store.StoreRightManager)1 MailboxAnnotationListener (org.apache.james.mailbox.store.event.MailboxAnnotationListener)1 DefaultTextExtractor (org.apache.james.mailbox.store.extractor.DefaultTextExtractor)1 NaiveThreadIdGuessingAlgorithm (org.apache.james.mailbox.store.mail.NaiveThreadIdGuessingAlgorithm)1 MessageParser (org.apache.james.mailbox.store.mail.model.impl.MessageParser)1 DefaultUserQuotaRootResolver (org.apache.james.mailbox.store.quota.DefaultUserQuotaRootResolver)1