Search in sources :

Example 1 with MailboxByAccountIdSelector

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

the class SoapProvisioning method getMailbox.

public MailboxInfo getMailbox(Account acct) throws ServiceException {
    Server server = getServer(acct);
    String serviceHost = server.getAttr(A_zimbraServiceHostname);
    MailboxByAccountIdSelector mbox = new MailboxByAccountIdSelector(acct.getId());
    GetMailboxResponse resp = invokeJaxb(new GetMailboxRequest(mbox), serviceHost);
    resp.getMbox();
    return new MailboxInfo(resp.getMbox());
}
Also used : Server(com.zimbra.cs.account.Server) ReindexMailboxInfo(com.zimbra.soap.admin.type.ReindexMailboxInfo) MailboxByAccountIdSelector(com.zimbra.soap.admin.type.MailboxByAccountIdSelector)

Example 2 with MailboxByAccountIdSelector

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

the class SoapProvisioning method getIndexStats.

public IndexStatsInfo getIndexStats(Account acct) throws ServiceException {
    Server server = getServer(acct);
    GetIndexStatsRequest req = new GetIndexStatsRequest(new MailboxByAccountIdSelector(acct.getId()));
    GetIndexStatsResponse resp = this.invokeJaxb(req, server.getAttr(A_zimbraServiceHostname));
    return new IndexStatsInfo(resp.getStats().getMaxDocs(), resp.getStats().getNumDeletedDocs());
}
Also used : Server(com.zimbra.cs.account.Server) MailboxByAccountIdSelector(com.zimbra.soap.admin.type.MailboxByAccountIdSelector)

Example 3 with MailboxByAccountIdSelector

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

the class SoapProvisioning method compactIndex.

public String compactIndex(Account acct, String action) throws ServiceException {
    Server server = getServer(acct);
    CompactIndexRequest req = new CompactIndexRequest(action, new MailboxByAccountIdSelector(acct.getId()));
    CompactIndexResponse resp = this.invokeJaxb(req, server.getAttr(A_zimbraServiceHostname));
    return resp.getStatus();
}
Also used : Server(com.zimbra.cs.account.Server) MailboxByAccountIdSelector(com.zimbra.soap.admin.type.MailboxByAccountIdSelector)

Example 4 with MailboxByAccountIdSelector

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

the class SoapProvisioning method recalculateMailboxCounts.

public long recalculateMailboxCounts(Account acct) throws ServiceException {
    String hostname = getServer(acct).getServiceHostname();
    MailboxByAccountIdSelector mbox = new MailboxByAccountIdSelector(acct.getId());
    RecalculateMailboxCountsResponse resp = invokeJaxb(new RecalculateMailboxCountsRequest(mbox), hostname);
    return resp.getMailbox().getQuotaUsed();
}
Also used : MailboxByAccountIdSelector(com.zimbra.soap.admin.type.MailboxByAccountIdSelector)

Example 5 with MailboxByAccountIdSelector

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

the class TestDomainAdmin method testGetAccountInDiffDomain.

@Test
public void testGetAccountInDiffDomain() throws Exception {
    Account acct = TestJaxbProvisioning.ensureAccountExists(DIFF_ACCT);
    String acctId = acct.getId();
    String domAdminId = createAdminConsoleStyleDomainAdmin(DOMADMIN);
    SoapProvisioning domAdminSoapProv = getSoapProvisioning(DOMADMIN, TestUtil.DEFAULT_PASSWORD);
    GetAccountRequest getAcctReq = new GetAccountRequest(AccountSelector.fromName(DIFF_ACCT), true);
    try {
        domAdminSoapProv.invokeJaxb(getAcctReq);
        fail("GetAccountRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    try {
        domAdminSoapProv.invokeJaxbOnTargetAccount(getAcctReq, acctId);
        fail("GetAccountRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    // try non-existent acct
    getAcctReq = new GetAccountRequest(AccountSelector.fromName(DIFF_ACCT2), true);
    try {
        domAdminSoapProv.invokeJaxb(getAcctReq);
        fail("GetAccountRequest succeeded for non-existent account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    GetMailboxRequest gmReq = new GetMailboxRequest(new MailboxByAccountIdSelector(acctId));
    try {
        domAdminSoapProv.invokeJaxb(gmReq);
        fail("GetMailboxRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    try {
        domAdminSoapProv.invokeJaxbOnTargetAccount(gmReq, acctId);
        fail("GetMailboxRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    AddAccountAliasResponse aaaResp;
    try {
        aaaResp = domAdminSoapProv.invokeJaxb(new AddAccountAliasRequest(acctId, ALIAS_FOR_TARGET_ACCT));
        fail("AddAccountAliasRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    try {
        aaaResp = domAdminSoapProv.invokeJaxbOnTargetAccount(new AddAccountAliasRequest(acctId, ALIAS_FOR_TARGET_ACCT2), acctId);
        fail("AddAccountAliasRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    aaaResp = adminSoapProv.invokeJaxb(new AddAccountAliasRequest(acctId, ALIAS_FOR_TARGET_ACCT));
    assertNotNull("AddAccountAliasResponse for " + TARGET_ACCT + " as FULL ADMIN", aaaResp);
    try {
        domAdminSoapProv.invokeJaxb(new RemoveAccountAliasRequest(acctId, ALIAS_FOR_TARGET_ACCT));
        fail("RemoveAccountAliasRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    try {
        domAdminSoapProv.invokeJaxb(new RenameAccountRequest(acctId, TARGET_ACCT_RENAMED));
        fail("RenameAccountRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
    try {
        domAdminSoapProv.invokeJaxb(new DeleteAccountRequest(acctId));
        fail("DeleteAccountRequest succeeded for account in other domain!");
    } catch (SoapFaultException sfe) {
        checkSoapReason(sfe, "permission denied: can not access account ");
    }
}
Also used : Account(com.zimbra.cs.account.Account) DeleteAccountRequest(com.zimbra.soap.admin.message.DeleteAccountRequest) AddAccountAliasRequest(com.zimbra.soap.admin.message.AddAccountAliasRequest) SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) RemoveAccountAliasRequest(com.zimbra.soap.admin.message.RemoveAccountAliasRequest) GetMailboxRequest(com.zimbra.soap.admin.message.GetMailboxRequest) RenameAccountRequest(com.zimbra.soap.admin.message.RenameAccountRequest) MailboxByAccountIdSelector(com.zimbra.soap.admin.type.MailboxByAccountIdSelector) AddAccountAliasResponse(com.zimbra.soap.admin.message.AddAccountAliasResponse) GetAccountRequest(com.zimbra.soap.admin.message.GetAccountRequest) SoapFaultException(com.zimbra.common.soap.SoapFaultException) Test(org.junit.Test)

Aggregations

MailboxByAccountIdSelector (com.zimbra.soap.admin.type.MailboxByAccountIdSelector)7 Server (com.zimbra.cs.account.Server)3 SoapFaultException (com.zimbra.common.soap.SoapFaultException)2 SoapProvisioning (com.zimbra.cs.account.soap.SoapProvisioning)2 AddAccountAliasRequest (com.zimbra.soap.admin.message.AddAccountAliasRequest)2 AddAccountAliasResponse (com.zimbra.soap.admin.message.AddAccountAliasResponse)2 DeleteAccountRequest (com.zimbra.soap.admin.message.DeleteAccountRequest)2 GetAccountRequest (com.zimbra.soap.admin.message.GetAccountRequest)2 GetMailboxRequest (com.zimbra.soap.admin.message.GetMailboxRequest)2 RemoveAccountAliasRequest (com.zimbra.soap.admin.message.RemoveAccountAliasRequest)2 RenameAccountRequest (com.zimbra.soap.admin.message.RenameAccountRequest)2 Test (org.junit.Test)2 Account (com.zimbra.cs.account.Account)1 CreateAccountRequest (com.zimbra.soap.admin.message.CreateAccountRequest)1 CreateAccountResponse (com.zimbra.soap.admin.message.CreateAccountResponse)1 DeleteAccountResponse (com.zimbra.soap.admin.message.DeleteAccountResponse)1 GetAccountResponse (com.zimbra.soap.admin.message.GetAccountResponse)1 GetMailboxResponse (com.zimbra.soap.admin.message.GetMailboxResponse)1 RemoveAccountAliasResponse (com.zimbra.soap.admin.message.RemoveAccountAliasResponse)1 RenameAccountResponse (com.zimbra.soap.admin.message.RenameAccountResponse)1