Search in sources :

Example 1 with ReIndexBy

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

the class ProvUtil method doReIndexMailbox.

private void doReIndexMailbox(String[] args) throws ServiceException {
    if (!(prov instanceof SoapProvisioning)) {
        throwSoapOnly();
    }
    SoapProvisioning sp = (SoapProvisioning) prov;
    Account acct = lookupAccount(args[1]);
    ReIndexBy by = null;
    String[] values = null;
    if (args.length > 3) {
        try {
            by = ReIndexBy.valueOf(args[3]);
        } catch (IllegalArgumentException e) {
            throw ServiceException.INVALID_REQUEST("invalid reindex-by", null);
        }
        if (args.length > 4) {
            values = new String[args.length - 4];
            System.arraycopy(args, 4, values, 0, args.length - 4);
        } else {
            throw ServiceException.INVALID_REQUEST("missing reindex-by values", null);
        }
    }
    ReIndexInfo info = sp.reIndex(acct, args[2], by, values);
    ReIndexInfo.Progress progress = info.getProgress();
    console.printf("status: %s\n", info.getStatus());
    if (progress != null) {
        console.printf("progress: numSucceeded=%d, numFailed=%d, numRemaining=%d\n", progress.getNumSucceeded(), progress.getNumFailed(), progress.getNumRemaining());
    }
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) ReIndexBy(com.zimbra.cs.account.soap.SoapProvisioning.ReIndexBy) ReIndexInfo(com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo)

Aggregations

SoapProvisioning (com.zimbra.cs.account.soap.SoapProvisioning)1 ReIndexBy (com.zimbra.cs.account.soap.SoapProvisioning.ReIndexBy)1 ReIndexInfo (com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo)1