use of org.pentaho.versionchecker.IVersionCheckDataProvider in project pentaho-platform by pentaho.
the class PentahoVersionCheckHelper method performUpdate.
public void performUpdate() {
IVersionCheckResultHandler resultHandler = new IVersionCheckResultHandler() {
public void processResults(String results) {
// parse xml results vs spewing out xml?
resultList.add(results);
}
};
IVersionCheckErrorHandler errorHandler = new IVersionCheckErrorHandler() {
public void handleException(Exception e) {
// $NON-NLS-1$ //$NON-NLS-2$
resultList.add("<vercheck><error><![CDATA[" + e.getMessage() + "]]></error></vercheck>");
}
};
// PentahoVersionCheckDataProvider dataProvider = new PentahoVersionCheckDataProvider();
IVersionCheckDataProvider dataProvider = // $NON-NLS-1$
PentahoSystem.get(IVersionCheckDataProvider.class, "IVersionCheckDataProvider", null);
if (dataProvider == null) {
dataProvider = new PentahoVersionCheckDataProvider();
}
if (versionRequestFlags != -1) {
dataProvider.setVersionRequestFlags(versionRequestFlags);
}
VersionChecker vc = new VersionChecker();
vc.setDataProvider(dataProvider);
vc.addResultHandler(resultHandler);
vc.addErrorHandler(errorHandler);
vc.performCheck(ignoreExistingUpdates);
}
Aggregations