use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class ProvUtil method doGetRightsDoc.
private void doGetRightsDoc(String[] args) throws ServiceException {
if (!(prov instanceof SoapProvisioning)) {
throwSoapOnly();
}
String[] packages;
StringBuilder argsDump = new StringBuilder();
if (args.length > 1) {
// args[0] is "grd", starting from args[1]
packages = new String[args.length - 1];
for (int i = 1; i < args.length; i++) {
packages[i - 1] = args[i];
argsDump.append(" " + args[i]);
}
} else {
packages = new String[] { "com.zimbra.cs.service.admin", "com.zimbra.bp", "com.zimbra.cert", "com.zimbra.cs.network", "com.zimbra.cs.network.license.service", "com.zimbra.cs.service.backup", "com.zimbra.cs.service.hsm", "com.zimbra.xmbxsearch" };
}
console.println("#");
console.println("# Generated by: zmprov grd" + argsDump);
console.println("#");
console.println("# Date: " + DateFormat.getDateInstance(DateFormat.LONG).format(new Date()));
console.println("# ");
console.println("# Packages:");
for (String pkg : packages) {
console.println("# " + pkg);
}
console.println("# ");
console.println("\n");
Map<String, List<RightsDoc>> allDocs = prov.getRightsDoc(packages);
for (Map.Entry<String, List<RightsDoc>> docs : allDocs.entrySet()) {
console.println("========================================");
console.println("Package: " + docs.getKey());
console.println("========================================");
console.println();
for (RightsDoc doc : docs.getValue()) {
console.println("------------------------------");
console.println(doc.getCmd() + "\n");
console.println(" Related rights:");
for (String r : doc.getRights()) {
console.println(" " + r);
}
console.println();
console.println(" Notes:");
for (String n : doc.getNotes()) {
console.println(FileGenUtil.wrapComments(StringUtil.escapeHtml(n), 70, " ") + "\n");
}
console.println();
}
}
}
use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class ProvUtil method lookupDomain.
private Domain lookupDomain(String key, Provisioning prov, boolean applyDefault) throws ServiceException {
Domain domain;
if (prov instanceof SoapProvisioning) {
SoapProvisioning soapProv = (SoapProvisioning) prov;
domain = soapProv.get(guessDomainBy(key), key, applyDefault);
} else {
domain = prov.get(guessDomainBy(key), key);
}
if (domain == null) {
throw AccountServiceException.NO_SUCH_DOMAIN(key);
} else {
return domain;
}
}
use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class ProvUtil method doVerifyIndex.
private void doVerifyIndex(String[] args) throws ServiceException {
if (!(prov instanceof SoapProvisioning)) {
throwSoapOnly();
}
console.println("Verifying, on a large index it can take quite a long time...");
SoapProvisioning soap = (SoapProvisioning) prov;
SoapProvisioning.VerifyIndexResult result = soap.verifyIndex(lookupAccount(args[1]));
console.println();
console.print(result.message);
if (!result.status) {
throw ServiceException.FAILURE("The index may be corrupted. Run reIndexMailbox(rim) to repair.", null);
}
}
use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class ProvUtil method doCompactIndexMailbox.
private void doCompactIndexMailbox(String[] args) throws ServiceException {
if (!(prov instanceof SoapProvisioning)) {
throwSoapOnly();
}
SoapProvisioning sp = (SoapProvisioning) prov;
Account acct = lookupAccount(args[1]);
String status = sp.compactIndex(acct, args[2]);
console.printf("status: %s\n", status);
}
use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class SoapProvTestUtil method getSoapProvisioning.
static SoapProvisioning getSoapProvisioning(String userName, String password) throws ServiceException {
SoapProvisioning sp = new SoapProvisioning();
sp.soapSetHttpTransportDebugListener(new SoapDebugListener());
sp.soapSetURI("https://localhost:7071" + AdminConstants.ADMIN_SERVICE_URI);
sp.soapAdminAuthenticate(userName, password);
return sp;
}
Aggregations