Repository: nifi Updated Branches: refs/heads/NIFI-964 [created] 4abdf6a89
NIFI-964 Creating pcap bundle and updating poms Project: http://git-wip-us.apache.org/repos/asf/nifi/repo Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/4abdf6a8 Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/4abdf6a8 Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/4abdf6a8 Branch: refs/heads/NIFI-964 Commit: 4abdf6a89117b652903561345a39a0fc3df26f10 Parents: b36841e Author: Bryan Bende <[email protected]> Authored: Wed Sep 16 10:55:59 2015 -0400 Committer: Bryan Bende <[email protected]> Committed: Wed Sep 16 10:55:59 2015 -0400 ---------------------------------------------------------------------- nifi-assembly/pom.xml | 5 + .../nifi-pcap-bundle/nifi-pcap-nar/pom.xml | 37 ++++++++ .../nifi-pcap-processors/pom.xml | 54 +++++++++++ .../apache/nifi/processors/pcap/GetPcap.java | 96 ++++++++++++++++++++ .../org.apache.nifi.processor.Processor | 15 +++ .../nifi/processors/pcap/TestGetPcap.java | 39 ++++++++ nifi-nar-bundles/nifi-pcap-bundle/pom.xml | 35 +++++++ nifi-nar-bundles/pom.xml | 5 +- pom.xml | 6 ++ 9 files changed, 290 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/nifi-assembly/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-assembly/pom.xml b/nifi-assembly/pom.xml index 3b42802..1d406b4 100644 --- a/nifi-assembly/pom.xml +++ b/nifi-assembly/pom.xml @@ -227,6 +227,11 @@ language governing permissions and limitations under the License. --> <artifactId>nifi-image-nar</artifactId> <type>nar</type> </dependency> + <dependency> + <groupId>org.apache.nifi</groupId> + <artifactId>nifi-pcap-nar</artifactId> + <type>nar</type> + </dependency> </dependencies> <properties> http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-nar/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-nar/pom.xml b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-nar/pom.xml new file mode 100644 index 0000000..ac78399 --- /dev/null +++ b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-nar/pom.xml @@ -0,0 +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>org.apache.nifi</groupId> + <artifactId>nifi-pcap-bundle</artifactId> + <version>0.3.0-SNAPSHOT</version> + </parent> + + <artifactId>nifi-pcap-nar</artifactId> + <version>0.3.0-SNAPSHOT</version> + <packaging>nar</packaging> + + <dependencies> + <dependency> + <groupId>org.apache.nifi</groupId> + <artifactId>nifi-pcap-processors</artifactId> + <version>0.3.0-SNAPSHOT</version> + </dependency> + </dependencies> + +</project> http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/pom.xml b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/pom.xml new file mode 100644 index 0000000..6ac6f2e --- /dev/null +++ b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/pom.xml @@ -0,0 +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>org.apache.nifi</groupId> + <artifactId>nifi-pcap-bundle</artifactId> + <version>0.3.0-SNAPSHOT</version> + </parent> + + <artifactId>nifi-pcap-processors</artifactId> + <packaging>jar</packaging> + + <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/nifi/blob/4abdf6a8/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/java/org/apache/nifi/processors/pcap/GetPcap.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/java/org/apache/nifi/processors/pcap/GetPcap.java b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/java/org/apache/nifi/processors/pcap/GetPcap.java new file mode 100644 index 0000000..f63779a --- /dev/null +++ b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/java/org/apache/nifi/processors/pcap/GetPcap.java @@ -0,0 +1,96 @@ +/* + * 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 org.apache.nifi.processors.pcap; + +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.annotation.behavior.ReadsAttribute; +import org.apache.nifi.annotation.behavior.ReadsAttributes; +import org.apache.nifi.annotation.behavior.WritesAttribute; +import org.apache.nifi.annotation.behavior.WritesAttributes; +import org.apache.nifi.annotation.lifecycle.OnScheduled; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.SeeAlso; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.processor.exception.ProcessException; +import org.apache.nifi.processor.util.StandardValidators; + +import java.util.*; + +@Tags({"example"}) +@CapabilityDescription("Provide a description") +@SeeAlso({}) +@ReadsAttributes({@ReadsAttribute(attribute="", description="")}) +@WritesAttributes({@WritesAttribute(attribute="", description="")}) +public class GetPcap 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(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(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/nifi/blob/4abdf6a8/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor new file mode 100644 index 0000000..4f28c0b --- /dev/null +++ b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor @@ -0,0 +1,15 @@ +# 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. +org.apache.nifi.processors.pcap.GetPcap \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/test/java/org/apache/nifi/processors/pcap/TestGetPcap.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/test/java/org/apache/nifi/processors/pcap/TestGetPcap.java b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/test/java/org/apache/nifi/processors/pcap/TestGetPcap.java new file mode 100644 index 0000000..752122b --- /dev/null +++ b/nifi-nar-bundles/nifi-pcap-bundle/nifi-pcap-processors/src/test/java/org/apache/nifi/processors/pcap/TestGetPcap.java @@ -0,0 +1,39 @@ +/* + * 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 org.apache.nifi.processors.pcap; + +import org.apache.nifi.util.TestRunner; +import org.apache.nifi.util.TestRunners; +import org.junit.Before; +import org.junit.Test; + + +public class TestGetPcap { + + private TestRunner testRunner; + + @Before + public void init() { + testRunner = TestRunners.newTestRunner(GetPcap.class); + } + + @Test + public void testProcessor() { + + } + +} http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/nifi-nar-bundles/nifi-pcap-bundle/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-pcap-bundle/pom.xml b/nifi-nar-bundles/nifi-pcap-bundle/pom.xml new file mode 100644 index 0000000..30d9d09 --- /dev/null +++ b/nifi-nar-bundles/nifi-pcap-bundle/pom.xml @@ -0,0 +1,35 @@ +<?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>org.apache.nifi</groupId> + <artifactId>nifi-nar-bundles</artifactId> + <version>0.3.0-SNAPSHOT</version> + </parent> + + <groupId>org.apache.nifi</groupId> + <artifactId>nifi-pcap-bundle</artifactId> + <version>0.3.0-SNAPSHOT</version> + <packaging>pom</packaging> + + <modules> + <module>nifi-pcap-processors</module> + <module>nifi-pcap-nar</module> + </modules> + +</project> http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/nifi-nar-bundles/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/pom.xml b/nifi-nar-bundles/pom.xml index 4d9edbf..18c105e 100644 --- a/nifi-nar-bundles/pom.xml +++ b/nifi-nar-bundles/pom.xml @@ -45,7 +45,8 @@ <module>nifi-ambari-bundle</module> <module>nifi-image-bundle</module> <module>nifi-avro-bundle</module> - </modules> + <module>nifi-pcap-bundle</module> + </modules> <dependencyManagement> <dependencies> <dependency> @@ -130,4 +131,4 @@ </dependency> </dependencies> </dependencyManagement> -</project> +</project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/4abdf6a8/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index e4abdf2..59aa982 100644 --- a/pom.xml +++ b/pom.xml @@ -909,6 +909,12 @@ </dependency> <dependency> <groupId>org.apache.nifi</groupId> + <artifactId>nifi-pcap-nar</artifactId> + <version>0.3.0-SNAPSHOT</version> + <type>nar</type> + </dependency> + <dependency> + <groupId>org.apache.nifi</groupId> <artifactId>nifi-properties</artifactId> <version>0.3.0-SNAPSHOT</version> </dependency>
