Search in sources :

Example 6 with SoapProvisioning

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

the class ProvUtil method doResetAllLoggers.

private void doResetAllLoggers(String[] args) throws ServiceException {
    if (!(prov instanceof SoapProvisioning)) {
        throwSoapOnly();
    }
    SoapProvisioning sprov = (SoapProvisioning) prov;
    String server = null;
    if (args.length > 1 && ("-s".equals(args[1]) || "--server".equals(args[1]))) {
        server = args.length > 0 ? args[2] : null;
    }
    sprov.resetAllLoggers(server);
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning)

Example 7 with SoapProvisioning

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

the class ProvUtil method lookupServer.

private Server lookupServer(String key, boolean applyDefault) throws ServiceException {
    Server server;
    if (prov instanceof SoapProvisioning) {
        SoapProvisioning soapProv = (SoapProvisioning) prov;
        server = soapProv.get(guessServerBy(key), key, applyDefault);
    } else {
        server = prov.get(guessServerBy(key), key);
    }
    if (server == null) {
        throw AccountServiceException.NO_SUCH_SERVER(key);
    } else {
        return server;
    }
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning)

Example 8 with SoapProvisioning

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

the class ProvUtil method initProvisioning.

public void initProvisioning() throws ServiceException {
    if (useLdap) {
        if (useLdapMaster) {
            LdapClient.masterOnly();
        }
        prov = Provisioning.getInstance();
    } else {
        SoapProvisioning sp = new SoapProvisioning();
        sp.soapSetURI(LC.zimbra_admin_service_scheme.value() + serverHostname + ":" + serverPort + AdminConstants.ADMIN_SERVICE_URI);
        if (debugLevel != SoapDebugLevel.none) {
            sp.soapSetHttpTransportDebugListener(this);
        }
        if (account != null && password != null) {
            sp.soapAdminAuthenticate(account, password);
        } else if (authToken != null) {
            sp.soapAdminAuthenticate(authToken);
        } else {
            sp.soapZimbraAdminAuthenticate();
        }
        prov = sp;
    }
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning)

Example 9 with SoapProvisioning

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

the class ProvUtil method doFlushCache.

private void doFlushCache(String[] args) throws ServiceException {
    if (!(prov instanceof SoapProvisioning)) {
        throwSoapOnly();
    }
    boolean allServers = false;
    int argIdx = 1;
    if (args[argIdx].equals("-a")) {
        allServers = true;
        if (args.length > 2) {
            argIdx++;
        } else {
            usage();
            return;
        }
    }
    String type = args[argIdx++];
    CacheEntry[] entries = null;
    if (args.length > argIdx) {
        entries = new CacheEntry[args.length - argIdx];
        for (int i = argIdx; i < args.length; i++) {
            Key.CacheEntryBy entryBy;
            if (Provisioning.isUUID(args[i])) {
                entryBy = Key.CacheEntryBy.id;
            } else {
                entryBy = Key.CacheEntryBy.name;
            }
            entries[i - argIdx] = new CacheEntry(entryBy, args[i]);
        }
    }
    SoapProvisioning sp = (SoapProvisioning) prov;
    sp.flushCache(type, entries, allServers);
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) CacheEntry(com.zimbra.cs.account.Provisioning.CacheEntry) Key(com.zimbra.common.account.Key)

Example 10 with SoapProvisioning

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

the class ProvUtil method doGetDomainInfo.

private void doGetDomainInfo(String[] args) throws ServiceException {
    if (!(prov instanceof SoapProvisioning)) {
        throwSoapOnly();
    }
    SoapProvisioning sp = (SoapProvisioning) prov;
    Key.DomainBy by = Key.DomainBy.fromString(args[1]);
    String key = args[2];
    Domain domain = sp.getDomainInfo(by, key);
    if (domain == null) {
        throw AccountServiceException.NO_SUCH_DOMAIN(key);
    } else {
        dumpDomain(domain, getArgNameSet(args, 3));
    }
}
Also used : SoapProvisioning(com.zimbra.cs.account.soap.SoapProvisioning) Key(com.zimbra.common.account.Key)

Aggregations

SoapProvisioning (com.zimbra.cs.account.soap.SoapProvisioning)78 Test (org.junit.Test)18 SoapFaultException (com.zimbra.common.soap.SoapFaultException)14 Account (com.zimbra.cs.account.Account)13 Attr (com.zimbra.soap.admin.type.Attr)10 ServiceException (com.zimbra.common.service.ServiceException)9 CreateDistributionListRequest (com.zimbra.soap.admin.message.CreateDistributionListRequest)6 CreateDistributionListResponse (com.zimbra.soap.admin.message.CreateDistributionListResponse)6 AccountLogger (com.zimbra.common.util.AccountLogger)5 Server (com.zimbra.cs.account.Server)5 CreateCalendarResourceRequest (com.zimbra.soap.admin.message.CreateCalendarResourceRequest)4 CreateCalendarResourceResponse (com.zimbra.soap.admin.message.CreateCalendarResourceResponse)4 DeleteCalendarResourceRequest (com.zimbra.soap.admin.message.DeleteCalendarResourceRequest)4 List (java.util.List)4 SoapHttpTransport (com.zimbra.common.soap.SoapHttpTransport)3 AccountServiceException (com.zimbra.cs.account.AccountServiceException)3 Provisioning (com.zimbra.cs.account.Provisioning)3 CacheEntry (com.zimbra.cs.account.Provisioning.CacheEntry)3 DeleteAccountRequest (com.zimbra.soap.admin.message.DeleteAccountRequest)3 DeleteAccountResponse (com.zimbra.soap.admin.message.DeleteAccountResponse)3