Search in sources :

Example 1 with ReindexProgressInfo

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

the class SoapProvisioning method reIndex.

public ReIndexInfo reIndex(Account acct, String action, ReIndexBy by, String[] values) throws ServiceException {
    Server server = getServer(acct);
    ReindexMailboxInfo mbox = new ReindexMailboxInfo(acct.getId());
    if (by != null) {
        String vals = StringUtil.join(",", values);
        if (by == ReIndexBy.types) {
            mbox.setTypes(vals);
        } else {
            mbox.setIds(vals);
        }
    }
    ReIndexRequest req = new ReIndexRequest(action, mbox);
    ReIndexResponse resp = this.invokeJaxb(req, server.getAttr(A_zimbraServiceHostname));
    ReIndexInfo.Progress progress = null;
    ReindexProgressInfo progInfo = resp.getProgress();
    if (progInfo != null) {
        progress = new ReIndexInfo.Progress(progInfo.getNumSucceeded(), progInfo.getNumFailed(), progInfo.getNumRemaining());
    }
    return new ReIndexInfo(resp.getStatus(), progress);
}
Also used : ReindexProgressInfo(com.zimbra.soap.admin.type.ReindexProgressInfo) Server(com.zimbra.cs.account.Server) ReindexMailboxInfo(com.zimbra.soap.admin.type.ReindexMailboxInfo)

Aggregations

Server (com.zimbra.cs.account.Server)1 ReindexMailboxInfo (com.zimbra.soap.admin.type.ReindexMailboxInfo)1 ReindexProgressInfo (com.zimbra.soap.admin.type.ReindexProgressInfo)1