本文整理汇总了Java中org.pentaho.di.core.CheckResultInterface类的典型用法代码示例。如果您正苦于以下问题:Java CheckResultInterface类的具体用法?Java CheckResultInterface怎么用?Java CheckResultInterface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CheckResultInterface类属于org.pentaho.di.core包,在下文中一共展示了CheckResultInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
boolean res = andValidator().validate(this, "arguments", remarks, putValidators(notNullValidator()));
if (res == false)
{
return;
}
ValidatorContext ctx = new ValidatorContext();
putVariableSpace(ctx, getVariables());
putValidators(ctx, notNullValidator(), fileExistsValidator());
for (int i = 0; i < source_filefolder.length; i++)
{
andValidator().validate(this, "arguments[" + i + "]", remarks, ctx);
}
}
示例2: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
Repository repository, IMetaStore metaStore ) {
// see if we have fields from previous steps
if ( prev == null || prev.size() == 0 ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_WARNING,
BaseMessages.getString( PKG, "BAServerUtils.CheckResult.NotReceivingFieldsFromPreviousSteps" ),
stepMeta ) );
} else {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages
.getString( PKG, "BAServerUtils.CheckResult.ReceivingFieldsFromPreviousSteps", "" + prev.size() ),
stepMeta ) );
}
// see if we have input streams leading to this step
if ( input.length > 0 ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_OK,
BaseMessages.getString( PKG, "BAServerUtils.CheckResult.ReceivingInfoFromOtherSteps" ), stepMeta ) );
} else {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "BAServerUtils.CheckResult.NotReceivingInfoFromOtherSteps" ),
stepMeta ) );
}
}
示例3: validate
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public boolean validate(CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks,
ValidatorContext context) {
Object result = null;
String value = null;
value = getValueAsString(source, propertyName);
if (GenericValidator.isBlankOrNull(value)) {
return true;
}
result = GenericTypeValidator.formatInt(value);
if (result == null) {
addFailureRemark(source, propertyName, VALIDATOR_NAME, remarks, getLevelOnFail(context, VALIDATOR_NAME));
return false;
}
return true;
}
示例4: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
ValidatorContext ctx1 = new ValidatorContext();
putVariableSpace(ctx1, getVariables());
putValidators(ctx1, notBlankValidator(), fileDoesNotExistValidator());
andValidator().validate(this, "zipFilename", remarks, ctx1);//$NON-NLS-1$
if (2 == afterunzip) {
// setting says to move
andValidator().validate(this, "moveToDirectory", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
}
andValidator().validate(this, "sourceDirectory", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
}
示例5: addOkRemark
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public static void addOkRemark(CheckResultSourceInterface source, String propertyName,
List<CheckResultInterface> remarks)
{
final int SUBSTRING_LENGTH = 20;
LogWriter log = LogWriter.getInstance();
log.logBasic(JobEntryValidatorUtils.class.getSimpleName(), "attempting to fetch property named '" + propertyName
+ "'");
String value = ValidatorUtils.getValueAsString(source, propertyName);
log.logBasic(JobEntryValidatorUtils.class.getSimpleName(), "fetched value [" + value + "]");
String substr = null;
if (value != null)
{
substr = value.substring(0, Math.min(SUBSTRING_LENGTH, value.length()));
if (value.length() > SUBSTRING_LENGTH)
{
substr += "..."; //$NON-NLS-1$
}
}
remarks.add(new CheckResult(CheckResultInterface.TYPE_RESULT_OK, ValidatorMessages.getString("messages.passed", //$NON-NLS-1$
propertyName, substr), source));
}
示例6: validate
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public boolean validate(CheckResultSourceInterface source, String propertyName, List<CheckResultInterface> remarks,
ValidatorContext context)
{
String value = null;
value = getValueAsString(source, propertyName);
if (!GenericValidator.isBlankOrNull(value) && !GenericValidator.isEmail(value))
{
JobEntryValidatorUtils.addFailureRemark(source, propertyName, VALIDATOR_NAME, remarks, JobEntryValidatorUtils
.getLevelOnFail(context, VALIDATOR_NAME));
return false;
} else
{
return true;
}
}
示例7: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
if (setLogfile) {
andValidator().validate(this, "logfile", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
}
if (null != directory) {
// if from repo
andValidator().validate(this, "directory", remarks, putValidators(notNullValidator())); //$NON-NLS-1$
andValidator().validate(this, "jobName", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
} else {
// else from xml file
andValidator().validate(this, "filename", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
}
}
示例8: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
andValidator().validate(this, "server", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
andValidator().validate(this, "replyAddress", remarks, putValidators(notBlankValidator(), emailValidator())); //$NON-NLS-1$
andValidator().validate(this, "destination", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
if (usingAuthentication)
{
andValidator().validate(this, "authenticationUser", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
andValidator().validate(this, "authenticationPassword", remarks, putValidators(notNullValidator())); //$NON-NLS-1$
}
andValidator().validate(this, "port", remarks, putValidators(integerValidator())); //$NON-NLS-1$
}
示例9: getFields
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public void getFields(RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep, VariableSpace space) throws KettleStepException
{
List<CheckResultInterface> remarks = new ArrayList<CheckResultInterface>();
RowMetaAndData rowMetaAndData = RowGenerator.buildRow(this, remarks, origin);
if (!remarks.isEmpty()) {
StringBuffer stringRemarks = new StringBuffer();
for (CheckResultInterface remark : remarks) {
stringRemarks.append(remark.toString()).append(Const.CR);
}
throw new KettleStepException(stringRemarks.toString());
}
for (ValueMetaInterface valueMeta : rowMetaAndData.getRowMeta().getValueMetaList()) {
valueMeta.setOrigin(origin);
}
row.mergeRowMeta(rowMetaAndData.getRowMeta());
}
示例10: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
boolean res = andValidator().validate(this, "arguments", remarks, putValidators(notNullValidator()));
if (res == false)
{
return;
}
ValidatorContext ctx = new ValidatorContext();
putVariableSpace(ctx, getVariables());
putValidators(ctx, notNullValidator(), fileExistsValidator());
for (int i = 0; i < arguments.length; i++)
{
andValidator().validate(this, "arguments[" + i + "]", remarks, ctx);
}
}
示例11: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
ValidatorContext ctx1 = new ValidatorContext();
putVariableSpace(ctx1, getVariables());
putValidators(ctx1, notBlankValidator(), fileDoesNotExistValidator());
if (3 == ifzipfileexists) {
// execute method fails if the file already exists; we should too
putFailIfExists(ctx1, true);
}
andValidator().validate(this, "zipFilename", remarks, ctx1);//$NON-NLS-1$
if (2 == afterzip) {
// setting says to move
andValidator().validate(this, "moveToDirectory", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
}
andValidator().validate(this, "sourceDirectory", remarks, putValidators(notBlankValidator())); //$NON-NLS-1$
}
示例12: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
IMetaStore metaStore ) {
if ( broker == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidBroker" ), stepMeta ) );
}
if ( topic == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidTopic" ), stepMeta ) );
}
if ( field == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidField" ), stepMeta ) );
}
if ( clientId == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidClientID" ), stepMeta ) );
}
if ( timeout == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidConnectionTimeout" ), stepMeta ) );
}
if ( qos == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidQOS" ), stepMeta ) );
}
if ( requiresAuth ) {
if ( username == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidUsername" ), stepMeta ) );
}
if ( password == null ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "MQTTClientMeta.Check.InvalidPassword" ), stepMeta ) );
}
}
}
示例13: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev,
String[] input, String[] output, RowMetaInterface info, VariableSpace space, Repository repository,
IMetaStore metaStore ) {
super.check( remarks, transMeta, stepMeta, prev, input, output, info, space, repository, metaStore );
if ( Const.isEmpty( getTicketFieldName() ) ) {
remarks.add(
new CheckResult( CheckResult.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "ZendeskOutputSuspendedTicketsMeta.CheckResult.ErrorNoTicketField" ),
stepMeta ) );
} else if ( prev.indexOfValue( getTicketFieldName() ) >= 0 ) {
if ( ValueMetaInterface.TYPE_INTEGER == prev.getValueMeta(
prev.indexOfValue( getTicketFieldName() ) ).getType() ) {
remarks.add(
new CheckResult( CheckResult.TYPE_RESULT_OK,
BaseMessages.getString( PKG, "ZendeskOutputSuspendedTicketsMeta.CheckResult.OkTicketField" ),
stepMeta ) );
} else {
remarks.add(
new CheckResult( CheckResult.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "ZendeskOutputSuspendedTicketsMeta.CheckResult.ErrorTicketFieldWrongType" ),
stepMeta ) );
}
} else {
remarks.add(
new CheckResult( CheckResult.TYPE_RESULT_ERROR,
BaseMessages.getString( PKG, "ZendeskOutputSuspendedTicketsMeta.CheckResult.ErrorTicketFieldNotInRow" ),
stepMeta ) );
}
if ( Const.isEmpty( getResultFieldName() ) ) {
remarks.add(
new CheckResult( CheckResult.TYPE_RESULT_WARNING,
BaseMessages.getString( PKG, "ZendeskOutputSuspendedTicketsMeta.CheckResult.ErrorNoResultField" ),
stepMeta ) );
}
}
示例14: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
Repository repository, IMetaStore metaStore ) {
// see if we have all variables specified
int nrRemarks = remarks.size();
for ( int i = 0; i < fieldName.length; i++ ) {
if ( Const.isEmpty( variableName[ i ] ) ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString( PKG, "GetSessionVariable.CheckResult.VariableNotSpecified", fieldName[ i ] ), stepMeta ) );
}
}
if ( remarks.size() == nrRemarks ) {
remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_OK, BaseMessages.getString( PKG, "GetSessionVariable.CheckResult.AllVariablesSpecified" ), stepMeta ) );
}
}
示例15: check
import org.pentaho.di.core.CheckResultInterface; //导入依赖的package包/类
@Override
public void check(List<CheckResultInterface> remarks, JobMeta jobMeta)
{
ValidatorContext ctx = new ValidatorContext();
putVariableSpace(ctx, getVariables());
putValidators(ctx, notBlankValidator(), fileExistsValidator());
andValidator().validate(this, "xsdFilename", remarks, ctx);//$NON-NLS-1$
andValidator().validate(this, "xmlFilename", remarks, ctx);//$NON-NLS-1$
}