Package com.ripariandata.timberwolf.writer

Examples of com.ripariandata.timberwolf.writer.MailWriter


            @Override
            public Object run()
            {

                MailStore mailStore = new ExchangeMailStore(exchangeURL, 12, 4);
                MailWriter mailWriter = HBaseMailWriter.create(emailTable.getTable(), keyHeader,
                                                               emailTable.getFamily());
                HBaseUserFolderSyncStateStorage syncStateHandler =
                        new HBaseUserFolderSyncStateStorage(userTable.getManager(), userTable.getName());

                try
                {
                    Iterable<String> users = new LdapFetcher(ldapDomain).getPrincipals();
                    removeUsers(users, senderEmail, ignoredEmail);
                    Iterable<MailboxItem> mailboxItems = mailStore.getMail(users, syncStateHandler);
                    mailWriter.write(mailboxItems);
                }
                catch (PrincipalFetchException e)
                {
                    e.printStackTrace();
                }
View Full Code Here


        List<MailboxItem> mails = new ArrayList<MailboxItem>();
        mails.add(mail);

        HBaseTable table = new HBaseTable(mockHTable);

        MailWriter writer = HBaseMailWriter.create(table, arbitraryHeader, arbitraryFamily);

        writer.write(mails);

        assertMailboxItemDescription(mockHTable, mailboxItemDescription, arbitraryFamily,
                mail.getHeader(arbitraryHeader));
    }
View Full Code Here

        return true;
    }

    public Integer run()
    {
        MailWriter mailWriter;
        UserFolderSyncStateStorage syncStateStorage;
        HBaseManager hbaseManager = null;
        if (useHBase)
        {
            hbaseManager = new HBaseManager(hbaseQuorum, hbaseclientPort);
            mailWriter = HBaseMailWriter.create(hbaseManager, hbaseTableName, hbaseKeyHeader,
                                                hbaseColumnFamily);
            syncStateStorage = new HBaseUserFolderSyncStateStorage(hbaseManager, hbaseMetadataTableName);
        }
        else
        {
            mailWriter = new ConsoleMailWriter();
            syncStateStorage = new InMemoryUserFolderSyncStateStorage();
        }

        ExchangeMailStore mailStore = new ExchangeMailStore(exchangeUrl);
        try
        {
            PrincipalFetcher userLister = new LdapFetcher(domain);
            Iterable<String> users = userLister.getPrincipals();

            mailWriter.write(mailStore.getMail(users, syncStateStorage));
            return 0;
        }
        catch (ExchangeRuntimeException e)
        {
            Throwable inner = e.getCause();
View Full Code Here

TOP

Related Classes of com.ripariandata.timberwolf.writer.MailWriter

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.