@Override protected StatusResponseFactory createInstance() { return new UnpooledStatusResponseFactory(); }
public static final ImapDecoder createDecoder() { final UnpooledStatusResponseFactory unpooledStatusResponseFactory = new UnpooledStatusResponseFactory(); final ImapCommandParserFactory imapCommands = new ImapParserFactory(unpooledStatusResponseFactory); final ImapDecoder result = new DefaultImapDecoder(unpooledStatusResponseFactory, imapCommands); return result; }
public static final ImapDecoder createDecoder() { final UnpooledStatusResponseFactory unpooledStatusResponseFactory = new UnpooledStatusResponseFactory(); final ImapCommandParserFactory imapCommands = new ImapParserFactory(unpooledStatusResponseFactory); return new DefaultImapDecoder(unpooledStatusResponseFactory, imapCommands); }
public static final ImapProcessor createXListSupportingProcessor(final MailboxManager mailboxManager, final SubscriptionManager subscriptionManager, MailboxTyper mailboxTyper, long idleKeepAlive, Set<String> disabledCaps) { final StatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); final UnknownRequestProcessor unknownRequestImapProcessor = new UnknownRequestProcessor(statusResponseFactory); final ImapProcessor imap4rev1Chain = DefaultProcessorChain.createDefaultChain(unknownRequestImapProcessor, mailboxManager, subscriptionManager, statusResponseFactory, mailboxTyper, idleKeepAlive, TimeUnit.SECONDS, disabledCaps); final ImapProcessor result = new ImapResponseMessageProcessor(imap4rev1Chain); return result; }
public static ImapProcessor createXListSupportingProcessor(MailboxManager mailboxManager, SubscriptionManager subscriptionManager, MailboxTyper mailboxTyper, QuotaManager quotaManager, QuotaRootResolver quotaRootResolver, MetricFactory metricFactory) { final StatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); final UnknownRequestProcessor unknownRequestImapProcessor = new UnknownRequestProcessor(statusResponseFactory); final ImapProcessor imap4rev1Chain = DefaultProcessorChain.createDefaultChain(unknownRequestImapProcessor, mailboxManager, subscriptionManager, statusResponseFactory, mailboxTyper, quotaManager, quotaRootResolver, metricFactory); return new ImapResponseMessageProcessor(imap4rev1Chain); }
@Before public void setUp() { mailboxSession = new MockMailboxSession("plop"); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mockedImapSession = mock(ImapSession.class); mockedQuotaManager = mock(QuotaManager.class); mockedQuotaRootResolver = mock(QuotaRootResolver.class); mockedResponder = mock(ImapProcessor.Responder.class); mockedMailboxManager = mock(MailboxManager.class); testee = new GetQuotaRootProcessor(mock(ImapProcessor.class), mockedMailboxManager, statusResponseFactory, mockedQuotaRootResolver, mockedQuotaManager, new NoopMetricFactory()); }
@Before public void setUp() { mailboxSession = new MockMailboxSession("plop"); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mockedImapSession = mock(ImapSession.class); mockedResponder = mock(ImapProcessor.Responder.class); mockedMailboxManager = mock(MailboxManager.class); testee = new SetQuotaProcessor(mock(ImapProcessor.class), mockedMailboxManager, statusResponseFactory, new NoopMetricFactory()); }
@Before public void setUp() throws Exception { mailboxSession = new MockMailboxSession("plop"); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mockedImapSession = mock(ImapSession.class); mockedQuotaManager = mock(QuotaManager.class); mockedQuotaRootResolver = mock(QuotaRootResolver.class); when(mockedQuotaRootResolver.fromString(eq(QUOTA_ROOT.getValue()))).thenReturn(QUOTA_ROOT); mockedResponder = mock(ImapProcessor.Responder.class); mockedMailboxManager = mock(MailboxManager.class); testee = new GetQuotaProcessor(mock(ImapProcessor.class), mockedMailboxManager, statusResponseFactory, mockedQuotaManager, mockedQuotaRootResolver, new NoopMetricFactory()); }
@Before public void setUp() throws Exception { path = MailboxPath.forUser(USER_1, MAILBOX_NAME); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mailboxManager = mock(MailboxManager.class); subject = new GetACLProcessor(mock(ImapProcessor.class), mailboxManager, statusResponseFactory, new NoopMetricFactory()); imapSession = mock(ImapSession.class); mailboxSession = mock(MailboxSession.class); User user1 = mock(User.class); MessageManager messageManager = mock(MessageManager.class); metaData = mock(MetaData.class); responder = mock(Responder.class); getACLRequest = new GetACLRequest("TAG", ImapCommand.anyStateCommand("Name"), MAILBOX_NAME); when(imapSession.getAttribute(ImapSessionUtils.MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY)) .thenReturn(mailboxSession); when(imapSession.getState()) .thenReturn(ImapSessionState.AUTHENTICATED); when(mailboxSession.getUser()) .thenReturn(user1); when(user1.getUserName()) .thenReturn(USER_1); when(messageManager.getMetaData(anyBoolean(), any(MailboxSession.class), any(FetchGroup.class))) .thenReturn(metaData); when(mailboxManager.getMailbox(any(MailboxPath.class), any(MailboxSession.class))) .thenReturn(messageManager); argumentCaptor = ArgumentCaptor.forClass(ImapResponseMessage.class); }
@Before public void setUp() throws Exception { path = MailboxPath.forUser(USER_1, MAILBOX_NAME); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mailboxManager = mock(MailboxManager.class); subject = new SetACLProcessor(mock(ImapProcessor.class), mailboxManager, statusResponseFactory, new NoopMetricFactory()); imapSession = mock(ImapSession.class); mailboxSession = mock(MailboxSession.class); User user1 = mock(User.class); MessageManager messageManager = mock(MessageManager.class); MetaData metaData = mock(MetaData.class); responder = mock(Responder.class); argumentCaptor = ArgumentCaptor.forClass(ImapResponseMessage.class); when(imapSession.getAttribute(ImapSessionUtils.MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY)) .thenReturn(mailboxSession); when(imapSession.getState()) .thenReturn(ImapSessionState.AUTHENTICATED); when(mailboxSession.getUser()) .thenReturn(user1); when(user1.getUserName()) .thenReturn(USER_1); when(messageManager.getMetaData(anyBoolean(), any(MailboxSession.class), any(FetchGroup.class))) .thenReturn(metaData); when(mailboxManager.getMailbox(any(MailboxPath.class), any(MailboxSession.class))) .thenReturn(messageManager); replaceAclRequest = new SetACLRequest("TAG", ImapCommand.anyStateCommand("Name"), MAILBOX_NAME, USER_1, SET_RIGHTS); user1Key = EntryKey.deserialize(USER_1); setRights = Rfc4314Rights.fromSerializedRfc4314Rights(SET_RIGHTS); }
@Before public void setUp() throws Exception { path = MailboxPath.forUser(USER_1, MAILBOX_NAME); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mailboxManager = mock(MailboxManager.class); subject = new DeleteACLProcessor(mock(ImapProcessor.class), mailboxManager, statusResponseFactory, new NoopMetricFactory());
@Before public void setUp() throws Exception { path = MailboxPath.forUser(USER_1, MAILBOX_NAME); UnpooledStatusResponseFactory statusResponseFactory = new UnpooledStatusResponseFactory(); mailboxManager = mock(MailboxManager.class); subject = new ListRightsProcessor(mock(ImapProcessor.class), mailboxManager, statusResponseFactory, new NoopMetricFactory()); imapSession = mock(ImapSession.class); mailboxSession = mock(MailboxSession.class); User user1 = mock(User.class); MessageManager messageManager = mock(MessageManager.class); metaData = mock(MetaData.class); responder = mock(Responder.class); argumentCaptor = ArgumentCaptor.forClass(ImapResponseMessage.class); when(imapSession.getAttribute(ImapSessionUtils.MAILBOX_SESSION_ATTRIBUTE_SESSION_KEY)) .thenReturn(mailboxSession); when(imapSession.getState()) .thenReturn(ImapSessionState.AUTHENTICATED); when(mailboxSession.getUser()) .thenReturn(user1); when(user1.getUserName()) .thenReturn(USER_1); when(messageManager.getMetaData(anyBoolean(), any(MailboxSession.class), any(MetaData.FetchGroup.class))) .thenReturn(metaData); when(mailboxManager.getMailbox(any(MailboxPath.class), any(MailboxSession.class))) .thenReturn(messageManager); listRightsRequest = new ListRightsRequest("TAG", ImapCommand.anyStateCommand("Name"), MAILBOX_NAME, USER_1); user1Key = EntryKey.deserialize(USER_1); listRights = new Rfc4314Rights[] {Rfc4314Rights.fromSerializedRfc4314Rights("ae"), Rfc4314Rights.fromSerializedRfc4314Rights("i"), Rfc4314Rights.fromSerializedRfc4314Rights("k")}; }