use of com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo in project zm-mailbox by Zimbra.
the class TestReIndex method statusIdle.
@Test
public void statusIdle() throws Exception {
Account account = TestUtil.getAccount("user1");
SoapProvisioning prov = TestProvisioningUtil.getSoapProvisioning();
ReIndexInfo info = prov.reIndex(account, "status", null, null);
Assert.assertEquals("idle", info.getStatus());
}
use of com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo in project zm-mailbox by Zimbra.
the class TestJaxbProvisioning method testIndex.
@Test
public void testIndex() throws Exception {
ZimbraLog.test.debug("Starting testIndex");
Account acct = ensureMailboxExists(testAcctEmail);
ReIndexInfo info = prov.reIndex(acct, "start", null, null);
assertNotNull("ReIndexInfo", info);
assertNotNull("getStatus result", info.getStatus());
// Progress can be null.
// Progress prog = info.getProgress();
VerifyIndexResult ndxRes = prov.verifyIndex(acct);
assertNotNull("VerifyIndexResult", ndxRes);
prov.deleteMailbox(acct.getId());
}
use of com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo 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());
}
}
Aggregations