use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class TestZimbraHttpConnectionManager method runSoapProv.
private static void runSoapProv(String msg) {
System.out.println(msg);
SoapProvisioning sp = new SoapProvisioning();
String uri = LC.zimbra_admin_service_scheme.value() + LC.zimbra_zmprov_default_soap_server.value() + ":" + LC.zimbra_admin_service_port.intValue() + AdminConstants.ADMIN_SERVICE_URI;
sp.soapSetURI(uri);
try {
sp.getDomainInfo(Key.DomainBy.name, "phoebe.mac");
} catch (ServiceException e) {
e.printStackTrace();
}
}
use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class TestUtil method deleteAccount.
/**
* Deletes the account for the given username. Consider using {@link deleteAccountIfExists} as alternative
* to reduce logging where the account may not exist.
*/
public static void deleteAccount(String username) throws ServiceException {
Provisioning prov = Provisioning.getInstance();
// so that both the account and mailbox are deleted.
if (!(prov instanceof SoapProvisioning)) {
prov = newSoapProvisioning();
}
SoapProvisioning soapProv = (SoapProvisioning) prov;
GetAccountRequest gaReq = new GetAccountRequest(AccountSelector.fromName(username), false, Lists.newArrayList(Provisioning.A_zimbraId));
try {
GetAccountResponse resp = soapProv.invokeJaxb(gaReq);
if (resp != null) {
String id = null;
for (Attr attr : resp.getAccount().getAttrList()) {
if (Provisioning.A_zimbraId.equals(attr.getKey())) {
id = attr.getValue();
break;
}
}
if (null == id) {
ZimbraLog.test.error("GetAccountResponse for '%s' did not contain the zimbraId", username);
}
prov.deleteAccount(id);
}
} catch (SoapFaultException sfe) {
if (!sfe.getMessage().contains("no such account")) {
ZimbraLog.test.error("GetAccountResponse for '%s' hit unexpected problem", username, sfe);
}
}
}
use of com.zimbra.cs.account.soap.SoapProvisioning in project zm-mailbox by Zimbra.
the class TestUtil method newDelegatedSoapProvisioning.
public static SoapProvisioning newDelegatedSoapProvisioning(String login, String password) throws ServiceException {
SoapProvisioning sp = new SoapProvisioning();
sp.soapSetURI("https://localhost:7071" + AdminConstants.ADMIN_SERVICE_URI);
sp.soapAdminAuthenticate(login, password);
return sp;
}
Aggregations