use of com.zimbra.soap.mail.message.CreateDataSourceResponse in project zm-mailbox by Zimbra.
the class TestPurgeDataSource method createDataSources.
private void createDataSources() throws ServiceException {
CreateDataSourceRequest req = new CreateDataSourceRequest();
MailImapDataSource imap = new MailImapDataSource();
imap.setUsername(IMAP_ACCOUNT_NAME_1);
imap.setPassword("test123");
imap.setEnabled(true);
imap.setHost("localhost");
imap.setPort(Integer.valueOf(TestUtil.getServerAttr(Provisioning.A_zimbraImapBindPort)));
imap.setConnectionType(ConnectionType.cleartext);
imap.setFolderId(imapDsFolder1Id);
imap.setName(IMAP_DS_NAME_1);
req.setDataSource(imap);
CreateDataSourceResponse resp = mbox.invokeJaxb(req);
imapDsId1 = resp.getDataSource().getId();
req = new CreateDataSourceRequest();
imap = new MailImapDataSource();
imap.setUsername(IMAP_ACCOUNT_NAME_2);
imap.setPassword("test123");
imap.setEnabled(true);
imap.setHost("localhost");
imap.setPort(Integer.valueOf(TestUtil.getServerAttr(Provisioning.A_zimbraImapBindPort)));
imap.setConnectionType(ConnectionType.cleartext);
imap.setFolderId(imapDsFolder2Id);
imap.setName(IMAP_DS_NAME_2);
req.setDataSource(imap);
resp = mbox.invokeJaxb(req);
imapDsId2 = resp.getDataSource().getId();
req = new CreateDataSourceRequest();
MailPop3DataSource pop3 = new MailPop3DataSource();
pop3.setUsername(POP3_ACCOUNT_NAME);
pop3.setPassword("test123");
pop3.setEnabled(true);
pop3.setHost("localhost");
pop3.setPort(Integer.valueOf(TestUtil.getServerAttr(Provisioning.A_zimbraPop3BindPort)));
pop3.setConnectionType(ConnectionType.cleartext);
pop3.setFolderId(pop3DsFolderId);
pop3.setName(POP3_DS_NAME);
pop3.setLeaveOnServer(true);
req.setDataSource(pop3);
resp = mbox.invokeJaxb(req);
pop3DsId = resp.getDataSource().getId();
}
use of com.zimbra.soap.mail.message.CreateDataSourceResponse in project zm-mailbox by Zimbra.
the class TestTrashImapMessage method createDataSources.
private void createDataSources() throws ServiceException {
CreateDataSourceRequest req = new CreateDataSourceRequest();
MailImapDataSource imap = new MailImapDataSource();
imap.setUsername(IMAP_ACCOUNT_NAME_1);
imap.setPassword("test123");
imap.setEnabled(true);
imap.setHost("localhost");
imap.setPort(Integer.valueOf(TestUtil.getServerAttr(Provisioning.A_zimbraImapBindPort)));
imap.setConnectionType(ConnectionType.cleartext);
imap.setFolderId(imapDsFolder1Id);
imap.setName(IMAP_DS_NAME_1);
req.setDataSource(imap);
CreateDataSourceResponse resp = mbox.invokeJaxb(req);
imapDsId1 = resp.getDataSource().getId();
}
use of com.zimbra.soap.mail.message.CreateDataSourceResponse in project zm-mailbox by Zimbra.
the class TestAccess method DeleteDataSource.
@Test
public void DeleteDataSource() throws Exception {
String dateSourceName = genDataSourceName(seq);
// create a data cource
SoapTransport transport = authUser(ACCT_NAME);
CreateDataSourceRequest createReq = buildCeateDataSourceRequest(dateSourceName);
CreateDataSourceResponse createResp = invokeJaxb(transport, createReq);
assertNotNull("CreateDataSourceResponse", createResp);
Pop3DataSourceNameOrId name = new Pop3DataSourceNameOrId();
name.setName(dateSourceName);
DeleteDataSourceRequest req = new DeleteDataSourceRequest();
req.addDataSource(name);
/*
DataSource ds = mProvAdmin.setup_createDataSource(this, role, perm, ACCT_1_EMAIL, dateSourceName);
XMLElement req = new XMLElement(MailConstants.DELETE_DATA_SOURCE_REQUEST);
Element dataSource = req.addElement(MailConstants.E_DS_POP3);
dataSource.addAttribute(MailConstants.A_ID, ds.getId());
*/
accessTest(Perm.PERM_SELF_ONLY, req);
}
use of com.zimbra.soap.mail.message.CreateDataSourceResponse 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();
}
Aggregations