Search in sources :

Example 1 with CalDataSource

use of com.zimbra.soap.type.CalDataSource in project zm-mailbox by Zimbra.

the class ZMailbox method getAllDataSources.

public List<ZDataSource> getAllDataSources() throws ServiceException {
    GetDataSourcesResponse res = invokeJaxb(new GetDataSourcesRequest());
    List<ZDataSource> result = new ArrayList<ZDataSource>();
    for (DataSource ds : res.getDataSources()) {
        if (ds instanceof Pop3DataSource) {
            result.add(new ZPop3DataSource((Pop3DataSource) ds));
        } else if (ds instanceof ImapDataSource) {
            result.add(new ZImapDataSource((ImapDataSource) ds));
        } else if (ds instanceof CalDataSource) {
            result.add(new ZCalDataSource((CalDataSource) ds));
        } else if (ds instanceof RssDataSource) {
            result.add(new ZRssDataSource((RssDataSource) ds));
        } else {
            result.add(new ZDataSource(ds));
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) ImapDataSource(com.zimbra.soap.type.ImapDataSource) GetDataSourcesResponse(com.zimbra.soap.mail.message.GetDataSourcesResponse) CalDataSource(com.zimbra.soap.type.CalDataSource) RssDataSource(com.zimbra.soap.type.RssDataSource) TestDataSource(com.zimbra.soap.mail.type.TestDataSource) DataSource(com.zimbra.soap.type.DataSource) Pop3DataSource(com.zimbra.soap.type.Pop3DataSource) ImapDataSource(com.zimbra.soap.type.ImapDataSource) CalDataSource(com.zimbra.soap.type.CalDataSource) Pop3DataSource(com.zimbra.soap.type.Pop3DataSource) RssDataSource(com.zimbra.soap.type.RssDataSource) GetDataSourcesRequest(com.zimbra.soap.mail.message.GetDataSourcesRequest)

Aggregations

GetDataSourcesRequest (com.zimbra.soap.mail.message.GetDataSourcesRequest)1 GetDataSourcesResponse (com.zimbra.soap.mail.message.GetDataSourcesResponse)1 TestDataSource (com.zimbra.soap.mail.type.TestDataSource)1 CalDataSource (com.zimbra.soap.type.CalDataSource)1 DataSource (com.zimbra.soap.type.DataSource)1 ImapDataSource (com.zimbra.soap.type.ImapDataSource)1 Pop3DataSource (com.zimbra.soap.type.Pop3DataSource)1 RssDataSource (com.zimbra.soap.type.RssDataSource)1 ArrayList (java.util.ArrayList)1