Search in sources :

Example 6 with CreateDataSourceRequest

use of com.zimbra.soap.mail.message.CreateDataSourceRequest in project zm-mailbox by Zimbra.

the class TestDataSource method createPop3DataSource.

public static String createPop3DataSource(ZMailbox shareeMbox, String sharedAcctName, String dsFolderId) throws ServiceException {
    CreateDataSourceRequest req = new CreateDataSourceRequest();
    MailPop3DataSource pop3 = new MailPop3DataSource();
    pop3.setUsername(sharedAcctName);
    pop3.setPassword("test123");
    pop3.setEnabled(true);
    pop3.setHost("localhost");
    pop3.setPort(Integer.valueOf(TestUtil.getServerAttr(Provisioning.A_zimbraPop3BindPort)));
    pop3.setConnectionType(ConnectionType.cleartext);
    pop3.setFolderId(dsFolderId);
    pop3.setName("pop3datasource1");
    req.setDataSource(pop3);
    CreateDataSourceResponse resp = shareeMbox.invokeJaxb(req);
    return resp.getDataSource().getId();
}
Also used : CreateDataSourceResponse(com.zimbra.soap.mail.message.CreateDataSourceResponse) MailPop3DataSource(com.zimbra.soap.mail.type.MailPop3DataSource) CreateDataSourceRequest(com.zimbra.soap.mail.message.CreateDataSourceRequest)

Aggregations

CreateDataSourceRequest (com.zimbra.soap.mail.message.CreateDataSourceRequest)6 CreateDataSourceResponse (com.zimbra.soap.mail.message.CreateDataSourceResponse)4 MailPop3DataSource (com.zimbra.soap.mail.type.MailPop3DataSource)3 MailImapDataSource (com.zimbra.soap.mail.type.MailImapDataSource)2 Test (org.junit.Test)2 SoapTransport (com.zimbra.common.soap.SoapTransport)1 DeleteDataSourceRequest (com.zimbra.soap.mail.message.DeleteDataSourceRequest)1 Pop3DataSourceNameOrId (com.zimbra.soap.mail.type.Pop3DataSourceNameOrId)1