Search in sources :

Example 1 with ConnectionType

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

the class CalDavDataImport method getTargetUrl.

protected String getTargetUrl() {
    DataSource ds = getDataSource();
    ConnectionType ctype = ds.getConnectionType();
    StringBuilder url = new StringBuilder();
    switch(ctype) {
        case ssl:
            url.append("https://");
            break;
        case cleartext:
        default:
            url.append("http://");
            break;
    }
    url.append(ds.getHost()).append(":").append(ds.getPort());
    return url.toString();
}
Also used : ConnectionType(com.zimbra.soap.type.DataSource.ConnectionType) DbDataSource(com.zimbra.cs.db.DbDataSource) DataSource(com.zimbra.cs.account.DataSource)

Example 2 with ConnectionType

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

the class TestImapSync method createDataSource.

private ZDataSource createDataSource() throws Exception {
    ConnectionType ctype = config.getSecurity() == MailConfig.Security.SSL ? ConnectionType.ssl : ConnectionType.cleartext;
    String id = localMailbox.createDataSource(new ZImapDataSource("TestImapSync", true, config.getHost(), config.getPort(), config.getAuthenticationId(), pass, "1", ctype));
    for (ZDataSource ds : localMailbox.getAllDataSources()) {
        if (ds.getId().equals(id)) {
            return ds;
        }
    }
    Assert.fail("Could not find data source");
    return null;
}
Also used : ZImapDataSource(com.zimbra.client.ZImapDataSource) ConnectionType(com.zimbra.soap.type.DataSource.ConnectionType) ZDataSource(com.zimbra.client.ZDataSource)

Aggregations

ConnectionType (com.zimbra.soap.type.DataSource.ConnectionType)2 ZDataSource (com.zimbra.client.ZDataSource)1 ZImapDataSource (com.zimbra.client.ZImapDataSource)1 DataSource (com.zimbra.cs.account.DataSource)1 DbDataSource (com.zimbra.cs.db.DbDataSource)1