use of com.zimbra.soap.mail.message.TestDataSourceResponse in project zm-mailbox by Zimbra.
the class ZMailbox method testDataSource.
/**
* Tests a data source.
*
* @return <tt>null</tt> on success, or the error string on failure
*/
public String testDataSource(ZDataSource source) throws ServiceException {
TestDataSourceRequest req = new TestDataSourceRequest();
DataSource jaxbObj = source.toJaxb();
req.setDataSource(jaxbObj);
TestDataSourceResponse resp = (TestDataSourceResponse) invokeJaxb(req);
List<TestDataSource> dataSources = resp.getDataSources();
int success = 0;
if (dataSources.size() > 0 && dataSources.get(0) != null) {
TestDataSource ds = dataSources.get(0);
success = ds.getSuccess();
if (success < 1) {
return ds.getError();
} else {
return null;
}
}
return null;
}
Aggregations