Search in sources :

Example 1 with IVersionCheckDataProvider

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);
}
Also used : VersionChecker(org.pentaho.versionchecker.VersionChecker) IVersionCheckDataProvider(org.pentaho.versionchecker.IVersionCheckDataProvider) IVersionCheckResultHandler(org.pentaho.versionchecker.IVersionCheckResultHandler) IVersionCheckErrorHandler(org.pentaho.versionchecker.IVersionCheckErrorHandler)

Aggregations

IVersionCheckDataProvider (org.pentaho.versionchecker.IVersionCheckDataProvider)1 IVersionCheckErrorHandler (org.pentaho.versionchecker.IVersionCheckErrorHandler)1 IVersionCheckResultHandler (org.pentaho.versionchecker.IVersionCheckResultHandler)1 VersionChecker (org.pentaho.versionchecker.VersionChecker)1