本文整理匯總了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$
}