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);
}
}
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);
}
}
}
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;
}
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);
}
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);
}
Aggregations