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();