Search in sources :

Example 6 with ICheckResult

use of org.apache.hop.core.ICheckResult in project hop by apache.

the class PGPDecryptStreamMeta method check.

@Override
public void check(List<ICheckResult> remarks, PipelineMeta pipelineMeta, TransformMeta transformMeta, IRowMeta prev, String[] input, String[] output, IRowMeta info, IVariables variables, IHopMetadataProvider metadataProvider) {
    CheckResult cr;
    String errorMessage = "";
    if (Utils.isEmpty(gpgLocation)) {
        errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.GPGLocationMissing");
        cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta);
        remarks.add(cr);
    } else {
        errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.GPGLocationOK");
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, errorMessage, transformMeta);
    }
    if (!isPassphraseFromField()) {
        // Check static pass-phrase
        if (Utils.isEmpty(passhrase)) {
            errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.PassphraseMissing");
            cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta);
            remarks.add(cr);
        } else {
            errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.PassphraseOK");
            cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, errorMessage, transformMeta);
        }
    }
    if (Utils.isEmpty(resultfieldname)) {
        errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.ResultFieldMissing");
        cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta);
        remarks.add(cr);
    } else {
        errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.ResultFieldOK");
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, errorMessage, transformMeta);
        remarks.add(cr);
    }
    if (Utils.isEmpty(streamfield)) {
        errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.StreamFieldMissing");
        cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta);
        remarks.add(cr);
    } else {
        errorMessage = BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.StreamFieldOK");
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, errorMessage, transformMeta);
        remarks.add(cr);
    }
    // See if we have input streams leading to this transform!
    if (input.length > 0) {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.ReceivingInfoFromOtherTransforms"), transformMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "PGPDecryptStreamMeta.CheckResult.NoInpuReceived"), transformMeta);
        remarks.add(cr);
    }
}
Also used : ICheckResult(org.apache.hop.core.ICheckResult) CheckResult(org.apache.hop.core.CheckResult) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString)

Example 7 with ICheckResult

use of org.apache.hop.core.ICheckResult in project hop by apache.

the class ConcatFieldsMeta method check.

@Override
public void check(List<ICheckResult> remarks, PipelineMeta pipelineMeta, TransformMeta transformMeta, IRowMeta prev, String[] input, String[] output, IRowMeta info, IVariables variables, IHopMetadataProvider metadataProvider) {
    CheckResult cr;
    // Check Target Field Name
    if (StringUtil.isEmpty(targetFieldName)) {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ConcatFieldsMeta.CheckResult.TargetFieldNameMissing"), transformMeta);
        remarks.add(cr);
    }
    // Check Target Field Length when Fast Data Dump
    if (targetFieldLength <= 0) {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_WARNING, BaseMessages.getString(PKG, "ConcatFieldsMeta.CheckResult.TargetFieldLengthMissingFastDataDump"), transformMeta);
        remarks.add(cr);
    }
    // Check output fields
    if (prev != null && prev.size() > 0) {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ConcatFieldsMeta.CheckResult.FieldsReceived", "" + prev.size()), transformMeta);
        remarks.add(cr);
        String errorMessage = "";
        boolean errorFound = false;
        // Starting from selected fields in ...
        for (int i = 0; i < getOutputFields().length; i++) {
            int idx = prev.indexOfValue(getOutputFields()[i].getName());
            if (idx < 0) {
                errorMessage += "\t\t" + getOutputFields()[i].getName() + Const.CR;
                errorFound = true;
            }
        }
        if (errorFound) {
            errorMessage = BaseMessages.getString(PKG, "ConcatFieldsMeta.CheckResult.FieldsNotFound", errorMessage);
            cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, errorMessage, transformMeta);
            remarks.add(cr);
        } else {
            cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ConcatFieldsMeta.CheckResult.AllFieldsFound"), transformMeta);
            remarks.add(cr);
        }
    }
}
Also used : ICheckResult(org.apache.hop.core.ICheckResult) CheckResult(org.apache.hop.core.CheckResult) ValueMetaString(org.apache.hop.core.row.value.ValueMetaString)

Example 8 with ICheckResult

use of org.apache.hop.core.ICheckResult in project hop by apache.

the class Constant method init.

@Override
public boolean init() {
    data.firstRow = true;
    if (super.init()) {
        // Create a row (constants) with all the values in it...
        // stores the errors...
        List<ICheckResult> remarks = new ArrayList<>();
        data.constants = buildRow(meta, data, remarks);
        if (remarks.isEmpty()) {
            return true;
        } else {
            for (int i = 0; i < remarks.size(); i++) {
                ICheckResult cr = remarks.get(i);
                logError(cr.getText());
            }
        }
    }
    return false;
}
Also used : ICheckResult(org.apache.hop.core.ICheckResult) ArrayList(java.util.ArrayList)

Example 9 with ICheckResult

use of org.apache.hop.core.ICheckResult in project hop by apache.

the class ConstantMeta method check.

@Override
public void check(List<ICheckResult> remarks, PipelineMeta pipelineMeta, TransformMeta transformMeta, IRowMeta prev, String[] input, String[] output, IRowMeta info, IVariables variables, IHopMetadataProvider metadataProvider) {
    CheckResult cr;
    if (prev != null && prev.size() > 0) {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "ConstantMeta.CheckResult.FieldsReceived", "" + prev.size()), transformMeta);
        remarks.add(cr);
    } else {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_ERROR, BaseMessages.getString(PKG, "ConstantMeta.CheckResult.NoFields"), transformMeta);
        remarks.add(cr);
    }
    // Check the constants...
    ConstantData data = new ConstantData();
    ConstantMeta meta = (ConstantMeta) transformMeta.getTransform();
    Constant.buildRow(meta, data, remarks);
}
Also used : ICheckResult(org.apache.hop.core.ICheckResult) CheckResult(org.apache.hop.core.CheckResult)

Example 10 with ICheckResult

use of org.apache.hop.core.ICheckResult in project hop by apache.

the class CubeOutputMeta method check.

@Override
public void check(List<ICheckResult> remarks, PipelineMeta pipelineMeta, TransformMeta transformMeta, IRowMeta prev, String[] input, String[] output, IRowMeta info, IVariables variables, IHopMetadataProvider metadataProvider) {
    CheckResult cr;
    // Check output fields
    if (prev != null && prev.size() > 0) {
        cr = new CheckResult(ICheckResult.TYPE_RESULT_OK, BaseMessages.getString(PKG, "CubeOutputMeta.CheckResult.ReceivingFields", String.valueOf(prev.size())), transformMeta);
        remarks.add(cr);
    }
    cr = new CheckResult(ICheckResult.TYPE_RESULT_COMMENT, BaseMessages.getString(PKG, "CubeOutputMeta.CheckResult.FileSpecificationsNotChecked"), transformMeta);
    remarks.add(cr);
}
Also used : ICheckResult(org.apache.hop.core.ICheckResult) CheckResult(org.apache.hop.core.CheckResult)

Aggregations

ICheckResult (org.apache.hop.core.ICheckResult)169 CheckResult (org.apache.hop.core.CheckResult)154 ValueMetaString (org.apache.hop.core.row.value.ValueMetaString)25 IValueMeta (org.apache.hop.core.row.IValueMeta)23 IRowMeta (org.apache.hop.core.row.IRowMeta)18 HopException (org.apache.hop.core.exception.HopException)16 FileInputList (org.apache.hop.core.fileinput.FileInputList)13 Database (org.apache.hop.core.database.Database)11 Test (org.junit.Test)11 ArrayList (java.util.ArrayList)8 DatabaseMeta (org.apache.hop.core.database.DatabaseMeta)6 IStream (org.apache.hop.pipeline.transform.stream.IStream)6 RowMetaAndData (org.apache.hop.core.RowMetaAndData)5 HopTransformException (org.apache.hop.core.exception.HopTransformException)5 IHopMetadataProvider (org.apache.hop.metadata.api.IHopMetadataProvider)5 PipelineMeta (org.apache.hop.pipeline.PipelineMeta)5 TransformMeta (org.apache.hop.pipeline.transform.TransformMeta)5 SalesforceMetaTest (org.apache.hop.pipeline.transforms.salesforce.SalesforceMetaTest)5 File (java.io.File)4 Variables (org.apache.hop.core.variables.Variables)4