public static boolean isPluginDocumented( PluginInterface plugin ) { if ( plugin == null ) { return false; } return !StringUtil.isEmpty( plugin.getDocumentationUrl() ); }
@Override public void modifyText( ModifyEvent modifyEvent ) { wOK.setEnabled( !StringUtil.isEmpty( wFieldname.getText() ) ); } };
/** * For legacy transformations containing AWS S3 access credentials, {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} can force Spoon to use * the Amazon Default Credentials Provider Chain instead of using the credentials embedded in the transformation metadata. * * @return true if {@link Const#KETTLE_USE_AWS_DEFAULT_CREDENTIALS} is true or AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are not specified */ public boolean getUseAwsDefaultCredentials() { if ( ValueMetaBase.convertStringToBoolean( Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_USE_AWS_DEFAULT_CREDENTIALS ), "N" ) ) ) { return true; } else if ( StringUtil.isEmpty( awsAccessKey ) && StringUtil.isEmpty( awsSecretKey ) ) { return true; } return false; }
if ( !StringUtil.isEmpty( username ) ) { options.setUserName( username ); if ( !StringUtil.isEmpty( password ) ) { options.setPassword( password.toCharArray() ); if ( !StringUtil.isEmpty( keepAliveInterval ) ) { options.setKeepAliveInterval( Integer.parseInt( keepAliveInterval ) ); if ( !StringUtil.isEmpty( maxInflight ) ) { options.setMaxInflight( Integer.parseInt( maxInflight ) ); if ( !StringUtil.isEmpty( connectionTimeout ) ) { options.setConnectionTimeout( Integer.parseInt( connectionTimeout ) ); if ( !StringUtil.isEmpty( cleanSession ) ) { options.setCleanSession( BooleanUtils.toBoolean( cleanSession ) ); if ( !StringUtil.isEmpty( serverUris ) ) { options.setServerURIs( Arrays.stream( serverUris.split( ";" ) ).map( uri -> getProtocol() + uri ).toArray( String[]::new ) ); if ( !StringUtil.isEmpty( mqttVersion ) ) { options.setMqttVersion( Integer.parseInt( mqttVersion ) ); if ( !StringUtil.isEmpty( automaticReconnect ) ) { options.setAutomaticReconnect( BooleanUtils.toBoolean( automaticReconnect ) );
} catch ( Exception e ) { String message = "Couldn't convert string to number " + e.toString(); if ( !isEmpty( pattern ) ) { message += " pattern=" + pattern; if ( !isEmpty( decimal ) ) { message += " decimal=" + decimal; if ( !isEmpty( grouping ) ) { message += " grouping=" + grouping.charAt( 0 ); if ( !isEmpty( currency ) ) { message += " currency=" + currency;
public static void checkLong( List<CheckResultInterface> remarks, StepMeta stepMeta, VariableSpace space, String identifier, String value ) { try { if ( !StringUtil.isEmpty( space.environmentSubstitute( value ) ) ) { Long.parseLong( space.environmentSubstitute( value ) ); } } catch ( NumberFormatException e ) { remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString( PKG, "StepOption.CheckResult.NotAInteger", identifier ), stepMeta ) ); } }
public static void checkInteger( List<CheckResultInterface> remarks, StepMeta stepMeta, VariableSpace space, String identifier, String value ) { try { if ( !StringUtil.isEmpty( space.environmentSubstitute( value ) ) ) { Integer.parseInt( space.environmentSubstitute( value ) ); } } catch ( NumberFormatException e ) { remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString( PKG, "StepOption.CheckResult.NotAInteger", identifier ), stepMeta ) ); } }
public static void checkBoolean( List<CheckResultInterface> remarks, StepMeta stepMeta, VariableSpace space, String identifier, String value ) { if ( !StringUtil.isEmpty( space.environmentSubstitute( value ) ) && null == BooleanUtils .toBooleanObject( space.environmentSubstitute( value ) ) ) { remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString( PKG, "StepOption.CheckResult.NotABoolean", identifier ), stepMeta ) ); } } }
static void checkVersion( List<CheckResultInterface> remarks, StepMeta stepMeta, VariableSpace space, String value ) { String version = space.environmentSubstitute( value ); if ( !StringUtil.isEmpty( version ) ) { try { ( new MqttConnectOptions() ).setMqttVersion( Integer.parseInt( version ) ); } catch ( Exception e ) { remarks.add( new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, getString( PKG, "MQTTMeta.CheckResult.NotCorrectVersion", getString( PKG, "MQTTDialog.Options." + MQTT_VERSION ), version ), stepMeta ) ); } } } }
@Override public void schemaSelection( PartitionSettings settings, Shell shell, SpoonDelegates delegates ) throws KettleException { String schema = super.askForSchema( settings.getSchemaNamesArray(), shell, settings.getDefaultSelectedSchemaIndex() ); super.processForKnownSchema( schema, settings ); if ( !StringUtil.isEmpty( schema ) ) { askForField( settings, delegates ); } }
try { TransMeta transMeta = mappingMetaRetriever.get( this, repository, metaStore, space ); if ( !StringUtil.isEmpty( getSubStep() ) ) { String realSubStepName = space.environmentSubstitute( getSubStep() ); if ( transMeta.getSteps().stream().anyMatch( stepMeta -> stepMeta.getName().equals( realSubStepName ) ) ) {
private void readData( Node stepnode ) throws KettleXMLException { try { rowThreshold = XMLHandler.getTagValue( stepnode, "row_threshold" ); message = XMLHandler.getTagValue( stepnode, "message" ); alwaysLogRows = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "always_log_rows" ) ); String abortOptionString = XMLHandler.getTagValue( stepnode, "abort_option" ); if ( !isEmpty( abortOptionString ) ) { abortOption = AbortOption.valueOf( abortOptionString ); } else { // Backwards compatibility String awe = XMLHandler.getTagValue( stepnode, "abort_with_error" ); if ( awe == null ) { awe = "Y"; // existing transformations will have to maintain backward compatibility with yes } abortOption = "Y".equalsIgnoreCase( awe ) ? AbortOption.ABORT_WITH_ERROR : AbortOption.ABORT; } } catch ( Exception e ) { throw new KettleXMLException( BaseMessages.getString( PKG, "AbortMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository" ), e ); } }
private void setOptions( JMSProducer producer ) { String optionValue = meta.getDisableMessageId(); getLogChannel().logDebug( "Disable Message ID is set to " + optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDisableMessageID( BooleanUtils.toBoolean( optionValue ) ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDisableMessageTimestamp( BooleanUtils.toBoolean( optionValue ) ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDeliveryMode( Integer.parseInt( optionValue ) ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setPriority( Integer.parseInt( optionValue ) ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setTimeToLive( Long.parseLong( optionValue ) ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setDeliveryDelay( Long.parseLong( optionValue ) ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setJMSCorrelationID( optionValue ); if ( !StringUtil.isEmpty( optionValue ) ) { producer.setJMSType( optionValue );
if ( !StringUtil.isEmpty( getSubStep() ) ) { String realSubStepName = space.environmentSubstitute( getSubStep() );
private void askForField( PartitionSettings settings, SpoonDelegates delegates ) throws KettleException { StepDialogInterface partitionDialog = delegates.steps.getPartitionerDialog( settings.getStepMeta(), settings.getStepMeta().getStepPartitioningMeta(), settings.getTransMeta() ); String fieldName = partitionDialog.open(); if ( StringUtil.isEmpty( fieldName ) ) { settings.rollback( settings.getBefore() ); } }
public MqttClient buildAndConnect() throws MqttException { validateArgs(); String protocolBroker = getProtocol() + this.broker; MqttClientPersistence persistence = new MemoryPersistence(); if ( StringUtil.isEmpty( storageLevel ) ) { logChannel.logDebug( "Using Memory Storage Level" ); } else { logChannel.logDebug( "Using File Storage Level to " + storageLevel ); persistence = new MqttDefaultFilePersistence( storageLevel ); } if ( StringUtil.isEmpty( clientId ) ) { clientId = MqttAsyncClient.generateClientId(); } MqttClient client = clientFactory.getClient( protocolBroker, clientId, persistence ); client.setCallback( callback ); logChannel.logDebug( "Subscribing to topics with a quality of service level of " + qos ); logChannel.logDebug( "Server URIs is set to " + serverUris ); logChannel.logDebug( "Max Inflight is set to " + maxInflight ); logChannel.logDebug( "Automatic Reconnect is set to " + automaticReconnect ); logChannel.logDebug( loggableOptions().toString() ); client.connect( getOptions() ); if ( topics != null && !topics.isEmpty() ) { client.subscribe( topics.toArray( new String[ 0 ] ), initializedIntAray( Integer.parseInt( this.qos ) ) ); } return client; }
public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException { try { rowThreshold = rep.getStepAttributeString( id_step, "row_threshold" ); message = rep.getStepAttributeString( id_step, "message" ); alwaysLogRows = rep.getStepAttributeBoolean( id_step, "always_log_rows" ); String abortOptionString = rep.getStepAttributeString( id_step, 0, "abort_option" ); if ( !isEmpty( abortOptionString ) ) { abortOption = AbortOption.valueOf( abortOptionString ); } else { // Backward compatibility // existing transformations will have to maintain backward compatibility with yes boolean abortWithError = rep.getStepAttributeBoolean( id_step, 0, "abort_with_error", true ); abortOption = abortWithError ? AbortOption.ABORT_WITH_ERROR : AbortOption.ABORT; } } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "AbortMeta.Exception.UnexpectedErrorInReadingStepInfoFromRepository" ), e ); } }
wOK.setEnabled( !StringUtil.isEmpty( wFieldname.getText() ) ); ModifyListener modifyListener = new ModifyListener() { @Override public void modifyText( ModifyEvent modifyEvent ) {
String partitionMethodDescription = methodSelector.askForPartitionMethod( shell, settings ); if ( !StringUtil.isEmpty( partitionMethodDescription ) ) { String method = settings.getMethodByMethodDescription( partitionMethodDescription ); int methodType = StepPartitioningMeta.getMethodType( method );