Search in sources :

Example 1 with ConnectionEvaluator

use of org.talend.dq.indicators.ConnectionEvaluator in project tdq-studio-se by Talend.

the class ConnectionAnalysisExecutor method evaluate.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dq.analysis.AnalysisExecutor#runAnalysis(org.talend.dataquality.analysis.Analysis,
     * java.lang.String)
     */
@Override
protected ReturnCode evaluate(Analysis analysis, java.sql.Connection connection, String sqlStatement) {
    ConnectionEvaluator eval = new ConnectionEvaluator();
    // MOD xqliu 2009-02-09 bug 6237
    eval.setMonitor(getMonitor());
    // // --- add indicators
    EList<Indicator> indicators = analysis.getResults().getIndicators();
    for (Indicator indicator : indicators) {
        ModelElement analyzedElement = indicator.getAnalyzedElement();
        if (analyzedElement == null) {
            continue;
        }
        Connection dataProvider = SwitchHelpers.CONNECTION_SWITCH.doSwitch(analyzedElement);
        if (dataProvider == null) {
            continue;
        }
        eval.storeIndicator(dataProvider, indicator);
        // ADDED rli 2008-07-10 fixed for the SchemaIndicator will increased after connection analysis running.
        indicator.reset();
    }
    ReturnCode retCode = runAnalysisLow(analysis, sqlStatement, eval, connection);
    if (getMonitor() != null) {
        getMonitor().worked(compIndicatorsWorked);
    }
    return retCode;
}
Also used : ConnectionEvaluator(org.talend.dq.indicators.ConnectionEvaluator) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) ReturnCode(org.talend.utils.sugars.ReturnCode) Connection(org.talend.core.model.metadata.builder.connection.Connection) Indicator(org.talend.dataquality.indicators.Indicator)

Aggregations

Connection (org.talend.core.model.metadata.builder.connection.Connection)1 Indicator (org.talend.dataquality.indicators.Indicator)1 ConnectionEvaluator (org.talend.dq.indicators.ConnectionEvaluator)1 ReturnCode (org.talend.utils.sugars.ReturnCode)1 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)1