NIFI-309 renaming DynamicRelationships

This commit is contained in:
danbress 2015-03-18 16:20:57 -04:00
parent a19215fc8d
commit 5232ba33a2
6 changed files with 15 additions and 15 deletions

View File

@ -23,7 +23,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import org.apache.commons.lang3.StringUtils;
import org.apache.nifi.annotation.documentation.DynamicRelationships;
import org.apache.nifi.annotation.documentation.DynamicRelationship;
import org.apache.nifi.annotation.documentation.ReadsAttribute;
import org.apache.nifi.annotation.documentation.ReadsAttributes;
import org.apache.nifi.annotation.documentation.WritesAttribute;
@ -232,7 +232,7 @@ public class HtmlProcessorDocumentationWriter extends HtmlDocumentationWriter {
*/
private void writeDynamicRelationships(final Processor processor, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException {
List<DynamicRelationships> dynamicRelationships = getDynamicRelationships(processor);
List<DynamicRelationship> dynamicRelationships = getDynamicRelationships(processor);
if (dynamicRelationships.size() > 0) {
writeSimpleElement(xmlStreamWriter, "h3", "Dynamic Relationships: ");
@ -242,7 +242,7 @@ public class HtmlProcessorDocumentationWriter extends HtmlDocumentationWriter {
writeSimpleElement(xmlStreamWriter, "th", "Description");
xmlStreamWriter.writeEndElement();
for (DynamicRelationships dynamicRelationship : dynamicRelationships) {
for (DynamicRelationship dynamicRelationship : dynamicRelationships) {
xmlStreamWriter.writeStartElement("tr");
writeSimpleElement(xmlStreamWriter, "td", dynamicRelationship.name());
writeSimpleElement(xmlStreamWriter, "td", dynamicRelationship.description());
@ -252,10 +252,10 @@ public class HtmlProcessorDocumentationWriter extends HtmlDocumentationWriter {
}
}
private List<DynamicRelationships> getDynamicRelationships(Processor processor) {
List<DynamicRelationships> results = new ArrayList<>();
private List<DynamicRelationship> getDynamicRelationships(Processor processor) {
List<DynamicRelationship> results = new ArrayList<>();
DynamicRelationships dynamicRelationships = processor.getClass().getAnnotation(DynamicRelationships.class);
DynamicRelationship dynamicRelationships = processor.getClass().getAnnotation(DynamicRelationship.class);
if (dynamicRelationships != null) {
results.add(dynamicRelationships);
}

View File

@ -24,7 +24,7 @@ import java.util.Set;
import org.apache.nifi.annotation.behavior.DynamicProperty;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.DynamicRelationships;
import org.apache.nifi.annotation.documentation.DynamicRelationship;
import org.apache.nifi.annotation.documentation.ReadsAttribute;
import org.apache.nifi.annotation.documentation.SeeAlso;
import org.apache.nifi.annotation.documentation.Tags;
@ -46,7 +46,7 @@ import org.apache.nifi.processor.util.StandardValidators;
@ReadsAttribute(attribute = "incoming", description="this specifies the format of the thing")
@SeeAlso(value={FullyDocumentedControllerService.class, FullyDocumentedReportingTask.class}, classNames={"org.apache.nifi.processor.ExampleProcessor"})
@DynamicProperty(name="Relationship Name", supportsExpressionLanguage=true, value="some XPath", description="Routes FlowFiles to relationships based on XPath")
@DynamicRelationships(name="name from dynamic property", description="all files that match the properties XPath")
@DynamicRelationship(name="name from dynamic property", description="all files that match the properties XPath")
public class FullyDocumentedProcessor extends AbstractProcessor {
public static final PropertyDescriptor DIRECTORY = new PropertyDescriptor.Builder().name("Input Directory")

View File

@ -36,7 +36,7 @@ import org.apache.nifi.annotation.behavior.SideEffectFree;
import org.apache.nifi.annotation.behavior.SupportsBatching;
import org.apache.nifi.annotation.behavior.TriggerWhenAnyDestinationAvailable;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.DynamicRelationships;
import org.apache.nifi.annotation.documentation.DynamicRelationship;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.annotation.lifecycle.OnScheduled;
import org.apache.nifi.components.PropertyDescriptor;
@ -65,7 +65,7 @@ import org.apache.nifi.processor.util.StandardValidators;
+ "'5' will be receive 10 FlowFiles in each iteration instead of 1.")
@DynamicProperty(name="The relationship name(positive number)", value="The relationship Weight(positive number)", description="adding a property with the name '5' and value '10' means that the relationship with name "
+ "'5' will be receive 10 FlowFiles in each iteration instead of 1.")
@DynamicRelationships(name="A number 1..<Number Of Relationships>", description="FlowFiles are sent to this relationship per the <Distribution Strategy>")
@DynamicRelationship(name="A number 1..<Number Of Relationships>", description="FlowFiles are sent to this relationship per the <Distribution Strategy>")
public class DistributeLoad extends AbstractProcessor {
public static final String STRATEGY_ROUND_ROBIN = "round robin";

View File

@ -27,7 +27,7 @@ import org.apache.nifi.annotation.behavior.EventDriven;
import org.apache.nifi.annotation.behavior.SideEffectFree;
import org.apache.nifi.annotation.behavior.SupportsBatching;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.DynamicRelationships;
import org.apache.nifi.annotation.documentation.DynamicRelationship;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.annotation.lifecycle.OnRemoved;
import org.apache.nifi.components.PropertyDescriptor;

View File

@ -31,7 +31,7 @@ import org.apache.nifi.annotation.behavior.EventDriven;
import org.apache.nifi.annotation.behavior.SideEffectFree;
import org.apache.nifi.annotation.behavior.SupportsBatching;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.DynamicRelationships;
import org.apache.nifi.annotation.documentation.DynamicRelationship;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.components.AllowableValue;
import org.apache.nifi.components.PropertyDescriptor;
@ -69,7 +69,7 @@ import org.apache.nifi.processor.util.StandardValidators;
@CapabilityDescription("Routes FlowFiles based on their Attributes using the Attribute Expression Language")
@DynamicProperty(name="Relationship Name", value="Attribute Expression Language", supportsExpressionLanguage=true, description="Routes FlowFiles whose " +
"attributes match the Attribute Expression Language specified in the Dynamic Property Value to the Relationship specified in the Dynamic Property Key")
@DynamicRelationships(name="Name from Dynamic Property", description="FlowFiles that match the Dynamic Property's Attribute Expression Language")
@DynamicRelationship(name="Name from Dynamic Property", description="FlowFiles that match the Dynamic Property's Attribute Expression Language")
public class RouteOnAttribute extends AbstractProcessor {
public static final String ROUTE_ATTRIBUTE_KEY = "RouteOnAttribute.Route";

View File

@ -41,7 +41,7 @@ import org.apache.nifi.processor.ProcessSession;
import org.apache.nifi.processor.ProcessorInitializationContext;
import org.apache.nifi.processor.Relationship;
import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.DynamicRelationships;
import org.apache.nifi.annotation.documentation.DynamicRelationship;
import org.apache.nifi.annotation.behavior.DynamicProperty;
import org.apache.nifi.annotation.behavior.EventDriven;
import org.apache.nifi.annotation.behavior.SideEffectFree;
@ -62,7 +62,7 @@ import org.apache.nifi.util.IntegerHolder;
+ "literal values, not Regular Expressions")
@DynamicProperty(name="Relationship Name", value="A Regular Expression", supportsExpressionLanguage=true, description="Routes FlowFiles whose " +
"content matches the regular expressoin defined by Dynamic Property's value to the Relationship defined by the Dynamic Property's key")
@DynamicRelationships(name="Name from Dynamic Property", description="FlowFiles that match the Dynamic Property's Regular Expression")
@DynamicRelationship(name="Name from Dynamic Property", description="FlowFiles that match the Dynamic Property's Regular Expression")
public class RouteOnContent extends AbstractProcessor {
public static final String ROUTE_ATTRIBUTE_KEY = "RouteOnContent.Route";