You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2015/01/23 20:00:17 UTC

[07/10] incubator-nifi git commit: NIFI-272: Updated pom.xml to be more consistent by removing 'name' tag and not including the default 'properties' tag

NIFI-272: Updated pom.xml to be more consistent by removing 'name' tag and not including the default 'properties' tag


Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/cd3094d5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/cd3094d5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/cd3094d5

Branch: refs/heads/develop
Commit: cd3094d54fa2c8681d072c6c1c3fff6ffde1059b
Parents: c8ecdd9 5f3653b
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Jan 23 12:12:30 2015 -0500
Committer: Mark Payne <ma...@hotmail.com>
Committed: Fri Jan 23 12:12:30 2015 -0500

----------------------------------------------------------------------
 .../nifi-processor-bundle-archetype/pom.xml     | 23 +++++
 .../META-INF/maven/archetype-metadata.xml       | 56 +++++-------
 .../nifi-__artifactBaseName__-nar/pom.xml       | 37 ++++++++
 .../pom.xml                                     | 54 +++++++++++
 .../src/main/java/MyProcessor.java              | 88 ++++++++++++++++++
 .../org.apache.nifi.processor.Processor         | 15 +++
 .../docs/__package__.MyProcessor/index.html     | 96 ++++++++++++++++++++
 .../src/test/java/MyProcessorTest.java          | 39 ++++++++
 .../nifi-__rootArtifactId__-nar/pom.xml         | 37 --------
 .../nifi-__rootArtifactId__-processors/pom.xml  | 54 -----------
 .../org/apache/nifi/processors/MyProcessor.java | 88 ------------------
 .../org.apache.nifi.processor.Processor         | 15 ---
 .../index.html                                  | 96 --------------------
 .../apache/nifi/processors/MyProcessorTest.java | 39 --------
 .../main/resources/archetype-resources/pom.xml  |  6 +-
 15 files changed, 376 insertions(+), 367 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/cd3094d5/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-nar/pom.xml
----------------------------------------------------------------------
diff --cc nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-nar/pom.xml
index 0000000,6759c96..60875a6
mode 000000,100644..100644
--- a/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-nar/pom.xml
+++ b/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-nar/pom.xml
@@@ -1,0 -1,39 +1,37 @@@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements. See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License. You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ -->
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+     <modelVersion>4.0.0</modelVersion>
+ 
+     <parent>
+         <groupId>${groupId}</groupId>
+         <artifactId>${rootArtifactId}</artifactId>
+         <version>${version}</version>
+     </parent>
+ 
+     <artifactId>nifi-${artifactBaseName}-nar</artifactId>
+     <version>${version}</version>
+     <packaging>nar</packaging>
+ 
 -    <name>nifi-${artifactBaseName}-nar</name>
 -
+     <dependencies>
+         <dependency>
+             <groupId>${groupId}</groupId>
+             <artifactId>nifi-${artifactBaseName}-processors</artifactId>
+             <version>${version}</version>
+         </dependency>
+     </dependencies>
+ 
+ </project>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/cd3094d5/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/pom.xml
----------------------------------------------------------------------
diff --cc nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/pom.xml
index 0000000,01d6c6d..5cd42ee
mode 000000,100644..100644
--- a/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/pom.xml
+++ b/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/pom.xml
@@@ -1,0 -1,61 +1,54 @@@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements. See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License. You may obtain a copy of the License at
+   http://www.apache.org/licenses/LICENSE-2.0
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ -->
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+     <modelVersion>4.0.0</modelVersion>
+ 
+     <parent>
+         <groupId>${groupId}</groupId>
+         <artifactId>${rootArtifactId}</artifactId>
+         <version>${version}</version>
+     </parent>
+ 
+     <artifactId>nifi-${artifactBaseName}-processors</artifactId>
+     <packaging>jar</packaging>
+ 
 -    <name>nifi-${artifactBaseName}-processors</name>
 -    <url>http://maven.apache.org</url>
 -
 -    <properties>
 -        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 -    </properties>
 -
+     <dependencies>
+         <dependency>
+             <groupId>org.apache.nifi</groupId>
+             <artifactId>nifi-api</artifactId>
+         </dependency>
+         <dependency>
+             <groupId>org.apache.nifi</groupId>
+             <artifactId>nifi-processor-utils</artifactId>
+         </dependency>
+         <dependency>
+             <groupId>org.apache.nifi</groupId>
+             <artifactId>nifi-mock</artifactId>
+             <scope>test</scope>
+         </dependency>
+         <dependency>
+             <groupId>org.slf4j</groupId>
+             <artifactId>slf4j-simple</artifactId>
+             <scope>test</scope>
+         </dependency>
+         <dependency>
+             <groupId>junit</groupId>
+             <artifactId>junit</artifactId>
+             <version>4.11</version>
+             <scope>test</scope>
+         </dependency>
+     </dependencies>
+ </project>

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/cd3094d5/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java
----------------------------------------------------------------------
diff --cc nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java
index 0000000,23b1094..4f2ecff
mode 000000,100644..100644
--- a/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java
+++ b/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/nifi-__artifactBaseName__-processors/src/main/java/MyProcessor.java
@@@ -1,0 -1,82 +1,88 @@@
+ /*
+  * Licensed to the Apache Software Foundation (ASF) under one or more
+  * contributor license agreements.  See the NOTICE file distributed with
+  * this work for additional information regarding copyright ownership.
+  * The ASF licenses this file to You under the Apache License, Version 2.0
+  * (the "License"); you may not use this file except in compliance with
+  * the License.  You may obtain a copy of the License at
+  *
+  *     http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
+ package ${package};
+ 
+ import org.apache.nifi.components.PropertyDescriptor;
+ import org.apache.nifi.components.PropertyValue;
++import org.apache.nifi.flowfile.FlowFile;
+ import org.apache.nifi.processor.*;
+ import org.apache.nifi.processor.annotation.CapabilityDescription;
+ import org.apache.nifi.processor.annotation.OnScheduled;
+ import org.apache.nifi.processor.annotation.Tags;
+ import org.apache.nifi.processor.exception.ProcessException;
+ import org.apache.nifi.processor.util.StandardValidators;
+ 
+ import java.util.*;
+ 
+ @Tags({"example"})
+ @CapabilityDescription("Provide a description")
+ public class MyProcessor extends AbstractProcessor {
+ 
+     public static final PropertyDescriptor MY_PROPERTY = new PropertyDescriptor
+             .Builder().name("My Property")
+             .description("Example Property")
+             .required(true)
+             .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+             .build();
+ 
+     public static final Relationship MY_RELATIONSHIP = new Relationship.Builder()
+             .name("my_relationship")
+             .description("Example relationship")
+             .build();
+ 
+     private List<PropertyDescriptor> descriptors;
+ 
+     private Set<Relationship> relationships;
+ 
+     @Override
 -    protected void init(ProcessorInitializationContext context) {
++    protected void init(final ProcessorInitializationContext context) {
+         final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>();
+         descriptors.add(MY_PROPERTY);
+         this.descriptors = Collections.unmodifiableList(descriptors);
+ 
+         final Set<Relationship> relationships = new HashSet<Relationship>();
+         relationships.add(MY_RELATIONSHIP);
+         this.relationships = Collections.unmodifiableSet(relationships);
+     }
+ 
+     @Override
+     public Set<Relationship> getRelationships() {
+         return this.relationships;
+     }
+ 
+     @Override
+     public final List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+         return descriptors;
+     }
+ 
+     @OnScheduled
+     public void onScheduled(final ProcessContext context) {
+ 
+     }
+ 
+     @Override
 -    public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException {
 -        PropertyValue propertyValue = context.getProperty(MY_PROPERTY);
++    public void onTrigger(final ProcessContext context, final ProcessSession session) throws ProcessException {
++		FlowFile flowFile = session.get();
++		if ( flowFile == null ) {
++			return;
++		}
++		
+         // TODO implement
++		
+     }
+ 
+ }

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/cd3094d5/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --cc nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/pom.xml
index 014a4e1,806cf8d..f1677e5
--- a/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/nifi/nifi-maven-archetypes/nifi-processor-bundle-archetype/src/main/resources/archetype-resources/pom.xml
@@@ -27,9 -27,16 +27,9 @@@
      <version>${version}</version>
      <packaging>pom</packaging>
  
 -    <name>${artifactId}</name>
 -    <url>http://maven.apache.org</url>
 -
 -    <properties>
 -        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 -    </properties>
 -
      <modules>
-         <module>nifi-${rootArtifactId}-processors</module>
-         <module>nifi-${rootArtifactId}-nar</module>
+         <module>nifi-${artifactBaseName}-processors</module>
+         <module>nifi-${artifactBaseName}-nar</module>
      </modules>
  
  </project>