use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapDomain method modifyAttrs.
public void modifyAttrs(SoapProvisioning prov, Map<String, ? extends Object> attrs, boolean checkImmutable) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.MODIFY_DOMAIN_REQUEST);
req.addElement(AdminConstants.E_ID).setText(getId());
SoapProvisioning.addAttrElements(req, attrs);
setAttrs(SoapProvisioning.getAttrs(prov.invoke(req).getElement(AdminConstants.E_DOMAIN)));
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method getCreateObjectAttrs.
@Override
public RightCommand.EffectiveRights getCreateObjectAttrs(String targetType, DomainBy domainBy, String domain, CosBy cosBy, String cos, GranteeBy granteeBy, String grantee) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.GET_CREATE_OBJECT_ATTRS_REQUEST);
Element eTarget = req.addElement(AdminConstants.E_TARGET);
eTarget.addAttribute(AdminConstants.A_TYPE, targetType);
if (domainBy != null && domain != null) {
Element eDomain = req.addElement(AdminConstants.E_DOMAIN);
eDomain.addAttribute(AdminConstants.A_BY, domainBy.toString());
eDomain.setText(domain);
}
if (cosBy != null && cos != null) {
Element eCos = req.addElement(AdminConstants.E_COS);
eCos.addAttribute(AdminConstants.A_BY, cosBy.toString());
eCos.setText(cos);
}
/*
if (granteeBy != null && grantee != null)
toXML(req, null, granteeBy, grantee);
*/
Element resp = invoke(req);
return RightCommand.EffectiveRights.fromXML_CreateObjectAttrs(resp);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class BlobConsistencyUtil method getAllMailboxIds.
private List<Integer> getAllMailboxIds(SoapProvisioning prov) throws ServiceException {
List<Integer> ids = new ArrayList<Integer>();
XMLElement request = new XMLElement(AdminConstants.GET_ALL_MAILBOXES_REQUEST);
Element response = prov.invoke(request);
for (Element mboxEl : response.listElements(AdminConstants.E_MAILBOX)) {
ids.add((int) mboxEl.getAttributeLong(AdminConstants.A_ID));
}
return ids;
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method soapAdminAuthenticate.
public void soapAdminAuthenticate(ZAuthToken zat) throws ServiceException {
// TODO: Do we need 3rd party AuthToken support in JAXB before we can migrate to JAXB?
if (mTransport == null)
throw ZClientException.CLIENT_ERROR("must call setURI before calling adminAuthenticate", null);
XMLElement req = new XMLElement(AdminConstants.AUTH_REQUEST);
zat.encodeAuthReq(req, true);
Element response = invoke(req);
mAuthToken = new ZAuthToken(response.getElement(AdminConstants.E_AUTH_TOKEN), true);
mAuthTokenLifetime = response.getAttributeLong(AdminConstants.E_LIFETIME);
mAuthTokenExpiration = System.currentTimeMillis() + mAuthTokenLifetime;
mTransport.setAuthToken(mAuthToken);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method preAuthAccount.
@Override
public void preAuthAccount(Account acct, String accountName, String accountBy, long timestamp, long expires, String preAuth, Map<String, Object> authCtxt) throws ServiceException {
XMLElement req = new XMLElement(AccountConstants.AUTH_REQUEST);
Element a = req.addElement(AccountConstants.E_ACCOUNT);
a.addAttribute(AccountConstants.A_BY, "name");
a.setText(accountName);
Element p = req.addElement(AccountConstants.E_PREAUTH);
p.addAttribute(AccountConstants.A_TIMESTAMP, timestamp);
p.addAttribute(AccountConstants.A_BY, accountBy);
p.addAttribute(AccountConstants.A_EXPIRES, expires);
p.setText(preAuth);
invoke(req);
}
Aggregations