summaryrefslogtreecommitdiffstats
path: root/mod/genprocessor/README.md
diff options
context:
space:
mode:
authorMichael Hwang <mhwang@research.att.com>2019-11-11 14:31:28 -0500
committerMichael Hwang <mhwang@research.att.com>2019-11-18 17:06:45 -0500
commit566a0d2c4e917fd03b0126b5cc610539f3db3cb1 (patch)
treee2abec4b0a9ea77c09e7de666c3b115ae55c0845 /mod/genprocessor/README.md
parent849da15d5b7ddc68e4c2b90b603fc8948d4b5e6d (diff)
Add genprocessor project
Signed-off-by: Michael Hwang <mhwang@research.att.com> Issue-ID: DCAEGEN2-1860 Change-Id: Ie22a30ed8c72327ff0a28afa64ae53d8d6458a0c
Diffstat (limited to 'mod/genprocessor/README.md')
-rw-r--r--mod/genprocessor/README.md84
1 files changed, 84 insertions, 0 deletions
diff --git a/mod/genprocessor/README.md b/mod/genprocessor/README.md
new file mode 100644
index 0000000..57b5cf9
--- /dev/null
+++ b/mod/genprocessor/README.md
@@ -0,0 +1,84 @@
+# Genprocessor
+
+This project is a tool to experiment with generating a Nifi Processor POJO from a DCAE component spec.
+
+Environment variables needed to run the app:
+
+For generating -
+
+`GENPROC_WORKING_DIR` - Full file path to the directory where you will generate class files to and ultimately build the jar to distribute
+`GENPROC_ONBOARDING_API_HOST` - Onboarding API host URL
+`GENPROC_PROCESSOR_CLASSFILE_PATH` - Path to the DCAEProcessor class file
+
+For loading -
+
+`GENPROC_JAR_INDEX_URL` - URL to the index.json for DCAE processor jars
+
+## Build
+
+NOTE: You need a specific version of the `nifi-api` jar that contains the class `BaseDCAEProcessor`.
+
+Command to build and to copy dependencies into `target/dependency` directory:
+
+```
+mvn clean package dependency:copy-dependencies
+```
+
+## Run - Generate jars
+
+This will pull all component specs from onboarding API and for each component:
+
+* A class file is generated for a new DCAEProcessor class
+* Write metadata into META-INF directory
+* Copy a copy of the DCAEProcessor class file
+* Package up into a jar
+
+Command to run:
+
+```
+java -cp "target/genprocessor-1.0.1.jar:target/dependency/*" org.onap.dcae.genprocessor.App gen
+```
+
+### More about what goes into META-INF
+
+#### Processor manifest
+
+Note the META-INF directory which contains:
+
+```
+$ tree META-INF/
+META-INF/
+└── services
+ └── org.apache.nifi.processor.Processor
+```
+
+If you don't have the above in your `GENPROC_TARGET_DIR`, then:
+
+```
+$ mkdir -p META-INF/services
+$ touch META-INF/services/org.apache.nifi.processor.Processor
+```
+
+Open `META-INF/services/org.apache.nifi.processor.Processor` and write the full class name for each generated processor on a separate line.
+
+#### MANIFEST.MF
+
+Write the `MANIFEST.MF` in a file that's arbitrarily named (mymanifest for example). The content should look like:
+
+```
+$ cat mymanifest
+Manifest-Version: 1.0
+Id: dcae-ves-collector
+Version: 1.5.0
+Group: org.onap.dcae
+```
+
+## Run - Load jars
+
+This will load all jars listed on an index page and for each jar will do a class load and quick test.
+
+Command to run:
+
+```
+java -cp "target/genprocessor-1.0.1.jar:target/dependency/*" org.onap.dcae.genprocessor.App load
+``` \ No newline at end of file