use of com.zimbra.soap.admin.message.LockoutMailboxRequest in project zm-mailbox by Zimbra.
the class ProvUtil method sendMailboxLockoutRequest.
private void sendMailboxLockoutRequest(String acctName, String server, String operation) throws ServiceException, IOException {
LockoutMailboxRequest req = LockoutMailboxRequest.create(AccountNameSelector.fromName(acctName));
req.setOperation(operation);
String url = URLUtil.getAdminURL(server);
ZAuthToken token = ((SoapProvisioning) prov).getAuthToken();
SoapHttpTransport transport = new SoapHttpTransport(url);
transport.setAuthToken(token);
transport.invokeWithoutSession(JaxbUtil.jaxbToElement(req));
}
use of com.zimbra.soap.admin.message.LockoutMailboxRequest in project zm-mailbox by Zimbra.
the class TestLockoutMailbox method testUnlock.
@Test
public void testUnlock() throws Exception {
Mailbox mbox = TestUtil.getMailbox(MY_USER);
TestUtil.addMessage(mbox, "test");
TestUtil.waitForMessage(TestUtil.getZMailbox(MY_USER), "test");
assertFalse("mailbox should not be locked yet", MailboxManager.getInstance().isMailboxLockedOut(mbox.getAccountId()));
MailboxManager.getInstance().lockoutMailbox(mbox.getAccountId());
assertTrue("mailbox should be locked now", MailboxManager.getInstance().isMailboxLockedOut(mbox.getAccountId()));
LockoutMailboxRequest req = LockoutMailboxRequest.create(AccountNameSelector.fromName(MY_USER));
req.setOperation(AdminConstants.A_END);
LockoutMailboxResponse resp = adminSoapProv.invokeJaxb(req);
assertNotNull("LockoutMailboxRequest return null response", resp);
assertFalse("mailbox should not be locked any more", MailboxManager.getInstance().isMailboxLockedOut(mbox.getAccountId()));
}
Aggregations