Search in sources :

Example 1 with MailboxInfo

use of com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo in project zm-mailbox by Zimbra.

the class ProvUtil method doGetMailboxInfo.

private void doGetMailboxInfo(String[] args) throws ServiceException {
    if (!(prov instanceof SoapProvisioning)) {
        throwSoapOnly();
    }
    SoapProvisioning sp = (SoapProvisioning) prov;
    Account acct = lookupAccount(args[1]);
    MailboxInfo info = sp.getMailbox(acct);
    console.printf("mailboxId: %s\nquotaUsed: %d\n", info.getMailboxId(), info.getUsed());
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) MailboxInfo(com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo)

Example 2 with MailboxInfo

use of com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo in project zm-mailbox by Zimbra.

the class TestJaxbProvisioning method testMailbox.

@Test
public void testMailbox() throws Exception {
    ZimbraLog.test.debug("Starting test %s", testName());
    Domain dom = ensureDomainExists(domain2);
    assertNotNull("Domain for " + domain2, dom);
    Account acct = prov.createAccount(testAcctEmail, TestUtil.DEFAULT_PASSWORD, null);
    acct = ensureMailboxExists(testAcctEmail);
    assertNotNull("Account for " + testAcctEmail, acct);
    MailboxInfo mbx = prov.getMailbox(acct);
    assertNotNull("MailboxInfo for Account=" + testAcctEmail, mbx);
    prov.deleteAccount(acct.getId());
}
Also used : Account(com.zimbra.cs.account.Account) MailboxInfo(com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo) Domain(com.zimbra.cs.account.Domain) Test(org.junit.Test)

Example 3 with MailboxInfo

use of com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo in project zm-mailbox by Zimbra.

the class TestJaxbProvisioning method ensureMailboxExists.

public static Account ensureMailboxExists(String name) throws ServiceException {
    SoapProvisioning prov = TestUtil.newSoapProvisioning();
    Account acct = ensureAccountExists(name);
    if (acct == null) {
        ZimbraLog.test.debug("ensureMailboxExists returning null!!!");
    } else {
        // The act of getting a mailbox is sufficient to create it if the associated account exists.
        // Note that prov.getAccount() USED TO implicitly created a mailbox even though it was not really
        // supposed to and this routine used to rely on that.
        MailboxInfo mboxInfo = prov.getMailbox(acct);
        ZimbraLog.test.debug("ensureMailboxExists Returning Mailbox=%s Account=%s Id=%s", mboxInfo.getMailboxId(), acct.getName(), acct.getId());
    }
    return acct;
}
Also used : Account(com.zimbra.cs.account.Account) SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) MailboxInfo(com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo)

Aggregations

MailboxInfo (com.zimbra.cs.account.soap.SoapProvisioning.MailboxInfo)3 Account (com.zimbra.cs.account.Account)2 SoapProvisioning (com.zimbra.cs.account.soap.SoapProvisioning)2 Domain (com.zimbra.cs.account.Domain)1 Test (org.junit.Test)1