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