Search in sources :

Example 36 with ZAuthToken

use of com.zimbra.common.auth.ZAuthToken in project zm-mailbox by Zimbra.

the class TestUtil method getZMailboxAsAdmin.

public static ZMailbox getZMailboxAsAdmin(String username) throws ServiceException {
    ZAuthToken adminAuthToken = newSoapProvisioning().getAuthToken();
    ZMailbox.Options options = new ZMailbox.Options(adminAuthToken, getSoapUrl());
    options.setTargetAccount(getAddress(username));
    options.setTargetAccountBy(AccountBy.name);
    return ZMailbox.getMailbox(options);
}
Also used : TwoFactorOptions(com.zimbra.common.auth.twofactor.TwoFactorOptions) DeliveryOptions(com.zimbra.cs.mailbox.DeliveryOptions) Options(com.zimbra.client.ZMailbox.Options) ZMailbox(com.zimbra.client.ZMailbox) Options(com.zimbra.client.ZMailbox.Options) ZAuthToken(com.zimbra.common.auth.ZAuthToken)

Aggregations

ZAuthToken (com.zimbra.common.auth.ZAuthToken)36 ZMailbox (com.zimbra.client.ZMailbox)14 Element (com.zimbra.common.soap.Element)11 AuthToken (com.zimbra.cs.account.AuthToken)7 ZFolder (com.zimbra.client.ZFolder)6 ServiceException (com.zimbra.common.service.ServiceException)6 XMLElement (com.zimbra.common.soap.Element.XMLElement)6 Account (com.zimbra.cs.account.Account)6 IOException (java.io.IOException)6 HttpClient (org.apache.commons.httpclient.HttpClient)6 HttpState (org.apache.commons.httpclient.HttpState)6 Test (org.junit.Test)6 SoapHttpTransport (com.zimbra.common.soap.SoapHttpTransport)5 ItemId (com.zimbra.cs.service.util.ItemId)5 URI (java.net.URI)5 GetMethod (org.apache.commons.httpclient.methods.GetMethod)5 Folder (com.zimbra.cs.mailbox.Folder)3 Mailbox (com.zimbra.cs.mailbox.Mailbox)3 Options (com.zimbra.client.ZMailbox.Options)2 ZMountpoint (com.zimbra.client.ZMountpoint)2