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());
}
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());
}
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();
}
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();
}
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 ");
}
}
Aggregations