use of com.zimbra.soap.admin.message.GetDataSourcesRequest in project zm-mailbox by Zimbra.
the class GetDataSources method handle.
@Override
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZimbraSoapContext zsc = getZimbraSoapContext(context);
Provisioning prov = Provisioning.getInstance();
GetDataSourcesRequest req = JaxbUtil.elementToJaxb(request);
String id = req.getId();
Account account = prov.get(AccountBy.id, id, zsc.getAuthToken());
defendAgainstAccountOrCalendarResourceHarvesting(account, AccountBy.id, id, zsc, Admin.R_adminLoginAs, Admin.R_adminLoginCalendarResourceAs);
Element response = zsc.createElement(AdminConstants.GET_DATA_SOURCES_RESPONSE);
List<DataSource> sources = Provisioning.getInstance().getAllDataSources(account);
for (DataSource ds : sources) {
com.zimbra.cs.service.account.ToXML.encodeDataSource(response, ds);
}
return response;
}
Aggregations