Search in sources :

Example 1 with ReIndexInfo

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());
}
Also used : Account(com.zimbra.cs.account.Account) SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) ReIndexInfo(com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo) Test(org.junit.Test)

Example 2 with ReIndexInfo

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());
}
Also used : Account(com.zimbra.cs.account.Account) VerifyIndexResult(com.zimbra.cs.account.soap.SoapProvisioning.VerifyIndexResult) ReIndexInfo(com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo) Test(org.junit.Test)

Example 3 with ReIndexInfo

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

ReIndexInfo (com.zimbra.cs.account.soap.SoapProvisioning.ReIndexInfo)3 Account (com.zimbra.cs.account.Account)2 SoapProvisioning (com.zimbra.cs.account.soap.SoapProvisioning)2 Test (org.junit.Test)2 ReIndexBy (com.zimbra.cs.account.soap.SoapProvisioning.ReIndexBy)1 VerifyIndexResult (com.zimbra.cs.account.soap.SoapProvisioning.VerifyIndexResult)1