public BoundPipelineElementBuilder withPredefinedFreeTextValue(String internalStaticPropertyId, String value) { this.streamPipesEntity.getStaticProperties().stream().filter(sp -> sp instanceof FreeTextStaticProperty).forEach(sp -> { if (sp.getInternalName().equals(internalStaticPropertyId)) { sp.setPredefined(true); ((FreeTextStaticProperty) sp).setValue(value); } }); return this; }
/** * Defines a number-based configuration parameter of type integer provided by pipeline developers at pipeline * authoring time and initializes the parameter with a default value. * @param label The {@link org.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a * user-friendly manner. * @param defaultValue The default integer value. * @return this */ public BU requiredIntegerParameter(Label label, Integer defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(label, XSD._integer.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
/** * Defines a number-based configuration parameter of type float provided by pipeline developers at pipeline * authoring time and initializes the parameter with a default value. * @param label The {@link org.streampipes.sdk.helpers.Label} that describes why this parameter is needed in a * user-friendly manner. * @param defaultValue The default integer value. * @return this */ public BU requiredFloatParameter(Label label, Float defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(label, XSD._double.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
/** * @deprecated Use {@link #requiredIntegerParameter(Label, Integer)} instead * @param internalId * @param label * @param description * @param defaultValue * @return */ public BU requiredIntegerParameter(String internalId, String label, String description, Integer defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId, label, description, XSD._integer.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
private DataProcessorInvocation updateStreamStoppedSepa(DataProcessorInvocation newSEPA, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(String.valueOf(streamUri)); } newStaticProperties.add(p); } newSEPA.setStaticProperties(newStaticProperties); return newSEPA; }
/** * @deprecated Use {@link #requiredFloatParameter(Label, Float)} instead. * @param internalId * @param label * @param description * @param defaultValue * @return this */ public BU requiredFloatParameter(String internalId, String label, String description, Float defaultValue) { FreeTextStaticProperty fsp = prepareFreeTextStaticProperty(internalId, label, description, XSD._double.toString()); fsp.setValue(String.valueOf(defaultValue)); this.staticProperties.add(fsp); return me(); }
private DataProcessorInvocation updateStreamStoppedSepa(DataProcessorInvocation newSEPA, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(String.valueOf(streamUri)); } newStaticProperties.add(p); } newSEPA.setStaticProperties(newStaticProperties); return newSEPA; }
((FreeTextStaticProperty)property).setValue("bla");
private DataSinkInvocation updateKafkaSec(DataSinkInvocation actionClient, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty ||p instanceof DomainStaticProperty) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(outputTopic); } else if (p instanceof DomainStaticProperty) { for(SupportedProperty sp : ((DomainStaticProperty) p).getSupportedProperties()) { if (sp.getPropertyId().equals("http://schema.org/kafkaHost")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaHost())); else if (sp.getPropertyId().equals("http://schema.org/kafkaPort")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaPort())); } } } newStaticProperties.add(p); } actionClient.setStaticProperties(newStaticProperties); return actionClient; }
private DataSinkInvocation updateKafkaSec(DataSinkInvocation actionClient, PipelineModificationMessage message) { List<StaticProperty> properties = message.getPipelineModifications().get(0).getStaticProperties(); List<StaticProperty> newStaticProperties = new ArrayList<>(); for (StaticProperty p : properties) { if (p instanceof FreeTextStaticProperty ||p instanceof DomainStaticProperty) { if (p instanceof FreeTextStaticProperty) { if (p.getInternalName().equals("topic")) ((FreeTextStaticProperty) p).setValue(outputTopic); } else if (p instanceof DomainStaticProperty) { for(SupportedProperty sp : ((DomainStaticProperty) p).getSupportedProperties()) { if (sp.getPropertyId().equals("http://schema.org/kafkaHost")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaHost())); else if (sp.getPropertyId().equals("http://schema.org/kafkaPort")) sp.setValue(String .valueOf(BackendConfig.INSTANCE.getKafkaPort())); } } } newStaticProperties.add(p); } actionClient.setStaticProperties(newStaticProperties); return actionClient; }