mirror of https://github.com/apache/nifi.git
Squashed commit of the following:
commit 9cfc3ab42fbe46af113a1f0db41aa95e6e0b4568 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 31 16:32:13 2015 -0400 NIFI-250: - Updating test to fix compilation error after merge. commit 266d44b11c92cea51f882483adcfa898feeaac44 Merge: 97632fbe7d6d94
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 31 16:11:12 2015 -0400 Merge branch 'develop' into NIFI-250 commit 97632fbce67850c66b765f667ec2a1ed6e540914 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 31 12:12:01 2015 -0400 NIFI-250: - Removing extra call to show configuration dialog. commit 23465a1e116ee10c2c73a9ed25d7b382096f9b52 Merge: d4321f5 1abee29 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 31 11:09:32 2015 -0400 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 1abee2964380bf2aee91189f471035fe3df92919 Author: Mark Payne <markap14@hotmail.com> Date: Tue Mar 31 10:58:53 2015 -0400 NIFI-250: Fixed bugs with configuring reporting tasks on restart commit 712327fe8eac0c96a4d676a1ffe2210801d97200 Merge: abd1dc3 1cee436 Author: Mark Payne <markap14@hotmail.com> Date: Tue Mar 31 08:41:56 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit abd1dc3362ef6297eb3f044aadc58c181114fe06 Author: Mark Payne <markap14@hotmail.com> Date: Tue Mar 31 08:41:45 2015 -0400 NIFI-250: Fixed bug that caused IllegalArgumentException when loading reporting tasks on NCM if property is not set commit d4321f50d6adc1534d318405fb23838032c054d7 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 31 07:39:47 2015 -0400 NIFI-250: - Updating Javadocs. commit 5394a826b07bb897299bebefe275f633c02e95ce Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 31 07:30:57 2015 -0400 NIFI-250: - Updating messages included in exceptions during error conditions when interacting with a custom UI. commit 1cee4367888d899d9396f7e48f2badfa8e11f07c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 30 14:54:16 2015 -0400 NIFI-250: - Fixing the width of the referencing components when the content overflows. commit b32e2712c1735d57bf1d34debb0268e42a544c56 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 30 14:19:49 2015 -0400 NIFI-250: - Using a List when (de)serializing allowable values. This is preferable than calling out a specific Set implementation. commit 2949beb6f57a7af469257a27adffa9397e234d7b Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 30 13:20:55 2015 -0400 NIFI-250: - Only recording previously configured controller service when attempting to change a controller service. - Only polling schedulable components when stopping. No need to poll during start requests. commit 0b77160da76877b35a5777b0bcf552d5985ba64d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 30 13:17:44 2015 -0400 NIFI-250: - Adding tooltip to referencing components section of the enable/disable controller service dialog. - Fixing typo. commit 37d2bd1e1e564c516cb2d96c7f1b361c9034110a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 30 12:10:44 2015 -0400 NIFI-250: - Fixing controller service ancestor calculation. commit 2673c39a62462e5ade8363b379424241029f2058 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 30 12:09:37 2015 -0400 NIFI-250: - Correcting the number of displayed controller service types. - Adding more indentation. commit 0a7c55705fcdb485b6a8278fe39dd31f6e21639e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 15:23:55 2015 -0400 NIFI-250: - Reloading newly and previously referenced controller services when modifying the referencing controller service. (ie adding/changing/removing the reference). commit 0d975028efdb07439ea21f1e3654b2c3cc939a93 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 13:14:19 2015 -0400 NIFI-250: - Fixing list item wrapping commit 1efa053b6af6b4d70bed608247b42bd9b92a9127 Merge: eaa8c51 92df0d7 Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 27 12:42:38 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit eaa8c51f973b837ee5c41bb9fb7d09e98cd41824 Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 27 12:42:32 2015 -0400 NIFI-250: Fixed bug when restoring Reporting Tasks on NCM; added documentation to some services; fixed bugs in Standard Validators commit 92df0d7cc7074f4a14c571d1d69b2845b9a8ad7a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 09:39:27 2015 -0400 NIFI-250: - Reverting change to reload service and referencing components on done to do always. Since the enable/disable request may poll or be canceled by a user. commit be3254c947352486e5fe992184f8de6a5b20369f Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 09:22:22 2015 -0400 NIFI-250: - Adding a check to ensure we don't attempt to reload a controller service that has been removed but is still referenced by another controller service. commit 21ab41fbe1cbd3460eb544ba96c18e120e7e67e3 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 09:16:24 2015 -0400 NIFI-250: - Fixing typo in the scope tooltip. commit 56f8dd972b4565a367fe317deee5826c215874bd Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 08:30:52 2015 -0400 NIFI-250: - Ensuring the settings (controller service/reporting task) dialog is closed prior to opening a custom UI. commit 3eb1ac16a59738db683739e48d362260cf2c4e03 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 27 08:00:40 2015 -0400 NIFI-250: - Ensuring the style on the comments field is reset when changing its value. commit b51af3cb7a60fb11ddc2dedd328e35a92d39f0e3 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 15:12:09 2015 -0400 NIFI-250: - Fixing issues when clicking Add before selecting the type of controller service and reporting task to create. commit 5b56982d20b3a24ca59362a482c39ef6d4329b8d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 11:55:56 2015 -0400 NIFI-250: - Using the correct state variable when determining how to update a given controller service. commit 6c678bfe6adf9e15b294523603dbf230d731b3c9 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 10:42:24 2015 -0400 NIFI-250: - Prevented reading of the node response because when clustered the responses are merged and we need to use the updated entity. commit ffb4e6b68b57f23b41703613557f7bf0da5bbce5 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 09:13:23 2015 -0400 NIFI-250: - Only attempting to reload a controller service when one is actually referenced. commit c61a2afbb8b0696b883c06dfd92abb3f3b111bb6 Merge: 8a830bea5e140f
Author: Mark Payne <markap14@hotmail.com> Date: Thu Mar 26 09:02:20 2015 -0400 Merge branch 'develop' into NIFI-250 Conflicts: nifi/nifi-api/src/main/java/org/apache/nifi/components/ValidationContext.java nifi/nifi-mock/src/main/java/org/apache/nifi/util/MockValidationContext.java nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/StandardValidationContext.java commit 8a830bef412dfa44a54c840e24545defeed83f15 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 08:10:47 2015 -0400 NIFI-250: - Rendering reporting tasks in controller service referencing components. - Ensuring referenced controller services are reloading when a reporting task changes. - Automatically selecting reporting task tab and item in table when linking to one via controller service referencing components. commit 47e84c009db874b5f2151bd5eb92b403461c5730 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 08:04:17 2015 -0400 NIFI-250: - Fixing issue preventing reporting task from being included in controller service referencing components. commit fe24f368e8e317400d77491e904de6f76639fd53 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 07:04:51 2015 -0400 NIFI-250: - Handling the appropriate type of exception when creating a controller service. commit 4f01cd090972fd6b2712d914e7d2ea8eca8627b1 Merge: 8bef904 91e002e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 26 06:55:03 2015 -0400 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 91e002eb90795a1c2d2711c3e20db520fce155ff Merge: 47435c8 5db358f Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 25 15:46:19 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 47435c8bb7207358dbfef2fcfdad5e3fdd054434 Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 25 15:46:09 2015 -0400 NIFI-250: Removed controller-services.xml and reporting-tasks.xml and associated properties commit 8bef904df75e1ca190075c5b78e6f858031ec4e8 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 15:29:18 2015 -0400 NIFI-250: - Including properties and descriptors in controller service referencing components. commit 5db358f4e580dc5a1129444ffc203a4041720160 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 15:27:35 2015 -0400 NIFI-250: - Populating the reporting task details when modifying a service that it references. commit 975db1a7b33383200b2045fd1c97e29216d1c2b3 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 15:07:30 2015 -0400 NIFI-250: - Fixing issue when reloading transitive controller service referencing components. - Allowing reporting tasks to be reloaded (when they reference controller services). commit 17b0fa7df170fa50f33236863481f008356cb1b4 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 15:03:39 2015 -0400 NIFI-250: - Addressing issues setting reporting task comments. - Including properties and descriptors in controller service referencing components. commit f71588065d788de4d3957593d88473c6bc13c2a1 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 11:07:13 2015 -0400 NIFI-250: - Reordering the invocation of the modal close handler and the hiding of the dialog. - Separating loading from showing the settings so the actions can be performed independently. This allows the transition back to the controller service/reporting task table more smooth when viewing usage or a custom UI. commit b8b9f2c2509d8101d2f749e4ce7c58ed7a52be96 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 09:57:37 2015 -0400 NIFI-250: - Ensuring requests are not attempted to be replicated if a custom UI provides an invalid component id. commit 2dccb5b4d98a194a7cee307b2252962eebdb67b1 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 25 09:28:55 2015 -0400 NIFI-250: - Adding better handling when a request is interpreted as a request to create a processor/controller service/reporting task and the type is not specified. commit e8294f29e2f5aef8cec0117cd09a2242b5ef2ca9 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 24 15:31:40 2015 -0400 NIFI-250: - Reopening the settings to the controller services/reporting tasks table after showing usage or custom UIs. commit d8a27993d0d7a7650f59d595c58eb99e5140c82c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 24 14:15:08 2015 -0400 NIFI-250: - Adding support to configure reporting task comments. Comments still need to be persisted to flow xml. commit ec21493622a9cc9ce0857c0b37d48a08f120a770 Author: Mark Payne <markap14@hotmail.com> Date: Tue Mar 24 13:07:05 2015 -0400 NIFI-250: Restore Comments and AnnotationData for Reporting Tasks on NCM; these were inadvertently skipped commit de21b6090c821a0dd4421d0637a2fd87a5a894d7 Merge: 4dcb9fd 953cb12 Author: Mark Payne <markap14@hotmail.com> Date: Tue Mar 24 12:49:48 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 953cb1227af70e846e47416ffdbc6eb3a1686d6a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 24 12:28:30 2015 -0400 NIFI-250: - Providing access to the merged node response when clustered. This is necessary as custom UIs will need to access to these details. - Ensuring the cluster processor endpoint is merged appropriately. commit 4dcb9fd761dfaec98790c41ca16344a1d0b89340 Author: Mark Payne <markap14@hotmail.com> Date: Tue Mar 24 10:16:47 2015 -0400 NIFI-278: Added documentation and ensured that all annotations invoke with consistent arguments commit 80b8c602433cc7b6589b417524a23b63c891d3f1 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 24 08:58:30 2015 -0400 NIFI-250: - Updating custom UI to fully support the new model (by removing references to processors). commit 691b4617d5568cd9a28f38d081b85d233ccbea44 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 24 08:57:34 2015 -0400 NIFI-250: - Updating custom UIs to support both old (deprecated) and new models. - Ensuring the annotation data is populated in outgoing DTOs. - Ensuring the component type is populated in the details for custom UIs. - Renaming the js module for custom UIs to exclude the reference to processors. commit dbaa219df12207d80b9e5f110443886b95bb5a7c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 14:32:28 2015 -0400 NIFI-250: - Renaming the standard nifi web configuration context. - Adding support for controller services and reporting tasks to the nifi web configuration context. commit 3e7ca3838039d724eba019214b073a8640e61149 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 13:09:15 2015 -0400 NIFI-250: - Continuing to merge changes from the content viewer with the newly supported component UI extensions. commit d3bb3ab829bbeaa93453509e33a7b3f165365987 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 11:34:18 2015 -0400 NIFI-250: - Only prompting users for the property name and immediately adding to the table. In the background, the property descriptor is loaded from the processor and then used when editing the property. commit 1c96bd08f7903f9acc845a542ccb7196f8a264c0 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 09:49:18 2015 -0400 NIFI-250: - Removing unneeded artifact. commit 1de514adf7a3dacc51823932b70de3f8f64c369a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 09:36:07 2015 -0400 NIFI-250: - More clean up post merge with the data viewer. commit d19471d6da17974ab6485f3653b4d793b30e895c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 08:20:04 2015 -0400 Resolving conflicts when merging develop into NIFI-250 commit 65e35e49a5bb1d81cf0933220bf1204131dc72d5 Merge: a4555d1e05c9fd
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 23 08:09:33 2015 -0400 Merge branch 'develop' into NIFI-250 Conflicts: nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FlowController.java nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/pom.xml commit a4555d1a17252bedf503e443223670d34c5acd0d Merge: 6a31b94 fcff5c4 Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 20 15:52:18 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 6a31b94b39c07f943d9145889bc96078921cb2d0 Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 20 15:52:09 2015 -0400 NIFI-250: Fixed bug with templates related to services referencing other services commit fcff5c40a22a42bedbdd488dc540f4e80d6caf68 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 15:35:54 2015 -0400 NIFI-250: - Adding endpoints for obtaining [processor|controller service|reporting task] property descriptors. commit e0e2d161b5f577b2d3c012843c6fde2123cb3411 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 15:33:36 2015 -0400 NIFI-250: - Adding endpoints for obtaining [processor|controller service|reporting task] property descriptors. commit bd999d16ad804a0c71e6188dac0da57ceda58996 Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 20 14:51:26 2015 -0400 NIFI-250: Include referenced controller services in templates commit 02afcfbf4585eba10be1aeb90674c43933b63d88 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 14:39:15 2015 -0400 NIFI-250: - Removing link to jQuery migration script. commit 10ebbf0c3e9155e43dfbe866c42a27a021d3dc42 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 14:38:47 2015 -0400 NIFI-250: - Specifying the correct UI extension type before populate the service/task DTO. commit 07941b5209fa182b02ac7e2d66ebade0416c4319 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 14:38:09 2015 -0400 NIFI-250: - Closing the controller service and reporting task shell whenever a custom UI is opened. commit 5c98ccdbfb15d330ecce118feab98ac0681d6f1a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 13:09:38 2015 -0400 NIFI-250: - Renaming interface that custom UIs use to interact with the NiFi instance. - Javadocs. - Ported UpdateAttribute to use updated custom UI model. - Fixed bug when discovering types of components that support custom UIs. commit 24d787e5d40949659427e72d126dd2a225b6ff86 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 20 10:51:15 2015 -0400 NIFI-250: - Updating the way in which UI extensions interact with the underlying NiFi instance. commit ffa919a349906ef3a8fe178ab448fe69bf1bd4b6 Author: Mark Payne <markap14@hotmail.com> Date: Thu Mar 19 14:12:11 2015 -0400 NIFI-250: Fixed NPE commit c63a8c05ff64196a0fc77a2386c60bac88784ad0 Merge: 800f80b 42f8e81 Author: Mark Payne <markap14@hotmail.com> Date: Thu Mar 19 09:31:46 2015 -0400 NIFI-250: Fixed handling of controller services on startup and resolved merge conflicts commit 800f80bc05ead5f097c9e948f619e0dd681ca592 Author: Mark Payne <markap14@hotmail.com> Date: Thu Mar 19 09:28:05 2015 -0400 NIFI-250: Fixed controller service handling on startup commit 42f8e819811835c94744276cde741ebcdbb1a57e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 18 21:22:44 2015 -0400 NIFI-250: - Updating UI extension type. commit 6c058778534adae967ee34ec5fb2b8c20b66d43b Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 18 16:09:44 2015 -0400 NIFI-250: - Starting to refactor support for UI extensions. - Deprecating previous support. commit f0c660c25ee0e2b1a6acd9b8e876144cad9b0d6b Merge: b45c09ce569af6
Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 18 10:12:13 2015 -0400 Merge branch 'develop' into NIFI-250 commit b45c09cacdbaf93f79dad95a9a258d82fed40831 Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 18 10:09:40 2015 -0400 NIFI-368: Implemented methods that were not implemented from interface commit 454c837ce1e63f780e648e86495c4e5c038fc090 Merge: d7210da e750579 Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 18 09:37:10 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit d7210da40eda444267133fdfbbf2a8a378590e82 Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 18 09:37:06 2015 -0400 NIFI-250: Fix the way that services are restored at startup commit e750579d77ea3b69b438b57d5f468af6f51ff049 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 18 07:40:20 2015 -0400 NIFI-250: - Ensuring controller service comments are included when saving. - Adding a label to the comments in the service details dialog. commit f10bb997b84cce32d30ded918a93ea8f9d511016 Merge: 25ca4f8c118ead
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 18 06:58:44 2015 -0400 Merge branch 'develop' into NIFI-250 commit 25ca4f89e875bb8b7c89b75756793e1863190621 Merge: 769ed681cca300
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 17 16:03:08 2015 -0400 Merge branch 'develop' into NIFI-250 commit 769ed68c51233443bd210e6af3ee6c0b96a5de7d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 17 10:47:43 2015 -0400 NIFI-425: - Reseting the filter in the new controller service and new reporting task dialog. - Setting the initial focus. - Fixing the close handler configuration. commit 985aa134c4c5a43b1570b669e0d32c40be28e152 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 17 09:49:09 2015 -0400 NIFI-250: - Addressing cancel action when initiated by pressing escape. Previously it was canceling every dialog that was open when it should have only applied to the top most. commit bf7027c0760b433c3580a77282df24ed5aac67f2 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 17 08:32:13 2015 -0400 NIFI-425: - Filtering is not clear when closing the new processor dialog. commit aa21d073d55dff3702dbb811b80d0947f745538a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 17 08:18:06 2015 -0400 NIFI-250: - Merging develop into NIFI-250. commit c28d9f57287b5b95d6451a5365dbc2b3d4552422 Merge: 5a6723c761e64a
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 17 08:16:36 2015 -0400 NIFI-250: Merge develop into NIFI-250 commit 5a6723c0465d15e603ee7cbec9b1e58a80f0f036 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 15:56:14 2015 -0400 NIFI-250: - Fixing enable button label. commit 02b9e4b0a91e65625f10437bf9459e8005b3459c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 13:20:16 2015 -0400 NIFI-250: - Setting the correct visibility on the controller service name field. commit 24c86facff21f133a62bffe2f5927a45e1b9d059 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 12:34:17 2015 -0400 NIFI-250: - Using .html() instead of .text() as the service/task description is already escaped. commit dddf5e8841977321cce2f287be2728f3163ad5a4 Merge: 30f9323eb757a4
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 11:41:26 2015 -0400 Merge branch 'develop' into NIFI-250 commit 30f9323a0cdf6f783c94ff0c7120b2c042dd8194 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 11:38:08 2015 -0400 NIFI-250: - Ensuring the new property dialog is only destroy when appropriate. There were cases when we wanted to clear the property table but leave the new property dialog intact. commit af855ba123db2dc8b9d5e96f47aabb5d76055130 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 10:19:28 2015 -0400 NIFI-250: - Using the correct element names when attempting to parse the reporting task configuration file. commit 5a57670c70012e5d8e091076f74c14b1fa78a735 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 09:21:21 2015 -0400 NIFI-250: - Ensuring the editable flag is set correctly when creating a property table. - Properly cleaning up the new property dialog. commit 19b6845b66da5e45d8a974f7d4d7cd01712ef698 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 08:43:55 2015 -0400 NIFI-250: - Ensuring the actions columns is always last. - Fixing field visibility (between read only and editable). commit 17b512ea8e720115b6bce1c5f65797d256392781 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 07:45:05 2015 -0400 NIFI-250: - Using a utility function for populating fields. - Using a label for scheduling strategy rather than the enum value. commit 92cbce496936c7e166c8666b379dcc8582b6d121 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 07:30:50 2015 -0400 NIFI-250: - Adjusting the layout of the reporting task dialog. - Renaming the reporting task run status column. commit 2c6f3a97276975899be6cc0266d6770bc88e1718 Merge: a1a76912de2134
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 16 07:04:11 2015 -0400 Merge branch 'develop' into NIFI-250 commit a1a769104881eaf44ca9736cd185edc972eb5807 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 14:48:08 2015 -0400 NIFI-250: - Updating the controller service dialog to support a read only and editable modes. commit 40670067cb67d9df8a1817fd0c5b3a86d627d3a9 Merge: b1d65e5 d122a83 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 14:17:05 2015 -0400 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit b1d65e560a00925345222508c370b91a878a9ab2 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 14:16:44 2015 -0400 NIFI-250: - Updating the controller service dialog to support a read only and editable modes. - Ensuring the new property dialog is cleaned up if a property table instance is re-initialized (dom leak). - Better rending controller service state. - Fixing issue with component history when opening the processor details dialog. commit d122a83633683285cc6fd6daf65f0f533a0da2ca Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 13 12:01:00 2015 -0400 NIFI-250: Fixed NPE commit 52ea335d7c7e75b01f604a13c15f2b30c1b8df5c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 11:07:31 2015 -0400 NIFI-250: - Only handling new controller service state if it's actually different than the current value. commit 50f0c123bcb8474b110aac0abc528c0f9b6fe24a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 10:46:49 2015 -0400 NIFI-250: - Including active threads in the reporting task dto. - Verifying actions taken against component referencing controller services. - Rendering the run state for reporting tasks (including active thread counts). commit cd69a423dd6411cdefe1a3131865fc45f440d426 Merge: 6b36aef f556490 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 10:11:22 2015 -0400 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 6b36aefef942482a665182594fd3bb1044cad627 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 10:11:17 2015 -0400 NIFI-250: - Adding active thread count on reporting tasks. - Merging clustered responses for controller service and reporting task endpoints. commit f556490fb789706d4670ba6aef717de82285f29d Author: Mark Payne <markap14@hotmail.com> Date: Fri Mar 13 09:16:41 2015 -0400 NIFI-250: Added verify methods to controller service provider commit 79ddcb828e678e38ffb67f524bed03a72a3361dc Merge: d5a9a1a7198912
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 13 06:49:10 2015 -0400 Merge branch 'develop' into NIFI-250 commit d5a9a1a625e28f3d0a7d6ed72019e84088a05794 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 12 12:36:17 2015 -0400 NIFI-250: - Updating button visibility to always show the enable/run buttons when the service/task is disabled/stopped. Previously the enable/run buttons were only visible the component did not have any validation errors. However, this caused the buttons to shift and the alignment to be off. commit 8cc58fe80bf402bb594e391f980e565f1a2318f3 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 12 12:11:33 2015 -0400 NIFI-250: - Adding a button to link to the usage of a controller service or reporting task. commit c9604a3fcacf4c33606ca0be767c9d89ef4424a0 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 12 11:10:39 2015 -0400 NIFI-250: - Adding support for configuring the scheduling strategy and scheduling period for reporting tasks. commit ca7b65262113a61ef9716dec0367fc24e19f5a05 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 12 08:16:13 2015 -0400 NIFI-250: - Trying to ensure accurate details when enabling/disabling controller service and minimize web requests. - Fixing issues with the enabled flag in the controller service and reporting task dialog. commit ae3c29aa562f15b8af89afdeec15475a2dd96fb5 Merge: 4f4120256cc186
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Mar 12 06:50:16 2015 -0400 Merge branch 'develop' into NIFI-250 commit 4f41202e9df732211f9a9b2ccd54d1f652984d8b Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 11 16:36:56 2015 -0400 NIFI-250: - Updating controller service auditing to ensure transitive referenced components are reported correctly. - Restoring reference to reporting task provider. commit fe09680deaa76e9de7c962c98e50492173a1748e Merge: 4003542 85e38dc Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 11 15:48:04 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 40035429f886a501312b25b14f94cab38ed0c97f Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 11 15:47:58 2015 -0400 NIFI-250: Added missing methods to ReportingTaskProvider commit 85e38dc0555bf6a37ec378fc19b3a7811f8a32b3 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 11 15:40:23 2015 -0400 NIFI-250: - Setting the default name of the reporting task. commit 74d45aefbf6f74b04cd23808e4bb866cce027dc9 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 11 15:26:45 2015 -0400 NIFI-250: - Adding methods to obtain all reporting tasks. - Adding parameters to update the scheduled state of a reporting task. - Adding action buttons to the reporting task table. commit 2211741cad47ba24027f78f2e005cac888c8cb70 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 11 13:50:02 2015 -0400 NIFI-250: - Fixing issues showing the progress when enabling/disabling a controller service. - Ensure state for the service and its referencing components at all time since the action could be cancelled at any time. commit fc76a6165910441a372234dd3a4e626a83cbba48 Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 11 10:41:48 2015 -0400 NIFI-250: Fixed import that was accidentally removed commit 0d8cc34ae16979853a05b0ef214cd62694a31daf Merge: baa0e74 048c5d9 Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 11 08:45:36 2015 -0400 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit baa0e74cc37a6c74097da82ebf85d3b6e8e01d1a Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 11 08:45:33 2015 -0400 NIFI-250: Load controller services in correct order instead of arbitrary order commit 048c5d9aa757e3d2917d558857a59c4b6a6221f0 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 10 16:39:15 2015 -0400 NIFI-250: - Updating the progress label when enabling/disabling controller services and their referencing components. commit 51d70bff34174e19cd844404b8c0a61be79a8f39 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Mar 10 14:32:30 2015 -0400 NIFI-250: - Showing the progress of enabling/disabling of a controller service so the user knows what the status of each step. This is especially important when the action fails someplace in the middle. commit 5cc6fda21b9081e426b8a65132d0d971ef645c15 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 9 16:38:39 2015 -0400 NIFI-250: - Updating the enable/disable dialog to show the current status while waiting for referencing components. commit 6d12f134ff22927d02c7c500a5650b855fa52289 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 9 14:57:18 2015 -0400 NIFI-250: - Adding a close button after enabling/disabling a controller service. This gives the user an opportunity to review issues prior to closing the dialog. commit eb6c5b5e23e5b0af4fdb88c6264ba0b05efdbb94 Merge: bde21cb3533a4a
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 9 14:14:07 2015 -0400 Merge branch 'develop' into NIFI-250 commit bde21cb8a6227e9b59f1af7266e949a5cd41b87f Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 9 09:39:18 2015 -0400 NIFI-250: - Updating the layout of the enable/disable dialogs. - Showing referencing components validation errors where appropriate. commit 73459ccb5cfbc4aa81201e6476bb47ae450b49f7 Merge: 6f86758342ca17
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Mar 9 06:48:31 2015 -0400 Merge branch 'develop' into NIFI-250 commit 6f867585e1fade734dfecca434942d85fe20701d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 15:47:56 2015 -0500 NIFI-250: - Including validation errors in the controller service referencing components dto. commit b1dcab62a7f2ff6f2d15ef559058c7ec2358541e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 11:30:14 2015 -0500 NIFI-250: - Fixing missing import. commit 91f69b0cf23422838ca1f055064ae90e8749738f Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 10:16:23 2015 -0500 NIFI-250: - Adding a factory bean for obtaining the appropriate ReportingTaskProvider given the configured operating mode (cluster/node). - Fixing copy/paste error with the ControllerServiceProvicer factory bean. commit ed22742c0f27c66205838237f312ddac01a8f61a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 10:14:26 2015 -0500 NIFI-250: - JS global hint. commit bc508cd905daefc08389e921df6c681fa67dafdf Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 09:42:48 2015 -0500 NIFI-250: - Reseting the table size when opening the new controller service/reporting task dialog. - Fixing typo during scroll events over the breadcrumbs. - JS global hint. commit e5a314116bb43c54c2a920a7930423de038004cc Merge: 6b429bfbd74063
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 08:19:37 2015 -0500 Merge branch 'develop' into NIFI-250 commit 6b429bf42b5f31e6b7bfc18d932c9cd48a67e702 Merge: f34e343 883c4ac Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Mar 6 08:19:26 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 883c4ac9d7a1cdbd6989fb1312624a752c490461 Merge: 83eff8d 2d4aebf Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 4 15:50:58 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 83eff8d6df7b485a4d0eb03f176e4a28ff81df3b Author: Mark Payne <markap14@hotmail.com> Date: Wed Mar 4 15:50:30 2015 -0500 NIFI-250: Creating ReportingTaskProvider commit f34e34391716c0168b74241c284db3ffab444fe5 Merge: 2d4aebf5e0026c
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Mar 4 09:30:23 2015 -0500 Merge branch 'develop' into NIFI-250 commit 2d4aebf33b50b7603f2c19ba63d368bf125ce498 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Feb 20 15:08:39 2015 -0500 NIFI-250: - Continuing to setup Reporting Task management in the UI. commit c1077baf95f8c7e5ffc16ccea190b56af59c3fcc Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Feb 20 13:39:11 2015 -0500 NIFI-250: - Enabling/Disabling controller service and referencing components in the appropriate order. - Continuing to setup Reporting Task management in the UI. commit 573a8aa353bb47cbfc782d06786f31a93faa3d7a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Feb 19 16:30:50 2015 -0500 NIFI-250: - Using controller service state field instead of enable flag. - Continuing to setup Reporting Tasks. commit a227fe46b542fdcd6dd6fe57f11d678da237bc98 Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 15:56:38 2015 -0500 NIFI-250: Fixed bug that occurred in refactoring commit be00d0caf34cb2ec4f192563cb2e8707d145e8b1 Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 15:20:24 2015 -0500 NIFI-250: Added overloaded constructor to MockControllerServiceINitializationContext that allows no logger to be provided and autocreates one commit f246565f7e5344db91f731e003c7e35e1d7cbe95 Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 15:04:13 2015 -0500 NIFI-250: Incorporate new logic for controller service state commit 852cc607f6fad61178f7c9d3a26807c24eee4e0e Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 15:03:54 2015 -0500 NIFI-368: generate bulletins when there are problems communicating with reporting tasks and controller services commit ee63a10b8654c7a635e359eba9a7531aaf70fe6d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Feb 19 14:55:11 2015 -0500 NIFI-250: - Removing enabled flag from controller service DTOs. commit 767f37b8311f5fbbcfa5aacd6ef1230103034f09 Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 14:46:32 2015 -0500 NIFI-250: Updated javadocs to clarify how lifecycle annotations are used; cleaned up handling of exceptions in scheduler commit 5f2a4358869853deff7747ae3908d6952ee94001 Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 14:45:46 2015 -0500 NIFI-368: added componentlog to the initialization contexts for appropriate components and made abstract components return logger via getLogger() methods commit 8f78d619751c2bdb23f6c192a92716517922846a Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 14:29:21 2015 -0500 NIFI-368: Extracted methods from ProcessorLog out to ComponentLog and made ProcessorLog extend from ComponentLog. This maintains backward compatibility while providing more generic loggers for other components commit 7de30ab15ad9570233c4bff68f37acf324a66dda Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 13:30:37 2015 -0500 NIFI-250: Refactoring of controller service states commit 81d84546e7b456ae55cefe8892ddfb71a729bac9 Merge: 2ac6432 fac6cd7 Author: Mark Payne <markap14@hotmail.com> Date: Thu Feb 19 10:38:22 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit fac6cd7ac6dc1ed883a18369ebfbbde0886b11ec Merge: a3836d857b5d58
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Feb 19 07:50:29 2015 -0500 Merge branch 'develop' into NIFI-250 commit a3836d832d4cdc75a6b9317a04fed00c9b062c22 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 18 15:17:48 2015 -0500 NIFI-250: - Starting to add an endpoint for Reporting Tasks. commit ffa7fd06d1c85e8aa45568e27f155309fb9bede9 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 18 13:38:30 2015 -0500 NIFI-250: - Adding the scope to the disable controller service dialog. commit bbe185609ad037b8f1ed6529e25bea1b60613653 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 18 13:38:11 2015 -0500 NIFI-250: - Updating the controller services references endpoint to accept either an enabled flag for referencing controller services or a state for referencing schedulable components. commit 4efd9622109f584daddb76d6b5de2399bd7d8209 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 18 09:49:34 2015 -0500 NIFI-250: - Updating the polling for controller service status when disabling. commit 2ac643292c691d451cf98e2a309bff72182b0a88 Merge: d30a1846457929
Author: Mark Payne <markap14@hotmail.com> Date: Wed Feb 18 08:15:45 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 6457929b25ba5923bebeb6ab4566e4208d1a092e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Feb 17 15:32:31 2015 -0500 NIFI-250: - Adding auditing to activating/deactivating controller service references. commit e61a01ac6968ba2f1e4f8fa1d3ca9c2cbca400e6 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Feb 17 14:55:44 2015 -0500 NIFI-250: - Only showing the enable button when the controller service is valid. - Adding polling during deactivation of controller service references to know when it's ok to attempt to disable the controller service. commit f22407f59347010aede5c12cd64652a381f4fd59 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Feb 17 14:54:32 2015 -0500 NIFI-250: - Updating the controller service references endpoint to accept an activated flag that drivens whether processors/reporting tasks are started/stopped and controller services enabled/disabled. commit e4e61daa26c996d3234982cf1409bb501631b9d0 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Feb 17 12:48:39 2015 -0500 NIFI-250: - Updating fill color dialog styling for use in updated modal plugin. - Making the fill color dialog draggable. commit 4ce7202d93551acaea8e6f782df694eee1435ec5 Merge: 2769db70047fa4
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Feb 17 12:36:47 2015 -0500 Merge branch 'develop' into NIFI-250 Conflicts: nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/dialog.css commit 2769db7b4e783540b03bf2fee800a56d86e79d4d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 16:17:03 2015 -0500 NIFI-250: - Adding an enable controller service dialog. commit d30a1843c24caccf822811649332dad7e1aa5b17 Author: Mark Payne <markap14@hotmail.com> Date: Wed Feb 11 16:08:20 2015 -0500 NIFI-250: Deleted dead code commit 62b0669e121e817cd80ba21b8104ad9e210ea531 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 11:25:04 2015 -0500 NIFI-250: - Renaming references to referencing components to be more accurate. - Fixing borders around the referencing components. commit 819c76b885268db294b62e11095faf52eaebf57c Merge: ceede01 371e010 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 11:14:37 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 371e0100d35864f0092b133a7decac34ffb4be33 Author: Mark Payne <markap14@hotmail.com> Date: Wed Feb 11 11:11:49 2015 -0500 NIFI-250: Move activate/deactive methods for controller services' referencing components to ControllerServiceProvider commit ceede01b8ffe57c003ac246b51854dd6b01ad70e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 10:45:14 2015 -0500 NIFI-250: - Adding endpoints for retrieving and updating controller service referencing components. commit 8a414b3ca9a542170cf31d6396c3e3e2947b90fc Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 10:43:37 2015 -0500 NIFI-250: - Adding endpoints for retrieving and updating controller service referencing components. commit ed4d22c1ff17395a683a83d9f57dfdc842ce175f Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 09:22:18 2015 -0500 NIFI-250: - Additionally refactoring of removal of ControllerServiceProvider usage. commit 0d2041b05ffc618c2393713e96c44cf8384aa6e3 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 08:54:19 2015 -0500 NIFI-250: - Replacing usage of ControllerServiceProvider with ControllerServiceLookup. commit 3d38d8c98c180f5446b0f2dafea78eeec38e432e Merge: 4bc5ed156a6bc4
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 11 07:09:05 2015 -0500 Merge branch 'develop' into NIFI-250 commit 4bc5ed13ef981b49390b1e8460105e8ed227b446 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Feb 10 14:34:48 2015 -0500 NIFI-250: - Rendering the references in the disable controller service dialog. - Reloading controller service table when appropriate. - Padding in dialogs with a border. commit 5390c7626a99c076daf05d06118815f902ab7b51 Author: Mark Payne <markap14@hotmail.com> Date: Tue Feb 10 11:54:17 2015 -0500 NIFI-250: Fixed NPE in StandardSSLContextService commit c25a2caecd31638d3564ea4892986d0580234783 Author: Mark Payne <markap14@hotmail.com> Date: Tue Feb 10 11:53:51 2015 -0500 NIFI-250: Persist Controller Services and Reporting Tasks on NCM commit 33f551630ac2664cf938834c7e450d04da7ec9f0 Author: Mark Payne <markap14@hotmail.com> Date: Tue Feb 10 11:08:05 2015 -0500 NIFI-250: Remove references to Controller Service when the referencing component is removed commit ea8cb59848e5cc75c201ce1b9521aa56eb293674 Author: Mark Payne <markap14@hotmail.com> Date: Tue Feb 10 09:48:01 2015 -0500 NIFI-250: Expose number of active threads in ProcessorNode, ReportingTaskNode commit 40e25066742f910a2c34881eb216a18d5233cdf1 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 9 14:56:22 2015 -0500 NIFI-250: - Reloading components that reference controller services when appropriate. - Created an icon for enabling a controller service. commit 4481213849cee69537c23d54871c4dc07bd7fb87 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 9 13:28:20 2015 -0500 NIFI-250: - Updating dialogs to address issues when showing the borders within the modal plugin (especially in the controller service configuration dialog). - Fixing availability when creating a controller service in standalone. commit 94d112b6ec90cc9df4adc9b85cc9df45908a1f36 Merge: c7ee77bb64fe47
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 9 09:48:23 2015 -0500 Merge branch 'develop' into NIFI-250 commit c7ee77be9781057109021c9db6981d9905397b3e Merge: 7da7c930133f84
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 9 07:35:46 2015 -0500 Merge branch 'develop' into NIFI-250 commit 7da7c9327029a84581c5aff5f3435f2706d2c18e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Feb 6 15:32:09 2015 -0500 NIFI-250: - Updating the UI to gather the availability for a controller service during creation. - Removing the concept of availability from the core as the service/task can only be available on the cluster manager OR nodes. - Updating web tier to support this concept. commit 55949a428f45b7e615c09d6f870196fcc95acfe7 Author: Mark Payne <markap14@hotmail.com> Date: Fri Feb 6 10:45:59 2015 -0500 NIFI-250: Removed 'Availability' concept from reporting tasks and controller services because it is implicitly, depending on if on node or ncm commit d95ca18a0cc6834defbf184e2cae5ee93228e832 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Feb 6 08:55:07 2015 -0500 NIFI-250: - Javadocs. commit 6892f19d61ebd4ae227b43452ba9c4303bd522eb Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Feb 6 07:52:38 2015 -0500 NIFI-250: - Including the user who last modified the flow in the refresh tooltip. commit 9f9466cb418b01295ecbe727dca07e82ddda9cb5 Merge: 4a8da60d36a71c
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Feb 6 07:17:11 2015 -0500 Merge branch 'develop' into NIFI-250 commit 4a8da60334f4b78a123906a6a712d95ec873c687 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Feb 5 15:59:35 2015 -0500 NIFI-250: - Refactoring revision checking so that we can lock appropriately on the Cluster Manager to manage controller services running there while other concurrent requests can be replicated amongst the cluster. commit 17add531f656b6d8065bed74a887acaa00a07f9a Merge: 3425dee4a49ba7
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Feb 5 07:13:56 2015 -0500 Merge branch 'develop' into NIFI-250 commit 3425dee1f2aca679235b434b40bb49be8099ff55 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 4 14:04:38 2015 -0500 NIFI-250: - Invoking the appropriate save when updating controller services. commit 6b91546d9d04dcb127cada3cdc907e9ef98abf42 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 4 13:13:09 2015 -0500 NIFI-250: - Fixing use of the optimistic locking manager factory bean. commit cc8b096ffa11ee44f6d5fb5f07de51826dd27b20 Merge: 13fb1a7ed53b46
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Feb 4 12:44:56 2015 -0500 Merge branch 'develop' into NIFI-250 Conflicts: nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/history/nf-history-table.js nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js nifi/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PostHTTP.java commit 13fb1a758b59cd7e205caed694f28b4d0dba9d82 Merge: 22822d3037f36d
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 2 09:27:26 2015 -0500 Merge branch 'develop' into NIFI-250 commit 22822d33a2159d1f9a2b12caafbce7c2b46ebe52 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 2 09:10:12 2015 -0500 NIFI-250: - Updating the ControllerService endpoint to specify the availability of the service. - Updating the optimistic locking manager to ensure the proper revision is checked. commit 346cc0cf14aad3f2240336eda711e63f29e62a7c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 2 07:55:57 2015 -0500 NIFI-250: - Using the ControllerServiceProvider instead of delegating directly to the FlowController. This will allow us to work with the NCM when clustered. commit 0cb1adbc1f1bf0272be813bf58b90444243b65b5 Merge: d1caa7e cc25d1d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 2 07:52:38 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit d1caa7ee3e2e8662eeb2b368b2ed81fface22711 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Feb 2 07:52:32 2015 -0500 NIFI-250: - Updating REST API for managing controller services. - Starting to add a dialog for disabling a controller service. commit cc25d1d21cae8b30eff0db66d1ad9b6bbae5351d Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 14:43:54 2015 -0500 NIFI-250: Updated to pass Availability when creating controller services commit e056bb7d70de8e1dea7bab9f59d9f466aef45eda Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 14:37:42 2015 -0500 NIFI-250: Fixed bug that caused EOFException if no reporting tasks defined on NCM commit 4ae2a10e6d130353ea34aa403d3bcbad7a2ab4e8 Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 13:01:00 2015 -0500 Load Controller Services from flow.tar file instead and external file commit 52149d8510d8c517063bfd6359bde3950862db77 Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 12:44:30 2015 -0500 NIFI-250: Change Availability to just NODE or NCM; update NCM to store controller services and reporting tasks in separate entries in tar file instead of in flow.xml commit 3102e08378b34cb869c708faa05c427de6b68139 Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 10:18:54 2015 -0500 NIFI-250: Updated ControllerServiceProvider to have a 'createControllerService' that takes no identifier and randomly generates one commit 3344cef3365dfc620f11aaf18fcfc8ba7d58e16a Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 09:05:58 2015 -0500 NIFI-250: Updated controller services to use appropriate defaults and use .identifiesControllerService instead of using the old way of obtaining controller services; do not fail to startup if controller service is invalid commit 1682e47aa3820bca6ec80e6009a16d0572fb1a9b Merge: fbc14e0 e7beef8 Author: Mark Payne <markap14@hotmail.com> Date: Fri Jan 30 08:36:55 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 2de754a11af2f3d545ae9358c06dd6838e3d920c Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 30 08:35:18 2015 -0500 NIFI-250: - Showing controller service validation errors. commit 600f8f7869161b50dc9939401ce8a91a64e3462a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 30 07:46:47 2015 -0500 NIFI-250: - Adding support to go to a controller service. commit e7beef8d224797c057650787c4041b15dbef87af Merge: 1ebaf1dbafa945
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 30 07:22:25 2015 -0500 Merge branch 'develop' into NIFI-250 commit fbc14e0a3a46c0511d6135e86797cfc14c81d7d5 Merge: 9a6acab 1ebaf1d Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 16:26:08 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 1ebaf1d29c7294b07f68def9d463c791f6d68cf9 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Jan 29 13:06:54 2015 -0500 NIFI-250: - Addressing the border visibility when toggling a reference block. commit b98a7220c04582ad7305429ddee850096c2139cd Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Jan 29 12:56:15 2015 -0500 NIFI-250: - Showing components that reference a given controller service. commit 9a6acab3734fbbb670fb5db2388ac85ef9b6fc6d Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 11:24:56 2015 -0500 NIFI-250: Do not try to load controller services and reporting tasks from old .xml files because they are now in flow.xml commit 60ad998153f6c391f4a36f25b91629bde7d3e98b Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 11:24:11 2015 -0500 NIFI-250: Load Controller Services before processors or reporting tasks on restart commit cfaafa3c291bbbe1009c10c10204befea0482bbe Merge: 52d329c 4737a41 Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 10:55:09 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit 4737a41a9ce7de540c7dce1d19e54802ce9127a9 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Jan 29 10:51:18 2015 -0500 NIFI-250: - Addressing some issues with reloading controller services on restart. - Starting to add the controller service references to the dialog. - Reloading processors and controller services before configuration to ensure their property descriptors are current. commit 52d329ca036e059f50a169b726f4c202859ed0e1 Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 10:02:15 2015 -0500 NIFI-250: Restore appropriate reporting task id on restart commit 59f5b95c3ac3b1660da35aec63c22b23347a5aa3 Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 09:56:55 2015 -0500 NIFI-250: Restore Controller Service using appropriate ID on restart commit d60710b6fbbddc8bb1b6d8f5a7b078bbf7e4bd0a Merge: f18aca1 bb628b0 Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 09:05:57 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit f18aca1e0a6a701b9390cbe80e131296fbcbc7e7 Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 09:05:43 2015 -0500 NIFI-250: Fixed bug where validator returns controller service identifier instead of name in description. Fixed bug where controller serivce references are not updated when property is removed from processor/service/reporting task commit 31caadb20a85c2afa53969b1bd60f1979e1f004f Author: Mark Payne <markap14@hotmail.com> Date: Thu Jan 29 08:49:44 2015 -0500 NIFI-250: Fixed bug that caused IllegalStateException if property not set on controller service or reporting task commit bb628b07a905ddb7b6dbf0c7c216d00627f82668 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 15:55:00 2015 -0500 NIFI-250: - Adding support for showing property history for controller services. commit 0d1f80f22ecae9d8c5cc63fb7224ac551c0571d2 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 15:54:26 2015 -0500 NIFI-250: - Adding support for showing property history for controller services. commit 5f571be29a4d934ec65701093dcc67964664b3f7 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 15:02:02 2015 -0500 NIFI-250: - Allowing read only users to view the controller settings (including controller services and reporting tasks). commit 4564a137cbd929b7620c1008a1fc14fa60680421 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 14:28:47 2015 -0500 NIFI-250: - Showing refresh notice in the settings tab when the flow changes externally (another user). commit c9d9d3199a40b602f1dfb2ccc532c264b4e223ab Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 13:13:36 2015 -0500 NIFI-250: - Auditing controller service actions. commit 0aee34c287c28a01022f23a8a5809de489282734 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 12:40:02 2015 -0500 NIFI-250: - Auditing controller service actions. commit d90e9d6a7203db4e612ca27fb2567dd2b92c8d88 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 10:51:36 2015 -0500 NIFI-250: - Documentation. - Prepping the list of controller service references. commit 6581eb1360902225312d532c07b86343df175bc5 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 10:32:15 2015 -0500 NIFI-250: - Including the controller service references. commit 68583ab90a50f5929859144326dc105cc4753acd Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 09:36:34 2015 -0500 NIFI-250: - Fixing the NODE_ONLY value. commit e06e423ff191696f0ab2a081434ac7b26e183b91 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 09:30:33 2015 -0500 NIFI-250: - Only showing the availability field when clustered. commit 91aa952f017dac0bf8cb1597ec3440f9bd8cda7a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 09:24:27 2015 -0500 NIFI-250: - Adding support to enable/disable controller services through the actions in the table. commit 5d5cb8f106c630e92852cf0fdefdad1c602c4520 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 08:35:17 2015 -0500 NIFI-250: - Wiring up updating and deleting controller services. - Ensuring the new property dialog is closed when clearing the grid. commit 2303570eb68da63ebbd3a438555e3f523ec7308d Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 28 08:33:42 2015 -0500 NIFI-250: - Adding parameters to the update controller service endpoint. commit 593afddaf0d1a0746064ad0cf3b74a7b06dc7031 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 27 16:21:41 2015 -0500 NIFI-250: - Documentation. - Updating how actions are triggered in the controller service table. commit cf188ebc838ba3f0c26ae14c30e73b8a33510735 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 27 16:20:35 2015 -0500 NIFI-250: - Starting to implement the controller service DAO. commit 526e18d00a1bdf8a63ebc70fd257ea23bf678425 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 27 15:20:01 2015 -0500 NIFI-250: - Using the property table plugin in the read only processor details dialog. - Clean up. commit 2d7c700d173e757ca51b7b9832c9b385a67061c5 Merge: ec082f1 ea17dbe Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 27 13:53:02 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit ec082f1eead6b37e3b26e579f958cc0cde154d22 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 27 13:52:42 2015 -0500 NIFI-250: - Creating a jQuery plugin for rendering a table of properties (since we now want to configure processors, controller services, and reporting tasks). commit 5785198f66c2d3d2aa17767a8941f194afc5638b Author: Mark Payne <markap14@hotmail.com> Date: Tue Jan 27 09:56:50 2015 -0500 NIFI-250: Removed TODO comment that was completed commit ea17dbec6e1b4384c91fab9e54e30b29c6190c8d Author: Mark Payne <markap14@hotmail.com> Date: Tue Jan 27 09:48:45 2015 -0500 NIFI-250: Renamed 'getComment' and 'setComment' in ControllerServiceNode and ReportingTaskNode to 'getComments' and 'setComments' to be more consistent with how naming throughout the rest of the app commit f14a34f6686621501ddcc68efbcc64f001c96ab8 Author: Mark Payne <markap14@hotmail.com> Date: Tue Jan 27 09:22:40 2015 -0500 NIFI-250: Updated flow.xml schema to take reporting tasks and controller services into account; removed schemas for reporting tasks and controller services. commit 24b4f1cf1109af53d6fd94d81fe81141e7dd0423 Merge: 4de0fd0 cb84829 Author: Mark Payne <markap14@hotmail.com> Date: Tue Jan 27 08:36:57 2015 -0500 Merge branch 'NIFI-250' of http://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit cb84829b31cd709cedf866ac41854c3a2e74a158 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 27 08:29:50 2015 -0500 NIFI-250: - Renaming comment to comments. - Ensuring type is included in DTO and create request. commit 4de0fd02678ce13d5a8b08edbc35a677560ded4d Author: Mark Payne <markap14@hotmail.com> Date: Mon Jan 26 19:05:31 2015 -0500 NIFI-250: Only run controller services and reporting tasks on the nodes/ncm according to their Availability commit 2df4500c05ac91d46614e9ca41974fed890d2646 Author: Mark Payne <markap14@hotmail.com> Date: Mon Jan 26 15:17:04 2015 -0500 NIFI-250: Implemented fingerprinting and reloading of controller services and reporting tasks from flow.xml commit 86d15f9e1c3b28a9ae587a1cb0c73cd2b6e8b51c Author: Mark Payne <markap14@hotmail.com> Date: Mon Jan 26 13:55:55 2015 -0500 NIFI-250: Serialize and deserialize controller services and reporting tasks in the flow.xml commit ff43b039085c56bb5f53148e25878ad71972a3db Merge: 7a3d208 2da5792 Author: Mark Payne <markap14@hotmail.com> Date: Mon Jan 26 11:53:17 2015 -0500 NIFI-250: Merged changes commit 7a3d208f031122ab13349ace8aeafac9fe5c54ac Author: Mark Payne <markap14@hotmail.com> Date: Mon Jan 26 11:42:01 2015 -0500 NIFI-250: Allow Controller Services to be created without id and properties; allow controller service lookup to provide name of controller service given an id commit 80f02e47256590c57a811b79040b70c827e71ff2 Author: Mark Payne <markap14@hotmail.com> Date: Mon Jan 26 10:31:06 2015 -0500 Added Eclipse-specific files to .gitignore commit 2da57924286fe1f9ae320e270ba0aba77a08d8b7 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 26 09:39:14 2015 -0500 NIFI-250: - Ensuring the tables are resized when appropriate. commit 1854ebed22387d0f1a82bd9c52ab1ab5ae5c7e21 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 26 09:38:59 2015 -0500 NIFI-250: - Fixing NPE in stubbed out method. commit 3e77e7d32e2c4e39a8247eacb44681a57bc3b618 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 26 09:29:34 2015 -0500 NIFI-250: - Supporting updated API. commit e989215fa539f61eba7c915d1b04adebcc771c69 Merge: 0c021c76b560b9
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 26 09:19:12 2015 -0500 Merge branch 'develop' into NIFI-250 commit 0c021c782589b4fe439dcb0f81d229fde6cd9327 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 26 09:18:06 2015 -0500 NIFI-250: - Starting to load the controller services and prepare for adding them. commit 35616e9ad64cd2985cf2e2cd1a2aa5fce33d980d Merge: 662231733cee9d
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 26 07:15:00 2015 -0500 Merge branch 'develop' into NIFI-250 commit 6622317c1bcfb6b0a8f15cd1889fd644b2264a3a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 23 10:54:34 2015 -0500 NIFI-250: - Adding a field to collect the controller service name during creation. commit cb4c654c7f244ee7222fb444ccca096b8f56e164 Merge: e604caf43e646e
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 23 09:30:27 2015 -0500 Merge branch 'develop' into NIFI-250 commit e604cafe79f5a90e9179a9f2e46e3cbbb7f47380 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Thu Jan 22 15:24:17 2015 -0500 NIFI-250: - Adding an endpoint to manage ControllerServices. commit c8ea6830672350e1469a21eeda2ce02a6f6236ac Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 21 08:03:15 2015 -0500 NIFI-250: - Moving files into the appropriate renamed directories. commit f2b9f2c8d418d14fd982d721ccbb6b2bb0874de1 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 21 08:02:50 2015 -0500 NIFI-250: - Moving files into the appropriate renamed directories. commit c5d452c1435d3d32df3da4100ca740ca372adb3d Merge: e8d2bbfcff8b0d
Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 21 07:37:09 2015 -0500 Merge branch 'develop' into NIFI-250 commit e8d2bbfe3c286fc21dea04e993771985d843b6e6 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 20 13:35:18 2015 -0500 NIFI-250: - Making the new controller services table collapsible. - Addressing issues with filtering, rollup, tags, and collapsing. commit 4836385628b5622aa77c8adacd3a5241f8ee1829 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 20 12:28:41 2015 -0500 NIFI-250: - Ensuring the entire hierarchy is returned for each service type. commit 66bd61e07bff17ddf7d672088e13d0b01bbfc96f Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 20 08:40:37 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 Conflicts: nifi/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java nifi/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java commit 1392f328c905a7919d2555767cb53395409e3e1e Merge: 39a77e4 b29b61a Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 20 08:34:05 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 Conflicts: nifi/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java nifi/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java commit 39a77e4828e41f635f2f85c68b78ca9e21ad1970 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 13 14:52:23 2015 -0500 NIFI-250: - Creating endpoints for returning the available controller services and reporting tasks. - Made the Setting tabbed to provide a place for configuring controller services and reporting tasks. commit 58b02e41eec54b1eff86a90205ab69f007ad1b00 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 16 12:02:33 2015 -0500 NIFI-250: merging from develop commit b204688bfa738c47bed71a1aab6c46171b21107f Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 16 11:59:51 2015 -0500 NIFI-250: - Starting to making the available controller services collapsible. Still need to clean up and handle selection properly. commit b39fdbd6052adf342f72f44764145a3564669920 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 13 14:52:23 2015 -0500 NIFI-250: - Creating endpoints for returning the available controller services and reporting tasks. - Made the Setting tabbed to provide a place for configuring controller services and reporting tasks. NIFI-250: - Extracting the tagcloud into a re-usable jQuery plugin. NIFI-250: - Creating a new controller service dialog. Dialog may be refactored into a reusable widget if possible. - Loading the new controller service dialog with all available controller services. - Fixing typos. commit b29b61a5a8290b1b0a5513786227d7036e37aa6b Merge: 8976ff4 bb108a0 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Mon Jan 19 13:15:03 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 Conflicts: nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/WEB-INF/partials/canvas/settings-content.jsp nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/css/settings.css nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js nifi/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java nifi/nar-bundles/framework-bundle/framework/web/nifi-web-api/src/main/java/org/apache/nifi/web/controller/ControllerFacade.java commit 8976ff49834ad4116b0fe9425be00e86da74b1a7 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 16 12:02:33 2015 -0500 NIFI-250: merging from develop commit 367baad5b6d9d633610e3547c75776338989f785 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Fri Jan 16 11:59:51 2015 -0500 NIFI-250: - Starting to making the available controller services collapsible. Still need to clean up and handle selection properly. commit 14da3f3de97f4b72afe591026c2690f92f4f7606 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 13 14:52:23 2015 -0500 NIFI-250: - Creating endpoints for returning the available controller services and reporting tasks. - Made the Setting tabbed to provide a place for configuring controller services and reporting tasks. NIFI-250: - Extracting the tagcloud into a re-usable jQuery plugin. NIFI-250: - Creating a new controller service dialog. Dialog may be refactored into a reusable widget if possible. - Loading the new controller service dialog with all available controller services. - Fixing typos. commit bb108a0960d6095791afd367bee91e62d8d605da Merge: da18ce0 03d422e Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Wed Jan 14 13:34:45 2015 -0500 Merge branch 'NIFI-250' of https://git-wip-us.apache.org/repos/asf/incubator-nifi into NIFI-250 commit da18ce0ab0fee2e497e65ff4af30dd8dac212e96 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 13 14:52:23 2015 -0500 NIFI-250: - Creating endpoints for returning the available controller services and reporting tasks. - Made the Setting tabbed to provide a place for configuring controller services and reporting tasks. commit 03d422e4d4d65ebe4b080fc5ec88cc7aae30ae82 Author: Matt Gilman <matt.c.gilman@gmail.com> Date: Tue Jan 13 14:52:23 2015 -0500 NIFI-250: - Creating endpoints for returning the available controller services and reporting tasks. - Made the Setting tabbed to provide a place for configuring controller services and reporting tasks.
This commit is contained in:
parent
e7d6d94584
commit
e9647717e3
|
@ -24,16 +24,25 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
|
||||
* implementation can use to indicate a method
|
||||
* should be called whenever the component is added to the flow. This method
|
||||
* will be called once for the entire life of a component instance.
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are called without any arguments, as all settings
|
||||
* and properties can be assumed to be the defaults.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If any method annotated with this annotation throws a Throwable, the component
|
||||
* will not be added to the flow.
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -23,19 +23,32 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.apache.nifi.controller.ConfigurationContext;
|
||||
|
||||
/**
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService} or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
|
||||
* can use to indicate a method should be called whenever the component is disabled.
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.controller.ControllerService ControllerService}
|
||||
* can use to indicate a method should be called whenever the service is disabled.
|
||||
*</p>
|
||||
*
|
||||
* <p>
|
||||
* Methods using this annotation must take no arguments. If a method with this annotation
|
||||
* throws a Throwable, a log message and bulletin will be issued for the component, but
|
||||
* the component will still be disabled.
|
||||
* Methods using this annotation are permitted to take zero arguments or to take a single
|
||||
* argument of type {@link ConfigurationContext}. If a method with this annotation
|
||||
* throws a Throwable, a log message and bulletin will be issued for the service, and the
|
||||
* service will remain in a 'DISABLING' state. When this occurs, the method with this annotation
|
||||
* will be called again after some period of time. This will continue until the method returns
|
||||
* without throwing any Throwable. Until that time, the service will remain in a 'DISABLING' state
|
||||
* and cannot be enabled again.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Note that this annotation will be ignored if applied to a ReportingTask or Processor. For a Controller
|
||||
* Service, enabling and disabling are considered lifecycle events, as the action makes them usable or
|
||||
* unusable by other components. However, for a Processor and a Reporting
|
||||
* Task, these are not lifecycle events but rather a mechanism to allow a component to be excluded when
|
||||
* starting or stopping a group of components.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -25,35 +25,35 @@ import java.lang.annotation.Target;
|
|||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService} or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask}
|
||||
* can use to indicate a method should be called whenever the component is enabled.
|
||||
* Any method that has this annotation will be called every time a user enables the component.
|
||||
* Marker annotation a {@link org.apache.nifi.controller.ControllerService ControllerService}
|
||||
* can use to indicate a method should be called whenever the service is enabled.
|
||||
* Any method that has this annotation will be called every time a user enables the service.
|
||||
* Additionally, each time that NiFi is restarted, if NiFi is configured to "auto-resume state"
|
||||
* and the component is enabled (whether stopped or running), the method will be invoked.
|
||||
* and the service is enabled, the method will be invoked.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods using this annotation must take either 0 arguments or a single argument.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Processor, that argument must
|
||||
* be of type {@link org.apache.nifi.processor.ProcessContext ProcessContext}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If using 1 argument and the component using the annotation is a Reporting Task or Controller Service,
|
||||
* that argument must be of type {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* Methods using this annotation must take either 0 arguments or a single argument of type
|
||||
* {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* If a method with this annotation throws a Throwable, a log message and bulletin will be issued
|
||||
* for the component, but the component will still be enabled.
|
||||
* for the component. In this event, the service will remain in an 'ENABLING' state and will not be
|
||||
* usable. All methods with this annotation will then be called again after a delay. The service will
|
||||
* not be made available for use until all methods with this annotation have returned without throwing
|
||||
* anything.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Note that this annotation will be ignored if applied to a ReportingTask or Processor. For a Controller
|
||||
* Service, enabling and disabling are considered lifecycle events, as the action makes them usable or
|
||||
* unusable by other components. However, for a Processor and a Reporting
|
||||
* Task, these are not lifecycle events but rather a mechanism to allow a component to be excluded when
|
||||
* starting or stopping a group of components.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -23,7 +23,11 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.apache.nifi.controller.ConfigurationContext;
|
||||
import org.apache.nifi.processor.ProcessContext;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
|
@ -32,7 +36,15 @@ import java.lang.annotation.Target;
|
|||
* component instance. If the method throw any Throwable, that Throwable will be
|
||||
* caught and logged but will not prevent subsequent methods with this annotation
|
||||
* or removal of the component from the flow.
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are permitted to take no arguments or to take a single
|
||||
* argument. If using a single argument, that argument must be of type {@link ConfigurationContext}
|
||||
* if the component is a ReportingTask or a ControllerService. If the component is a Processor,
|
||||
* then the argument must be of type {@link ProcessContext}.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -23,7 +23,11 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.apache.nifi.controller.ConfigurationContext;
|
||||
import org.apache.nifi.processor.ProcessContext;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor},
|
||||
* {@link org.apache.nifi.controller.ControllerService ControllerService}, or
|
||||
* {@link org.apache.nifi.reporting.ReportingTask ReportingTask} implementation
|
||||
|
@ -31,7 +35,14 @@ import java.lang.annotation.Target;
|
|||
* This will be called at most once for each component in a JVM lifetime.
|
||||
* It is not, however, guaranteed that this method will be called on shutdown, as
|
||||
* the service may be killed suddenly.
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are permitted to take either 0 or 1 argument. If an argument
|
||||
* is used, it must be of type {@link ConfigurationContext} if the component is a ReportingTask
|
||||
* or Controller Service, or of type {@link ProcessContext} if the component is a Processor.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
|
|
|
@ -23,6 +23,9 @@ import java.lang.annotation.Retention;
|
|||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import org.apache.nifi.controller.ConfigurationContext;
|
||||
import org.apache.nifi.processor.ProcessContext;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Marker annotation a {@link org.apache.nifi.processor.Processor Processor} or
|
||||
|
@ -47,6 +50,12 @@ import java.lang.annotation.Target;
|
|||
* longer scheduled to run (as opposed to after all threads have returned from the
|
||||
* <code>onTrigger</code> method), see the {@link OnUnscheduled} annotation.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* Methods with this annotation are permitted to take either 0 or 1 argument. If an argument
|
||||
* is used, it must be of type {@link ConfigurationContext} if the component is a ReportingTask
|
||||
* or of type {@link ProcessContext} if the component is a Processor.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
|
|
|
@ -47,8 +47,6 @@ import java.lang.annotation.Target;
|
|||
* If using 1 argument and the component using the annotation is a Reporting Task, that argument must
|
||||
* be of type {@link org.apache.nifi.controller.ConfigurationContext ConfigurationContext}.
|
||||
* </p>
|
||||
*
|
||||
* @author none
|
||||
*/
|
||||
@Documented
|
||||
@Target({ElementType.METHOD})
|
||||
|
|
|
@ -142,9 +142,19 @@ public final class PropertyDescriptor implements Comparable<PropertyDescriptor>
|
|||
final Set<String> validIdentifiers = context.getControllerServiceLookup().getControllerServiceIdentifiers(controllerServiceDefinition);
|
||||
if (validIdentifiers != null && validIdentifiers.contains(input)) {
|
||||
final ControllerService controllerService = context.getControllerServiceLookup().getControllerService(input);
|
||||
if (!context.getControllerServiceLookup().isControllerServiceEnabled(controllerService)) {
|
||||
if ( !context.isValidationRequired(controllerService) ) {
|
||||
return new ValidationResult.Builder()
|
||||
.input(input)
|
||||
.input(input)
|
||||
.subject(getName())
|
||||
.valid(true)
|
||||
.build();
|
||||
}
|
||||
|
||||
final String serviceId = controllerService.getIdentifier();
|
||||
if (!context.getControllerServiceLookup().isControllerServiceEnabled(serviceId) &&
|
||||
!context.getControllerServiceLookup().isControllerServiceEnabling(serviceId)) {
|
||||
return new ValidationResult.Builder()
|
||||
.input(context.getControllerServiceLookup().getControllerServiceName(serviceId))
|
||||
.subject(getName())
|
||||
.valid(false)
|
||||
.explanation("Controller Service " + controllerService + " is disabled")
|
||||
|
|
|
@ -80,6 +80,15 @@ public interface ValidationContext {
|
|||
*/
|
||||
String getAnnotationData();
|
||||
|
||||
/**
|
||||
* There are times when the framework needs to consider a component valid, even if it
|
||||
* references an invalid ControllerService. This method will return <code>false</code>
|
||||
* if the component is to be considered valid even if the given Controller Service is referenced
|
||||
* and is invalid.
|
||||
* @param service
|
||||
*/
|
||||
boolean isValidationRequired(ControllerService service);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the given value contains a NiFi Expression Language expression,
|
||||
* <code>false</code> if it does not
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.nifi.components.AbstractConfigurableComponent;
|
|||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
import org.apache.nifi.components.PropertyValue;
|
||||
import org.apache.nifi.controller.annotation.OnConfigured;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.processor.ProcessorInitializationContext;
|
||||
import org.apache.nifi.reporting.InitializationException;
|
||||
|
||||
|
@ -30,11 +31,13 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
|
|||
private String identifier;
|
||||
private ControllerServiceLookup serviceLookup;
|
||||
private volatile ConfigurationContext configContext;
|
||||
|
||||
private ComponentLog logger;
|
||||
|
||||
@Override
|
||||
public final void initialize(final ControllerServiceInitializationContext context) throws InitializationException {
|
||||
this.identifier = context.getIdentifier();
|
||||
serviceLookup = context.getControllerServiceLookup();
|
||||
logger = context.getLogger();
|
||||
init(context);
|
||||
}
|
||||
|
||||
|
@ -88,4 +91,12 @@ public abstract class AbstractControllerService extends AbstractConfigurableComp
|
|||
*/
|
||||
protected void init(final ControllerServiceInitializationContext config) throws InitializationException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the logger that has been provided to the component by the framework in its initialize method.
|
||||
* @return
|
||||
*/
|
||||
protected ComponentLog getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.apache.nifi.controller;
|
||||
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
|
||||
public interface ControllerServiceInitializationContext {
|
||||
|
||||
/**
|
||||
|
@ -33,4 +35,12 @@ public interface ControllerServiceInitializationContext {
|
|||
* @return
|
||||
*/
|
||||
ControllerServiceLookup getControllerServiceLookup();
|
||||
|
||||
/**
|
||||
* Returns a logger that can be used to log important events in a standard way and generate
|
||||
* bulletins when appropriate
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ComponentLog getLogger();
|
||||
}
|
||||
|
|
|
@ -41,6 +41,18 @@ public interface ControllerServiceLookup {
|
|||
*/
|
||||
boolean isControllerServiceEnabled(String serviceIdentifier);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the Controller Service with the given
|
||||
* identifier has been enabled but is still in the transitioning state,
|
||||
* otherwise returns <code>false</code>.
|
||||
* If the given identifier is not known by this ControllerServiceLookup,
|
||||
* returns <code>false</code>.
|
||||
*
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
*/
|
||||
boolean isControllerServiceEnabling(String serviceIdentifier);
|
||||
|
||||
/**
|
||||
* Returns <code>true</code> if the given Controller Service is enabled,
|
||||
* <code>false</code> otherwise. If the given Controller Service is not
|
||||
|
@ -63,4 +75,11 @@ public interface ControllerServiceLookup {
|
|||
*/
|
||||
Set<String> getControllerServiceIdentifiers(Class<? extends ControllerService> serviceType) throws IllegalArgumentException;
|
||||
|
||||
/**
|
||||
* Returns the name of the Controller service with the given identifier. If no service can be
|
||||
* found with this identifier, returns {@code null}.
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
*/
|
||||
String getControllerServiceName(String serviceIdentifier);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,100 @@
|
|||
/*
|
||||
* 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.logging;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* The ComponentLog provides a mechanism to ensure that all NiFi components are logging and reporting
|
||||
* information in a consistent way. When messages are logged to the ComponentLog, each message has the
|
||||
* following characteristics:
|
||||
* </p>
|
||||
*
|
||||
* <ul>
|
||||
* <li>
|
||||
* The <code>toString()</code> of the component is automatically prepended to the message so that it is clear
|
||||
* which component is providing the information. This is important, since a single component may have many
|
||||
* different instances within the same NiFi instance.
|
||||
* </li>
|
||||
* <li>
|
||||
* If the last value in an Object[] argument that is passed to the logger is a Throwable, then the logged message
|
||||
* will include a <code>toString()</code> of the Throwable; in addition, if the component's logger is set to
|
||||
* DEBUG level via the logback configuration, the Stacktrace will also be logged. This provides a mechanism to easily
|
||||
* enable stacktraces in the logs when they are desired without filling the logs with unneeded stack traces for messages
|
||||
* that end up occurring often.
|
||||
* </li>
|
||||
* <li>
|
||||
* Any message that is logged with a Severity level that meets or exceeds the configured Bulletin Level for that component
|
||||
* will also cause a Bulletin to be generated, so that the message is visible in the UI, allowing Dataflow Managers
|
||||
* to understand that a problem exists and what the issue is.
|
||||
* </li>
|
||||
* </ul>
|
||||
*
|
||||
*/
|
||||
public interface ComponentLog {
|
||||
void warn(String msg, Throwable t);
|
||||
|
||||
void warn(String msg, Object[] os);
|
||||
|
||||
void warn(String msg, Object[] os, Throwable t);
|
||||
|
||||
void warn(String msg);
|
||||
|
||||
void trace(String msg, Throwable t);
|
||||
|
||||
void trace(String msg, Object[] os);
|
||||
|
||||
void trace(String msg);
|
||||
|
||||
void trace(String msg, Object[] os, Throwable t);
|
||||
|
||||
boolean isWarnEnabled();
|
||||
|
||||
boolean isTraceEnabled();
|
||||
|
||||
boolean isInfoEnabled();
|
||||
|
||||
boolean isErrorEnabled();
|
||||
|
||||
boolean isDebugEnabled();
|
||||
|
||||
void info(String msg, Throwable t);
|
||||
|
||||
void info(String msg, Object[] os);
|
||||
|
||||
void info(String msg);
|
||||
|
||||
void info(String msg, Object[] os, Throwable t);
|
||||
|
||||
String getName();
|
||||
|
||||
void error(String msg, Throwable t);
|
||||
|
||||
void error(String msg, Object[] os);
|
||||
|
||||
void error(String msg);
|
||||
|
||||
void error(String msg, Object[] os, Throwable t);
|
||||
|
||||
void debug(String msg, Throwable t);
|
||||
|
||||
void debug(String msg, Object[] os);
|
||||
|
||||
void debug(String msg, Object[] os, Throwable t);
|
||||
|
||||
void debug(String msg);
|
||||
}
|
|
@ -16,58 +16,15 @@
|
|||
*/
|
||||
package org.apache.nifi.logging;
|
||||
|
||||
public interface ProcessorLog {
|
||||
|
||||
void warn(String msg, Throwable t);
|
||||
|
||||
void warn(String msg, Object[] os);
|
||||
|
||||
void warn(String msg, Object[] os, Throwable t);
|
||||
|
||||
void warn(String msg);
|
||||
|
||||
void trace(String msg, Throwable t);
|
||||
|
||||
void trace(String msg, Object[] os);
|
||||
|
||||
void trace(String msg);
|
||||
|
||||
void trace(String msg, Object[] os, Throwable t);
|
||||
|
||||
boolean isWarnEnabled();
|
||||
|
||||
boolean isTraceEnabled();
|
||||
|
||||
boolean isInfoEnabled();
|
||||
|
||||
boolean isErrorEnabled();
|
||||
|
||||
boolean isDebugEnabled();
|
||||
|
||||
void info(String msg, Throwable t);
|
||||
|
||||
void info(String msg, Object[] os);
|
||||
|
||||
void info(String msg);
|
||||
|
||||
void info(String msg, Object[] os, Throwable t);
|
||||
|
||||
String getName();
|
||||
|
||||
void error(String msg, Throwable t);
|
||||
|
||||
void error(String msg, Object[] os);
|
||||
|
||||
void error(String msg);
|
||||
|
||||
void error(String msg, Object[] os, Throwable t);
|
||||
|
||||
void debug(String msg, Throwable t);
|
||||
|
||||
void debug(String msg, Object[] os);
|
||||
|
||||
void debug(String msg, Object[] os, Throwable t);
|
||||
|
||||
void debug(String msg);
|
||||
/**
|
||||
* The ProcessorLog is an extension of ComponentLog but provides no additional functionality.
|
||||
* It exists because ProcessorLog was created first,
|
||||
* but when Controller Services and Reporting Tasks began to be used more heavily loggers
|
||||
* were needed for them as well. We did not want to return a ProcessorLog to a ControllerService
|
||||
* or a ReportingTask, so all of the methods were moved to a higher interface named ComponentLog.
|
||||
* However, we kept the ProcessorLog interface around in order to maintain backward compatibility.
|
||||
*/
|
||||
public interface ProcessorLog extends ComponentLog {
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import org.apache.nifi.components.AbstractConfigurableComponent;
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.processor.ProcessorInitializationContext;
|
||||
|
||||
public abstract class AbstractReportingTask extends AbstractConfigurableComponent implements ReportingTask {
|
||||
|
@ -28,10 +29,12 @@ public abstract class AbstractReportingTask extends AbstractConfigurableComponen
|
|||
private String name;
|
||||
private long schedulingNanos;
|
||||
private ControllerServiceLookup serviceLookup;
|
||||
private ComponentLog logger;
|
||||
|
||||
@Override
|
||||
public final void initialize(final ReportingInitializationContext config) throws InitializationException {
|
||||
identifier = config.getIdentifier();
|
||||
logger = config.getLogger();
|
||||
name = config.getName();
|
||||
schedulingNanos = config.getSchedulingPeriod(TimeUnit.NANOSECONDS);
|
||||
serviceLookup = config.getControllerServiceLookup();
|
||||
|
@ -91,4 +94,11 @@ public abstract class AbstractReportingTask extends AbstractConfigurableComponen
|
|||
protected void init(final ReportingInitializationContext config) throws InitializationException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the logger that has been provided to the component by the framework in its initialize method.
|
||||
* @return
|
||||
*/
|
||||
protected ComponentLog getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.nifi.reporting;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
|
||||
/**
|
||||
|
@ -77,4 +78,13 @@ public interface ReportingInitializationContext {
|
|||
* @return
|
||||
*/
|
||||
SchedulingStrategy getSchedulingStrategy();
|
||||
|
||||
|
||||
/**
|
||||
* Returns a logger that can be used to log important events in a standard way and generate
|
||||
* bulletins when appropriate
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
ComponentLog getLogger();
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.nifi.web;
|
||||
|
||||
/**
|
||||
* An general error occurred when attempting to communicate with the cluster.
|
||||
*/
|
||||
public class ClusterRequestException extends RuntimeException {
|
||||
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Details about a given component. Contains configuration and current validation errors.
|
||||
*/
|
||||
public class ComponentDetails {
|
||||
|
||||
private final String id;
|
||||
private final String name;
|
||||
private final String type;
|
||||
private final String state;
|
||||
private final String annotationData;
|
||||
private final Map<String, String> properties;
|
||||
private final Collection<String> validationErrors;
|
||||
|
||||
private ComponentDetails(final Builder builder) {
|
||||
this.id = builder.id;
|
||||
this.name = builder.name;
|
||||
this.type = builder.type;
|
||||
this.state = builder.state;
|
||||
this.annotationData = builder.annotationData;
|
||||
this.properties = builder.properties;
|
||||
this.validationErrors = builder.validationErrors;
|
||||
}
|
||||
|
||||
/**
|
||||
* The component id.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The component name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The component type.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The component state.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* The component's annotation data.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAnnotationData() {
|
||||
return annotationData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mapping of component properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Current validation errors for the component.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<String> getValidationErrors() {
|
||||
return validationErrors;
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
private String annotationData;
|
||||
private Map<String, String> properties;
|
||||
private Collection<String> validationErrors;
|
||||
|
||||
public Builder id(final String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder name(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder type(final String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder state(final String state) {
|
||||
this.state = state;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder annotationData(final String annotationData) {
|
||||
this.annotationData = annotationData;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder properties(final Map<String, String> properties) {
|
||||
this.properties = properties;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder validateErrors(final Collection<String> validationErrors) {
|
||||
this.validationErrors = validationErrors;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ComponentDetails build() {
|
||||
return new ComponentDetails(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
/**
|
||||
* An action that represents the configuration of a component.
|
||||
*/
|
||||
public class ConfigurationAction {
|
||||
|
||||
private final String id;
|
||||
private final String name;
|
||||
private final String type;
|
||||
private final String field;
|
||||
private final String previousValue;
|
||||
private final String value;
|
||||
|
||||
private ConfigurationAction(final Builder builder) {
|
||||
this.id = builder.id;
|
||||
this.name = builder.name;
|
||||
this.type = builder.type;
|
||||
this.field = builder.field;
|
||||
this.previousValue = builder.previousValue;
|
||||
this.value = builder.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* The id of the component being modified.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the component being modified.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of the component being modified.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the field, property, etc that has been modified.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the previous value.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getPreviousValue() {
|
||||
return previousValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the new value.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String field;
|
||||
private String previousValue;
|
||||
private String value;
|
||||
|
||||
public Builder id(final String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder name(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder type(final String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder field(final String field) {
|
||||
this.field = field;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder previousValue(final String previousValue) {
|
||||
this.previousValue = previousValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder value(final String value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ConfigurationAction build() {
|
||||
return new ConfigurationAction(this);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.apache.nifi.controller.ControllerService;
|
||||
|
||||
/**
|
||||
* NiFi web context providing limited access to dataflow configuration for
|
||||
* component custom UIs.
|
||||
*/
|
||||
public interface NiFiWebConfigurationContext {
|
||||
|
||||
/**
|
||||
* Gets the ControllerService for the specified identifier. If a
|
||||
* corresponding service cannot be found, null is returned. If this NiFi is
|
||||
* clustered, the only services available will be those those
|
||||
* availability is NCM only.
|
||||
*
|
||||
* @param serviceIdentifier
|
||||
* @return
|
||||
*/
|
||||
ControllerService getControllerService(String serviceIdentifier);
|
||||
|
||||
/**
|
||||
* Provides a mechanism for custom UIs to save actions to appear in NiFi
|
||||
* configuration history. Note all fields within each Action must be
|
||||
* populated. Null values will result in a failure to insert the audit
|
||||
* record. Since the saving to these actions is separate from the actual
|
||||
* configuration change, a failure to insert here will just generate a
|
||||
* warning log message. The recording of these actions typically happens
|
||||
* after a configuration change is applied. Since those changes have already
|
||||
* been applied to the flow, we cannot revert them because of a failure to
|
||||
* insert an audit record.
|
||||
*
|
||||
* @param requestContext
|
||||
* @param actions
|
||||
* @throws IllegalArgumentException When the requestContext isn't fully populated or
|
||||
* isn't appropriate for the given request
|
||||
*/
|
||||
void saveActions(NiFiWebRequestContext requestContext, Collection<ConfigurationAction> actions);
|
||||
|
||||
/**
|
||||
* Gets the current user dn. Returns null if no user is found.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getCurrentUserDn();
|
||||
|
||||
/**
|
||||
* Gets the current user name. Returns null if no user is found.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String getCurrentUserName();
|
||||
|
||||
/**
|
||||
* Sets the annotation data for the underlying component.
|
||||
*
|
||||
* @param configurationContext
|
||||
* @param annotationData
|
||||
* @return the configuration for the underlying component
|
||||
* @throws ResourceNotFoundException if the underlying component does not exit
|
||||
* @throws InvalidRevisionException if a revision other than the current
|
||||
* revision is given
|
||||
* @throws ClusterRequestException if the annotation data was unable to be
|
||||
* set for the underlying component. This exception will only be thrown when operating
|
||||
* in a cluster.
|
||||
* @throws IllegalArgumentException When the requestContext isn't fully populated or
|
||||
* isn't appropriate for the given request
|
||||
*/
|
||||
ComponentDetails setAnnotationData(NiFiWebConfigurationRequestContext configurationContext, String annotationData) throws ResourceNotFoundException, InvalidRevisionException, ClusterRequestException;
|
||||
|
||||
/**
|
||||
* Gets the details for the underlying component (including configuration, validation errors, and annotation data).
|
||||
*
|
||||
* @param requestContext
|
||||
* @return the configuration for the underlying component
|
||||
* @throws ResourceNotFoundException if the underlying component does not exit
|
||||
* @throws ClusterRequestException if the underlying component was unable to be
|
||||
* retrieved from the cluster. This exception will only be thrown when
|
||||
* operating in a cluster.
|
||||
* @throws IllegalArgumentException When the requestContext isn't fully populated or
|
||||
* isn't appropriate for the given request
|
||||
*/
|
||||
ComponentDetails getComponentDetails(NiFiWebRequestContext requestContext) throws ResourceNotFoundException, ClusterRequestException;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
/**
|
||||
* Contextual details required to make a configuration request from a UI extension.
|
||||
*/
|
||||
public interface NiFiWebConfigurationRequestContext extends NiFiWebRequestContext {
|
||||
|
||||
/**
|
||||
* The revision to include in the request.
|
||||
*
|
||||
* @return the revision
|
||||
*/
|
||||
Revision getRevision();
|
||||
|
||||
}
|
|
@ -24,6 +24,7 @@ import org.apache.nifi.controller.ControllerService;
|
|||
* NiFi web context providing limited access to dataflow configuration for
|
||||
* processor custom UIs.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface NiFiWebContext {
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.nifi.web;
|
|||
/**
|
||||
* Context configuration for methods invoked from the NiFiWebContext.
|
||||
*/
|
||||
@Deprecated
|
||||
public interface NiFiWebContextConfig {
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
/**
|
||||
* Contextual details required to make a request from a UI extension.
|
||||
*/
|
||||
public interface NiFiWebRequestContext {
|
||||
|
||||
/**
|
||||
* Returns the type of UI extension is making the request.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
UiExtensionType getExtensionType();
|
||||
|
||||
/**
|
||||
* The request protocol scheme (http or https). When scheme is https, the
|
||||
* X509Certificate can be used for subsequent remote requests.
|
||||
*
|
||||
* @return the protocol scheme
|
||||
*/
|
||||
String getScheme();
|
||||
|
||||
/**
|
||||
* The id of the component.
|
||||
*
|
||||
* @return the ID
|
||||
*/
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* Returns the proxied entities chain. The format of the chain is as
|
||||
* follows:
|
||||
*
|
||||
* <code>
|
||||
* <CN=original-proxied-entity><CN=first-proxy><CN=second-proxy>...
|
||||
* </code>
|
||||
*
|
||||
* @return the proxied entities chain or null if no chain
|
||||
*/
|
||||
String getProxiedEntitiesChain();
|
||||
|
||||
}
|
|
@ -19,6 +19,7 @@ package org.apache.nifi.web;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class ProcessorConfigurationAction {
|
||||
|
||||
private final String processorId;
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.Map;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public class ProcessorInfo {
|
||||
|
||||
private final String id;
|
||||
|
|
|
@ -37,12 +37,12 @@ public class Revision implements Serializable {
|
|||
* the client ID
|
||||
*/
|
||||
private final String clientId;
|
||||
|
||||
|
||||
public Revision(Long revision, String clientId) {
|
||||
this.version = revision;
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
|
||||
public String getClientId() {
|
||||
return clientId;
|
||||
}
|
||||
|
@ -51,34 +51,6 @@ public class Revision implements Serializable {
|
|||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* A factory method for creating a new Revision instance whose version is
|
||||
* this instance's version plus 1.
|
||||
*
|
||||
* @return an updated revision
|
||||
*/
|
||||
public Revision increment() {
|
||||
final long incrementedVersion;
|
||||
if (version == null) {
|
||||
incrementedVersion = 0;
|
||||
} else {
|
||||
incrementedVersion = version + 1;
|
||||
}
|
||||
return new Revision(incrementedVersion, clientId);
|
||||
}
|
||||
|
||||
/**
|
||||
* A factory method for creating a new Revision instance whose version is
|
||||
* this instance's version plus 1 and whose client ID is the given client
|
||||
* ID.
|
||||
*
|
||||
* @param clientId the client ID
|
||||
* @return an updated revision
|
||||
*/
|
||||
public Revision increment(String clientId) {
|
||||
return new Revision(increment().getVersion(), clientId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
/**
|
||||
* Types of UI extensions. Since a UI extension could support multiple
|
||||
* types of custom UIs it will need to include the type so the framework
|
||||
* can appropriate understand and process the request (recording actions
|
||||
* in the audit database, replicating a request throughout the cluster to
|
||||
* the appropriate endpoints, etc).
|
||||
*/
|
||||
public enum UiExtensionType {
|
||||
ContentViewer,
|
||||
ProcessorConfiguration,
|
||||
ControllerServiceConfiguration,
|
||||
ReportingTaskConfiguration
|
||||
}
|
|
@ -187,8 +187,6 @@
|
|||
|
||||
<nifi.flow.configuration.file>./conf/flow.xml.gz</nifi.flow.configuration.file>
|
||||
<nifi.flow.configuration.archive.dir>./conf/archive/</nifi.flow.configuration.archive.dir>
|
||||
<nifi.reporting.task.configuration.file>./conf/reporting-tasks.xml</nifi.reporting.task.configuration.file>
|
||||
<nifi.controller.service.configuration.file>./conf/controller-services.xml</nifi.controller.service.configuration.file>
|
||||
<nifi.authority.provider.configuration.file>./conf/authority-providers.xml</nifi.authority.provider.configuration.file>
|
||||
<nifi.templates.directory>./conf/templates</nifi.templates.directory>
|
||||
<nifi.database.directory>./database_repository</nifi.database.directory>
|
||||
|
|
|
@ -236,7 +236,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -254,7 +254,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -271,7 +271,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
if (input == null) {
|
||||
|
@ -289,7 +289,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
if (input == null) {
|
||||
|
@ -319,7 +319,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -347,7 +347,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
final ValidationResult vr = DATA_SIZE_VALIDATOR.validate(subject, input, context);
|
||||
|
@ -372,7 +372,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
final boolean matches = pattern.matcher(input).matches();
|
||||
|
@ -457,7 +457,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
String reason = null;
|
||||
|
@ -503,7 +503,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
if (input == null) {
|
||||
|
@ -628,7 +628,7 @@ public class StandardValidators {
|
|||
@Override
|
||||
public ValidationResult validate(final String subject, final String input, final ValidationContext context) {
|
||||
if ( context.isExpressionLanguageSupported(subject) && context.isExpressionLanguagePresent(input) ) {
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").build();
|
||||
return new ValidationResult.Builder().subject(subject).input(input).explanation("Expression Language Present").valid(true).build();
|
||||
}
|
||||
|
||||
final ControllerService svc = context.getControllerServiceLookup().getControllerService(input);
|
||||
|
|
|
@ -42,8 +42,6 @@ public class NiFiProperties extends Properties {
|
|||
public static final String PROPERTIES_FILE_PATH = "nifi.properties.file.path";
|
||||
public static final String FLOW_CONFIGURATION_FILE = "nifi.flow.configuration.file";
|
||||
public static final String FLOW_CONFIGURATION_ARCHIVE_FILE = "nifi.flow.configuration.archive.file";
|
||||
public static final String TASK_CONFIGURATION_FILE = "nifi.reporting.task.configuration.file";
|
||||
public static final String SERVICE_CONFIGURATION_FILE = "nifi.controller.service.configuration.file";
|
||||
public static final String AUTHORITY_PROVIDER_CONFIGURATION_FILE = "nifi.authority.provider.configuration.file";
|
||||
public static final String REPOSITORY_DATABASE_DIRECTORY = "nifi.database.directory";
|
||||
public static final String RESTORE_DIRECTORY = "nifi.restore.directory";
|
||||
|
|
|
@ -700,7 +700,7 @@ public class EndpointConnectionPool {
|
|||
final int flowFileCount = nodeInfo.getTotalFlowFiles();
|
||||
// don't allow any node to get more than 80% of the data
|
||||
final double percentageOfFlowFiles = Math.min(0.8D, ((double) flowFileCount / (double) totalFlowFileCount));
|
||||
final double relativeWeighting = (direction == TransferDirection.RECEIVE) ? (1 - percentageOfFlowFiles) : percentageOfFlowFiles;
|
||||
final double relativeWeighting = (direction == TransferDirection.SEND) ? (1 - percentageOfFlowFiles) : percentageOfFlowFiles;
|
||||
final int entries = Math.max(1, (int) (numDestinations * relativeWeighting));
|
||||
|
||||
entryCountMap.put(nodeInfo, Math.max(1, entries));
|
||||
|
|
|
@ -39,7 +39,7 @@ public class TestEndpointConnectionStatePool {
|
|||
collection.add(new NodeInformation("ShouldGetMedium", 5, 5555, true, 4096));
|
||||
|
||||
clusterNodeInfo.setNodeInformation(collection);
|
||||
final List<PeerStatus> destinations = EndpointConnectionPool.formulateDestinationList(clusterNodeInfo, TransferDirection.SEND);
|
||||
final List<PeerStatus> destinations = EndpointConnectionPool.formulateDestinationList(clusterNodeInfo, TransferDirection.RECEIVE);
|
||||
for ( final PeerStatus peerStatus : destinations ) {
|
||||
System.out.println(peerStatus.getPeerDescription());
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class TestEndpointConnectionStatePool {
|
|||
collection.add(new NodeInformation("ShouldGetLots", 2, 2222, true, 50000));
|
||||
|
||||
clusterNodeInfo.setNodeInformation(collection);
|
||||
final List<PeerStatus> destinations = EndpointConnectionPool.formulateDestinationList(clusterNodeInfo, TransferDirection.SEND);
|
||||
final List<PeerStatus> destinations = EndpointConnectionPool.formulateDestinationList(clusterNodeInfo, TransferDirection.RECEIVE);
|
||||
for ( final PeerStatus peerStatus : destinations ) {
|
||||
System.out.println(peerStatus.getPeerDescription());
|
||||
}
|
||||
|
|
|
@ -19,13 +19,20 @@ package org.apache.nifi.util;
|
|||
import org.apache.nifi.controller.ControllerService;
|
||||
import org.apache.nifi.controller.ControllerServiceInitializationContext;
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
|
||||
public class MockControllerServiceInitializationContext extends MockControllerServiceLookup implements ControllerServiceInitializationContext, ControllerServiceLookup {
|
||||
|
||||
private final String identifier;
|
||||
private final ComponentLog logger;
|
||||
|
||||
public MockControllerServiceInitializationContext(final ControllerService controllerService, final String identifier) {
|
||||
this(controllerService, identifier, new MockProcessorLog(identifier, controllerService));
|
||||
}
|
||||
|
||||
public MockControllerServiceInitializationContext(final ControllerService controllerService, final String identifier, final ComponentLog logger) {
|
||||
this.identifier = identifier;
|
||||
this.logger = logger;
|
||||
addControllerService(controllerService, identifier);
|
||||
}
|
||||
|
||||
|
@ -33,9 +40,19 @@ public class MockControllerServiceInitializationContext extends MockControllerSe
|
|||
public String getIdentifier() {
|
||||
return identifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControllerServiceName(final String serviceIdentifier) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControllerServiceLookup getControllerServiceLookup() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComponentLog getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,11 @@ public abstract class MockControllerServiceLookup implements ControllerServiceLo
|
|||
return isControllerServiceEnabled(service.getIdentifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isControllerServiceEnabling(final String serviceIdentifier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getControllerServiceIdentifiers(final Class<? extends ControllerService> serviceType) {
|
||||
final Set<String> ids = new HashSet<>();
|
||||
|
@ -86,4 +91,10 @@ public abstract class MockControllerServiceLookup implements ControllerServiceLo
|
|||
}
|
||||
return ids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControllerServiceName(String serviceIdentifier) {
|
||||
final ControllerServiceConfiguration status = controllerServiceMap.get(serviceIdentifier);
|
||||
return status == null ? null : serviceIdentifier;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,11 @@ public class MockProcessorInitializationContext implements ProcessorInitializati
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControllerServiceName(String serviceIdentifier) {
|
||||
return context.getControllerServiceName(serviceIdentifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isControllerServiceEnabled(String serviceIdentifier) {
|
||||
return context.isControllerServiceEnabled(serviceIdentifier);
|
||||
|
@ -71,4 +76,9 @@ public class MockProcessorInitializationContext implements ProcessorInitializati
|
|||
public boolean isControllerServiceEnabled(ControllerService service) {
|
||||
return context.isControllerServiceEnabled(service);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isControllerServiceEnabling(String serviceIdentifier) {
|
||||
return context.isControllerServiceEnabling(serviceIdentifier);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,28 +17,26 @@
|
|||
package org.apache.nifi.util;
|
||||
|
||||
import org.apache.nifi.logging.ProcessorLog;
|
||||
import org.apache.nifi.processor.Processor;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class MockProcessorLog implements ProcessorLog {
|
||||
|
||||
private final Logger logger;
|
||||
private final Processor processor;
|
||||
private final Object component;
|
||||
|
||||
public MockProcessorLog(final String processorId, final Processor processor) {
|
||||
this.logger = LoggerFactory.getLogger(processor.getClass());
|
||||
this.processor = processor;
|
||||
public MockProcessorLog(final String componentId, final Object component) {
|
||||
this.logger = LoggerFactory.getLogger(component.getClass());
|
||||
this.component = component;
|
||||
}
|
||||
|
||||
private Object[] addProcessor(final Object[] originalArgs) {
|
||||
return prependToArgs(originalArgs, processor);
|
||||
return prependToArgs(originalArgs, component);
|
||||
}
|
||||
|
||||
private Object[] addProcessorAndThrowable(final Object[] os, final Throwable t) {
|
||||
final Object[] modifiedArgs = new Object[os.length + 2];
|
||||
modifiedArgs[0] = processor.toString();
|
||||
modifiedArgs[0] = component.toString();
|
||||
for (int i = 0; i < os.length; i++) {
|
||||
modifiedArgs[i + 1] = os[i];
|
||||
}
|
||||
|
@ -75,7 +73,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
*/
|
||||
@Override
|
||||
public void warn(final String msg, final Throwable t) {
|
||||
warn("{} " + msg, new Object[]{processor}, t);
|
||||
warn("{} " + msg, new Object[]{component}, t);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,7 +116,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void warn(String msg) {
|
||||
msg = "{} " + msg;
|
||||
logger.warn(msg, processor);
|
||||
logger.warn(msg, component);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +127,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void trace(String msg, Throwable t) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
logger.trace(msg, os, t);
|
||||
}
|
||||
|
||||
|
@ -152,7 +150,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void trace(String msg) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
logger.trace(msg, os);
|
||||
}
|
||||
|
||||
|
@ -224,7 +222,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void info(String msg, Throwable t) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
|
||||
logger.info(msg, os);
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -252,7 +250,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void info(String msg) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
|
||||
logger.info(msg, os);
|
||||
}
|
||||
|
@ -291,7 +289,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void error(String msg, Throwable t) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
|
||||
logger.error(msg, os, t);
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -322,7 +320,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void error(String msg) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
|
||||
logger.error(msg, os);
|
||||
}
|
||||
|
@ -352,7 +350,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void debug(String msg, Throwable t) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
|
||||
logger.debug(msg, os, t);
|
||||
}
|
||||
|
@ -394,7 +392,7 @@ public class MockProcessorLog implements ProcessorLog {
|
|||
@Override
|
||||
public void debug(String msg) {
|
||||
msg = "{} " + msg;
|
||||
final Object[] os = {processor};
|
||||
final Object[] os = {component};
|
||||
|
||||
logger.debug(msg, os);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.concurrent.TimeUnit;
|
|||
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.reporting.ReportingInitializationContext;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
|
||||
|
@ -30,10 +31,12 @@ public class MockReportingInitializationContext extends MockControllerServiceLoo
|
|||
private final String identifier;
|
||||
private final String name;
|
||||
private final Map<PropertyDescriptor, String> properties = new HashMap<>();
|
||||
private final ComponentLog logger;
|
||||
|
||||
public MockReportingInitializationContext(final String identifier, final String name) {
|
||||
public MockReportingInitializationContext(final String identifier, final String name, final ComponentLog logger) {
|
||||
this.identifier = identifier;
|
||||
this.name = name;
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -78,4 +81,9 @@ public class MockReportingInitializationContext extends MockControllerServiceLoo
|
|||
public SchedulingStrategy getSchedulingStrategy() {
|
||||
return SchedulingStrategy.TIMER_DRIVEN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComponentLog getLogger() {
|
||||
return logger;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -103,6 +103,21 @@ public class MockValidationContext implements ValidationContext, ControllerServi
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getControllerServiceName(final String serviceIdentifier) {
|
||||
final ControllerServiceConfiguration configuration = context.getConfiguration(serviceIdentifier);
|
||||
return configuration == null ? null : serviceIdentifier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValidationRequired(final ControllerService service) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isControllerServiceEnabling(String serviceIdentifier) {
|
||||
return context.isControllerServiceEnabling(serviceIdentifier);
|
||||
}
|
||||
|
||||
public boolean isExpressionLanguagePresent(final String value) {
|
||||
if ( value == null ) {
|
||||
return false;
|
||||
|
|
|
@ -59,6 +59,7 @@ import org.apache.nifi.controller.ConfigurationContext;
|
|||
import org.apache.nifi.controller.ControllerService;
|
||||
import org.apache.nifi.flowfile.FlowFile;
|
||||
import org.apache.nifi.flowfile.attributes.CoreAttributes;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.processor.ProcessSessionFactory;
|
||||
import org.apache.nifi.processor.Processor;
|
||||
import org.apache.nifi.processor.QueueSize;
|
||||
|
@ -512,13 +513,15 @@ public class StandardProcessorTestRunner implements TestRunner {
|
|||
|
||||
@Override
|
||||
public void addControllerService(final String identifier, final ControllerService service, final Map<String, String> properties) throws InitializationException {
|
||||
// hold off on failing due to deprecated annotation for now... will introduce later.
|
||||
// for ( final Method method : service.getClass().getMethods() ) {
|
||||
// if ( method.isAnnotationPresent(org.apache.nifi.controller.annotation.OnConfigured.class) ) {
|
||||
// Assert.fail("Controller Service " + service + " is using deprecated Annotation " + org.apache.nifi.controller.annotation.OnConfigured.class + " for method " + method);
|
||||
// }
|
||||
// }
|
||||
|
||||
final MockControllerServiceInitializationContext initContext = new MockControllerServiceInitializationContext(requireNonNull(service), requireNonNull(identifier));
|
||||
final ComponentLog logger = new MockProcessorLog(identifier, service);
|
||||
final MockControllerServiceInitializationContext initContext = new MockControllerServiceInitializationContext(requireNonNull(service), requireNonNull(identifier), logger);
|
||||
service.initialize(initContext);
|
||||
|
||||
final Map<PropertyDescriptor, String> resolvedProps = new HashMap<>();
|
||||
|
|
|
@ -48,12 +48,12 @@ public interface ActionDAO {
|
|||
|
||||
/**
|
||||
* Finds the previous values for the specified property in the specified
|
||||
* processor. Returns empty list if there are none.
|
||||
* component. Returns empty list if there are none.
|
||||
*
|
||||
* @param processorId
|
||||
* @param componentId
|
||||
* @return
|
||||
*/
|
||||
Map<String, List<PreviousValue>> getPreviousValues(String processorId);
|
||||
Map<String, List<PreviousValue>> getPreviousValues(String componentId);
|
||||
|
||||
/**
|
||||
* Finds the specified action.
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.apache.nifi.action.Action;
|
|||
import org.apache.nifi.action.Component;
|
||||
import org.apache.nifi.action.Operation;
|
||||
import org.apache.nifi.action.component.details.ComponentDetails;
|
||||
import org.apache.nifi.action.component.details.ProcessorDetails;
|
||||
import org.apache.nifi.action.component.details.ExtensionDetails;
|
||||
import org.apache.nifi.action.component.details.RemoteProcessGroupDetails;
|
||||
import org.apache.nifi.action.details.ActionDetails;
|
||||
import org.apache.nifi.action.details.ConfigureDetails;
|
||||
|
@ -70,7 +70,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
// -----------------
|
||||
// component details
|
||||
// -----------------
|
||||
private static final String INSERT_PROCESSOR_DETAILS = "INSERT INTO PROCESSOR_DETAILS ("
|
||||
private static final String INSERT_EXTENSION_DETAILS = "INSERT INTO PROCESSOR_DETAILS ("
|
||||
+ "ACTION_ID, TYPE"
|
||||
+ ") VALUES ("
|
||||
+ "?, "
|
||||
|
@ -145,7 +145,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
// -----------------
|
||||
// component details
|
||||
// -----------------
|
||||
private static final String SELECT_PROCESSOR_DETAILS_FOR_ACTION = "SELECT * FROM PROCESSOR_DETAILS WHERE ACTION_ID = ?";
|
||||
private static final String SELECT_EXTENSION_DETAILS_FOR_ACTION = "SELECT * FROM PROCESSOR_DETAILS WHERE ACTION_ID = ?";
|
||||
|
||||
private static final String SELECT_REMOTE_PROCESS_GROUP_DETAILS_FOR_ACTION = "SELECT * FROM REMOTE_PROCESS_GROUP_DETAILS WHERE ACTION_ID = ?";
|
||||
|
||||
|
@ -179,8 +179,8 @@ public class StandardActionDAO implements ActionDAO {
|
|||
+ "ORDER BY A.ACTION_TIMESTAMP DESC "
|
||||
+ "LIMIT 4";
|
||||
|
||||
private Connection connection;
|
||||
private Map<String, String> columnMap;
|
||||
private final Connection connection;
|
||||
private final Map<String, String> columnMap;
|
||||
|
||||
public StandardActionDAO(Connection connection) {
|
||||
this.connection = connection;
|
||||
|
@ -233,8 +233,8 @@ public class StandardActionDAO implements ActionDAO {
|
|||
|
||||
// determine the type of component
|
||||
ComponentDetails componentDetails = action.getComponentDetails();
|
||||
if (componentDetails instanceof ProcessorDetails) {
|
||||
createProcessorDetails(action.getId(), (ProcessorDetails) componentDetails);
|
||||
if (componentDetails instanceof ExtensionDetails) {
|
||||
createExtensionDetails(action.getId(), (ExtensionDetails) componentDetails);
|
||||
} else if (componentDetails instanceof RemoteProcessGroupDetails) {
|
||||
createRemoteProcessGroupDetails(action.getId(), (RemoteProcessGroupDetails) componentDetails);
|
||||
}
|
||||
|
@ -260,26 +260,26 @@ public class StandardActionDAO implements ActionDAO {
|
|||
}
|
||||
|
||||
/**
|
||||
* Persists the processor details.
|
||||
* Persists the extension details.
|
||||
*
|
||||
* @param actionId
|
||||
* @param processorDetails
|
||||
* @param extensionDetails
|
||||
* @throws DataAccessException
|
||||
*/
|
||||
private void createProcessorDetails(int actionId, ProcessorDetails processorDetails) throws DataAccessException {
|
||||
private void createExtensionDetails(int actionId, ExtensionDetails extensionDetails) throws DataAccessException {
|
||||
PreparedStatement statement = null;
|
||||
try {
|
||||
// obtain a statement to insert to the processor action table
|
||||
statement = connection.prepareStatement(INSERT_PROCESSOR_DETAILS);
|
||||
// obtain a statement to insert to the extension action table
|
||||
statement = connection.prepareStatement(INSERT_EXTENSION_DETAILS);
|
||||
statement.setInt(1, actionId);
|
||||
statement.setString(2, StringUtils.left(processorDetails.getType(), 1000));
|
||||
statement.setString(2, StringUtils.left(extensionDetails.getType(), 1000));
|
||||
|
||||
// insert the action
|
||||
int updateCount = statement.executeUpdate();
|
||||
|
||||
// ensure the operation completed successfully
|
||||
if (updateCount != 1) {
|
||||
throw new DataAccessException("Unable to insert processor details.");
|
||||
throw new DataAccessException("Unable to insert extension details.");
|
||||
}
|
||||
} catch (SQLException sqle) {
|
||||
throw new DataAccessException(sqle);
|
||||
|
@ -601,8 +601,8 @@ public class StandardActionDAO implements ActionDAO {
|
|||
|
||||
// get the component details if appropriate
|
||||
ComponentDetails componentDetails = null;
|
||||
if (Component.Processor.equals(component)) {
|
||||
componentDetails = getProcessorDetails(actionId);
|
||||
if (Component.Processor.equals(component) || Component.ControllerService.equals(component) || Component.ReportingTask.equals(component)) {
|
||||
componentDetails = getExtensionDetails(actionId);
|
||||
} else if (Component.RemoteProcessGroup.equals(component)) {
|
||||
componentDetails = getRemoteProcessGroupDetails(actionId);
|
||||
}
|
||||
|
@ -675,8 +675,8 @@ public class StandardActionDAO implements ActionDAO {
|
|||
|
||||
// get the component details if appropriate
|
||||
ComponentDetails componentDetails = null;
|
||||
if (Component.Processor.equals(component)) {
|
||||
componentDetails = getProcessorDetails(actionId);
|
||||
if (Component.Processor.equals(component) || Component.ControllerService.equals(component) || Component.ReportingTask.equals(component)) {
|
||||
componentDetails = getExtensionDetails(actionId);
|
||||
} else if (Component.RemoteProcessGroup.equals(component)) {
|
||||
componentDetails = getRemoteProcessGroupDetails(actionId);
|
||||
}
|
||||
|
@ -713,19 +713,19 @@ public class StandardActionDAO implements ActionDAO {
|
|||
}
|
||||
|
||||
/**
|
||||
* Loads the specified processor details.
|
||||
* Loads the specified extension details.
|
||||
*
|
||||
* @param actionId
|
||||
* @return
|
||||
* @throws DataAccessException
|
||||
*/
|
||||
private ProcessorDetails getProcessorDetails(Integer actionId) throws DataAccessException {
|
||||
ProcessorDetails processorDetails = null;
|
||||
private ExtensionDetails getExtensionDetails(Integer actionId) throws DataAccessException {
|
||||
ExtensionDetails extensionDetails = null;
|
||||
PreparedStatement statement = null;
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
// create the statement
|
||||
statement = connection.prepareStatement(SELECT_PROCESSOR_DETAILS_FOR_ACTION);
|
||||
statement = connection.prepareStatement(SELECT_EXTENSION_DETAILS_FOR_ACTION);
|
||||
statement.setInt(1, actionId);
|
||||
|
||||
// execute the query
|
||||
|
@ -733,8 +733,8 @@ public class StandardActionDAO implements ActionDAO {
|
|||
|
||||
// ensure results
|
||||
if (rs.next()) {
|
||||
processorDetails = new ProcessorDetails();
|
||||
processorDetails.setType(rs.getString("TYPE"));
|
||||
extensionDetails = new ExtensionDetails();
|
||||
extensionDetails.setType(rs.getString("TYPE"));
|
||||
}
|
||||
} catch (SQLException sqle) {
|
||||
throw new DataAccessException(sqle);
|
||||
|
@ -743,7 +743,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
RepositoryUtils.closeQuietly(statement);
|
||||
}
|
||||
|
||||
return processorDetails;
|
||||
return extensionDetails;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -931,7 +931,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<PreviousValue>> getPreviousValues(String processorId) {
|
||||
public Map<String, List<PreviousValue>> getPreviousValues(String componentId) {
|
||||
Map<String, List<PreviousValue>> previousValues = new LinkedHashMap<>();
|
||||
|
||||
PreparedStatement statement = null;
|
||||
|
@ -939,7 +939,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
try {
|
||||
// create the statement
|
||||
statement = connection.prepareStatement(SELECT_PREVIOUSLY_CONFIGURED_FIELDS);
|
||||
statement.setString(1, processorId);
|
||||
statement.setString(1, componentId);
|
||||
|
||||
// execute the query
|
||||
rs = statement.executeQuery();
|
||||
|
@ -947,7 +947,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
// ensure results
|
||||
while (rs.next()) {
|
||||
final String property = rs.getString("NAME");
|
||||
previousValues.put(property, getPreviousValuesForProperty(processorId, property));
|
||||
previousValues.put(property, getPreviousValuesForProperty(componentId, property));
|
||||
}
|
||||
} catch (SQLException sqle) {
|
||||
throw new DataAccessException(sqle);
|
||||
|
@ -959,7 +959,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
return previousValues;
|
||||
}
|
||||
|
||||
private List<PreviousValue> getPreviousValuesForProperty(final String processorId, final String property) {
|
||||
private List<PreviousValue> getPreviousValuesForProperty(final String componentId, final String property) {
|
||||
List<PreviousValue> previousValues = new ArrayList<>();
|
||||
|
||||
PreparedStatement statement = null;
|
||||
|
@ -967,7 +967,7 @@ public class StandardActionDAO implements ActionDAO {
|
|||
try {
|
||||
// create the statement
|
||||
statement = connection.prepareStatement(SELECT_PREVIOUS_VALUES);
|
||||
statement.setString(1, processorId);
|
||||
statement.setString(1, componentId);
|
||||
statement.setString(2, property);
|
||||
|
||||
// execute the query
|
||||
|
|
|
@ -40,12 +40,12 @@ public interface AuditService {
|
|||
|
||||
/**
|
||||
* Finds the previous values for the specified property in the specified
|
||||
* processor. Returns null if there are none.
|
||||
* component. Returns null if there are none.
|
||||
*
|
||||
* @param processorId
|
||||
* @param componentId
|
||||
* @return
|
||||
*/
|
||||
Map<String, List<PreviousValue>> getPreviousValues(String processorId);
|
||||
Map<String, List<PreviousValue>> getPreviousValues(String componentId);
|
||||
|
||||
/**
|
||||
* Get the actions within the given date range.
|
||||
|
|
|
@ -28,16 +28,16 @@ import org.apache.nifi.history.PreviousValue;
|
|||
*/
|
||||
public class GetPreviousValues implements AdministrationAction<Map<String, List<PreviousValue>>> {
|
||||
|
||||
private final String processorId;
|
||||
private final String componentId;
|
||||
|
||||
public GetPreviousValues(String processorId) {
|
||||
this.processorId = processorId;
|
||||
public GetPreviousValues(String componentId) {
|
||||
this.componentId = componentId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<PreviousValue>> execute(DAOFactory daoFactory, AuthorityProvider authorityProvider) {
|
||||
ActionDAO actionDao = daoFactory.getActionDAO();
|
||||
return actionDao.getPreviousValues(processorId);
|
||||
return actionDao.getPreviousValues(componentId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class StandardAuditService implements AuditService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<PreviousValue>> getPreviousValues(String processorId) {
|
||||
public Map<String, List<PreviousValue>> getPreviousValues(String componentId) {
|
||||
Transaction transaction = null;
|
||||
Map<String, List<PreviousValue>> previousValues = null;
|
||||
|
||||
|
@ -91,7 +91,7 @@ public class StandardAuditService implements AuditService {
|
|||
transaction = transactionBuilder.start();
|
||||
|
||||
// seed the accounts
|
||||
GetPreviousValues getActions = new GetPreviousValues(processorId);
|
||||
GetPreviousValues getActions = new GetPreviousValues(componentId);
|
||||
previousValues = transaction.execute(getActions);
|
||||
|
||||
// commit the transaction
|
||||
|
|
|
@ -20,29 +20,29 @@ import java.util.Map;
|
|||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* History of a processor's properties.
|
||||
* History of a component's properties.
|
||||
*/
|
||||
@XmlType(name = "processorHistory")
|
||||
public class ProcessorHistoryDTO {
|
||||
@XmlType(name = "componentHistory")
|
||||
public class ComponentHistoryDTO {
|
||||
|
||||
private String processorId;
|
||||
private String componentId;
|
||||
private Map<String, PropertyHistoryDTO> propertyHistory;
|
||||
|
||||
/**
|
||||
* The processor id.
|
||||
* The component id.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getProcessorId() {
|
||||
return processorId;
|
||||
public String getComponentId() {
|
||||
return componentId;
|
||||
}
|
||||
|
||||
public void setProcessorId(String processorId) {
|
||||
this.processorId = processorId;
|
||||
public void setComponentId(String componentId) {
|
||||
this.componentId = componentId;
|
||||
}
|
||||
|
||||
/**
|
||||
* The history for this processors properties.
|
||||
* The history for this components properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
|
@ -16,7 +16,10 @@
|
|||
*/
|
||||
package org.apache.nifi.web.api.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
|
||||
import org.apache.nifi.web.api.dto.util.TimeAdapter;
|
||||
|
||||
/**
|
||||
* Details for the controller configuration.
|
||||
|
@ -32,6 +35,7 @@ public class ControllerConfigurationDTO {
|
|||
private Long autoRefreshIntervalSeconds;
|
||||
private Boolean siteToSiteSecure;
|
||||
|
||||
private Date currentTime;
|
||||
private Integer timeOffset;
|
||||
|
||||
private String contentViewerUrl;
|
||||
|
@ -117,6 +121,20 @@ public class ControllerConfigurationDTO {
|
|||
this.siteToSiteSecure = siteToSiteSecure;
|
||||
}
|
||||
|
||||
/**
|
||||
* The current time on the server.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@XmlJavaTypeAdapter(TimeAdapter.class)
|
||||
public Date getCurrentTime() {
|
||||
return currentTime;
|
||||
}
|
||||
|
||||
public void setCurrentTime(Date currentTime) {
|
||||
this.currentTime = currentTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* The time offset of the server.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* 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.web.api.dto;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* A Controller Service that can be shared by other components
|
||||
*/
|
||||
@XmlType(name = "controllerService")
|
||||
public class ControllerServiceDTO extends NiFiComponentDTO {
|
||||
|
||||
private String name;
|
||||
private String type;
|
||||
private String comments;
|
||||
private String availability;
|
||||
private String state;
|
||||
|
||||
private Map<String, String> properties;
|
||||
private Map<String, PropertyDescriptorDTO> descriptors;
|
||||
|
||||
private String customUiUrl;
|
||||
private String annotationData;
|
||||
|
||||
private Set<ControllerServiceReferencingComponentDTO> referencingComponents;
|
||||
|
||||
private Collection<String> validationErrors;
|
||||
|
||||
/**
|
||||
* The controller service name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The controller service type.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* The comment for the Controller Service
|
||||
* @return
|
||||
*/
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where this service is available. Possible values are NCM, NODE.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAvailability() {
|
||||
return availability;
|
||||
}
|
||||
|
||||
public void setAvailability(String availability) {
|
||||
this.availability = availability;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of this controller service. Possible values are ENABLED, ENABLING, DISABLED, DISABLING.
|
||||
* @return
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* The controller service properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(Map<String, String> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* The descriptors for the controller service properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, PropertyDescriptorDTO> getDescriptors() {
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
public void setDescriptors(Map<String, PropertyDescriptorDTO> descriptors) {
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL for this controller services custom configuration UI
|
||||
* if applicable. Null otherwise.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCustomUiUrl() {
|
||||
return customUiUrl;
|
||||
}
|
||||
|
||||
public void setCustomUiUrl(String customUiUrl) {
|
||||
this.customUiUrl = customUiUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* The annotation data for this controller service.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAnnotationData() {
|
||||
return annotationData;
|
||||
}
|
||||
|
||||
public void setAnnotationData(String annotationData) {
|
||||
this.annotationData = annotationData;
|
||||
}
|
||||
|
||||
/**
|
||||
* All components referencing this controller service.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<ControllerServiceReferencingComponentDTO> getReferencingComponents() {
|
||||
return referencingComponents;
|
||||
}
|
||||
|
||||
public void setReferencingComponents(Set<ControllerServiceReferencingComponentDTO> referencingComponents) {
|
||||
this.referencingComponents = referencingComponents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the validation errors from this controller service. These validation errors
|
||||
* represent the problems with the controller service that must be resolved before it
|
||||
* can be enabled.
|
||||
*
|
||||
* @return The validation errors
|
||||
*/
|
||||
public Collection<String> getValidationErrors() {
|
||||
return validationErrors;
|
||||
}
|
||||
|
||||
public void setValidationErrors(Collection<String> validationErrors) {
|
||||
this.validationErrors = validationErrors;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
* 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.web.api.dto;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* A component referencing a controller service. This can either be another
|
||||
* controller service or a processor. Depending on the type of component
|
||||
* different properties may be set.
|
||||
*/
|
||||
@XmlType(name = "controllerServiceReferencingComponent")
|
||||
public class ControllerServiceReferencingComponentDTO {
|
||||
private String groupId;
|
||||
private String id;
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
|
||||
private Map<String, String> properties;
|
||||
private Map<String, PropertyDescriptorDTO> descriptors;
|
||||
|
||||
private Collection<String> validationErrors;
|
||||
|
||||
private String referenceType;
|
||||
private Integer activeThreadCount;
|
||||
|
||||
private Boolean referenceCycle;
|
||||
private Set<ControllerServiceReferencingComponentDTO> referencingComponents;
|
||||
|
||||
/**
|
||||
* Group id for this component referencing a controller service. If this
|
||||
* component is another service, this field is blank.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
/**
|
||||
* The id for this component referencing a controller service.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* The name for this component referencing a controller service.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type for this component referencing a controller service.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The state of the processor referencing a controller service. If this
|
||||
* component is another service, this field is blank.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of reference this is (Processor, ControllerService, or ReportingTask).
|
||||
* @return
|
||||
*/
|
||||
public String getReferenceType() {
|
||||
return referenceType;
|
||||
}
|
||||
|
||||
public void setReferenceType(String referenceType) {
|
||||
this.referenceType = referenceType;
|
||||
}
|
||||
|
||||
/**
|
||||
* The component properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(Map<String, String> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* The descriptors for the components properties.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, PropertyDescriptorDTO> getDescriptors() {
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
public void setDescriptors(Map<String, PropertyDescriptorDTO> descriptors) {
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Any validation error associated with this component.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<String> getValidationErrors() {
|
||||
return validationErrors;
|
||||
}
|
||||
|
||||
public void setValidationErrors(Collection<String> validationErrors) {
|
||||
this.validationErrors = validationErrors;
|
||||
}
|
||||
|
||||
/**
|
||||
* The active thread count for the referencing component.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getActiveThreadCount() {
|
||||
return activeThreadCount;
|
||||
}
|
||||
|
||||
public void setActiveThreadCount(Integer activeThreadCount) {
|
||||
this.activeThreadCount = activeThreadCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this referencing component represents a ControllerService, these
|
||||
* are the components that reference it.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<ControllerServiceReferencingComponentDTO> getReferencingComponents() {
|
||||
return referencingComponents;
|
||||
}
|
||||
|
||||
public void setReferencingComponents(Set<ControllerServiceReferencingComponentDTO> referencingComponents) {
|
||||
this.referencingComponents = referencingComponents;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this referencing component represents a ControllerService, this indicates
|
||||
* whether it has already been represented in this hierarchy.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Boolean getReferenceCycle() {
|
||||
return referenceCycle;
|
||||
}
|
||||
|
||||
public void setReferenceCycle(Boolean referenceCycle) {
|
||||
this.referenceCycle = referenceCycle;
|
||||
}
|
||||
|
||||
}
|
|
@ -20,13 +20,13 @@ import java.util.Set;
|
|||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* Class used for providing documentation of a specified type that may be
|
||||
* instantiated.
|
||||
* Class used for providing documentation of a specified type.
|
||||
*/
|
||||
@XmlType(name = "documentedType")
|
||||
public class DocumentedTypeDTO {
|
||||
|
||||
private String type;
|
||||
private Set<DocumentedTypeDTO> childTypes;
|
||||
private String description;
|
||||
private Set<String> tags;
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class DocumentedTypeDTO {
|
|||
}
|
||||
|
||||
/**
|
||||
* The tags associated with this type
|
||||
* The tags associated with this type.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
@ -68,4 +68,18 @@ public class DocumentedTypeDTO {
|
|||
public void setTags(final Set<String> tags) {
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Child types for this type.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<DocumentedTypeDTO> getChildTypes() {
|
||||
return childTypes;
|
||||
}
|
||||
|
||||
public void setChildTypes(Set<DocumentedTypeDTO> childTypes) {
|
||||
this.childTypes = childTypes;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,7 +34,8 @@ public class FlowSnippetDTO {
|
|||
private Set<ConnectionDTO> connections = new LinkedHashSet<>();
|
||||
private Set<LabelDTO> labels = new LinkedHashSet<>();
|
||||
private Set<FunnelDTO> funnels = new LinkedHashSet<>();
|
||||
|
||||
private Set<ControllerServiceDTO> controllerServices = new LinkedHashSet<>();
|
||||
|
||||
/**
|
||||
* The connections in this flow snippet.
|
||||
*
|
||||
|
@ -138,4 +139,16 @@ public class FlowSnippetDTO {
|
|||
public void setRemoteProcessGroups(Set<RemoteProcessGroupDTO> remoteProcessGroups) {
|
||||
this.remoteProcessGroups = remoteProcessGroups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the Controller Services in this flow snippet
|
||||
* @return
|
||||
*/
|
||||
public Set<ControllerServiceDTO> getControllerServices() {
|
||||
return controllerServices;
|
||||
}
|
||||
|
||||
public void setControllerServices(Set<ControllerServiceDTO> controllerServices) {
|
||||
this.controllerServices = controllerServices;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ public class NiFiComponentDTO {
|
|||
}
|
||||
|
||||
/**
|
||||
* The id for the parent group of this component.
|
||||
* The id for the parent group of this component if applicable, null otherwise.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
@ -85,7 +85,7 @@ public class NiFiComponentDTO {
|
|||
}
|
||||
|
||||
/**
|
||||
* The position of this component in the UI.
|
||||
* The position of this component in the UI if applicable, null otherwise.
|
||||
*
|
||||
* @return The position
|
||||
*/
|
||||
|
|
|
@ -54,10 +54,10 @@ public class ProcessorConfigDTO {
|
|||
}
|
||||
|
||||
/**
|
||||
* The amount of time that should elapse between task executions. This will
|
||||
* not affect currently scheduled tasks.
|
||||
* The frequency with which to schedule the processor. The format of the value will
|
||||
* depend on the value of {@link #getSchedulingStrategy()}.
|
||||
*
|
||||
* @return The scheduling period in seconds
|
||||
* @return The scheduling period
|
||||
*/
|
||||
public String getSchedulingPeriod() {
|
||||
return schedulingPeriod;
|
||||
|
@ -207,7 +207,8 @@ public class ProcessorConfigDTO {
|
|||
}
|
||||
|
||||
/**
|
||||
* Whether of not this processor has a custom UI.
|
||||
* Returns the URL for this processors custom configuration UI
|
||||
* if applicable. Null otherwise.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
@ -274,213 +275,4 @@ public class ProcessorConfigDTO {
|
|||
this.defaultSchedulingPeriod = defaultSchedulingPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* The allowable values for a property with a constrained set of options.
|
||||
*/
|
||||
@XmlType(name = "allowableValue")
|
||||
public static class AllowableValueDTO {
|
||||
|
||||
private String displayName;
|
||||
private String value;
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* Returns the human-readable value that is allowed for this
|
||||
* PropertyDescriptor
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value for this allowable value.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a description of this Allowable Value, or <code>null</code>
|
||||
* if no description is given
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(obj instanceof AllowableValueDTO)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final AllowableValueDTO other = (AllowableValueDTO) obj;
|
||||
return (this.value.equals(other.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 23984731 + 17 * value.hashCode();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A description of a processor property.
|
||||
*/
|
||||
@XmlType(name = "propertyDescriptor")
|
||||
public static class PropertyDescriptorDTO {
|
||||
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private Set<AllowableValueDTO> allowableValues;
|
||||
private boolean required;
|
||||
private boolean sensitive;
|
||||
private boolean dynamic;
|
||||
private boolean supportsEl;
|
||||
|
||||
/**
|
||||
* The set of allowable values for this property. If empty then the
|
||||
* allowable values are not constrained.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<AllowableValueDTO> getAllowableValues() {
|
||||
return allowableValues;
|
||||
}
|
||||
|
||||
public void setAllowableValues(Set<AllowableValueDTO> allowableValues) {
|
||||
this.allowableValues = allowableValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default value for this property.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* And explanation of the meaning of the given property. This
|
||||
* description is meant to be displayed to a user or simply provide a
|
||||
* mechanism of documenting intent.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* The property name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The human-readable name to display to users.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the property is required for this processor.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isRequired() {
|
||||
return required;
|
||||
}
|
||||
|
||||
public void setRequired(boolean required) {
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that the value for this property should be considered
|
||||
* sensitive and protected whenever stored or represented.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isSensitive() {
|
||||
return sensitive;
|
||||
}
|
||||
|
||||
public void setSensitive(boolean sensitive) {
|
||||
this.sensitive = sensitive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this property is dynamic.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDynamic() {
|
||||
return dynamic;
|
||||
}
|
||||
|
||||
public void setDynamic(boolean dynamic) {
|
||||
this.dynamic = dynamic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether or not this property support expression language.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean getSupportsEl() {
|
||||
return supportsEl;
|
||||
}
|
||||
|
||||
public void setSupportsEl(boolean supportsEl) {
|
||||
this.supportsEl = supportsEl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,243 @@
|
|||
/*
|
||||
* 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.web.api.dto;
|
||||
|
||||
import java.util.List;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* A description of a property.
|
||||
*/
|
||||
@XmlType(name = "propertyDescriptor")
|
||||
public class PropertyDescriptorDTO {
|
||||
|
||||
private String name;
|
||||
private String displayName;
|
||||
private String description;
|
||||
private String defaultValue;
|
||||
private List<AllowableValueDTO> allowableValues;
|
||||
private boolean required;
|
||||
private boolean sensitive;
|
||||
private boolean dynamic;
|
||||
private boolean supportsEl;
|
||||
private boolean identifiesControllerService;
|
||||
|
||||
/**
|
||||
* The set of allowable values for this property. If empty then the
|
||||
* allowable values are not constrained.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<AllowableValueDTO> getAllowableValues() {
|
||||
return allowableValues;
|
||||
}
|
||||
|
||||
public void setAllowableValues(List<AllowableValueDTO> allowableValues) {
|
||||
this.allowableValues = allowableValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default value for this property.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDefaultValue() {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* And explanation of the meaning of the given property. This
|
||||
* description is meant to be displayed to a user or simply provide a
|
||||
* mechanism of documenting intent.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* The property name.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The human-readable name to display to users.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the property is required for this processor.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isRequired() {
|
||||
return required;
|
||||
}
|
||||
|
||||
public void setRequired(boolean required) {
|
||||
this.required = required;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates that the value for this property should be considered
|
||||
* sensitive and protected whenever stored or represented.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isSensitive() {
|
||||
return sensitive;
|
||||
}
|
||||
|
||||
public void setSensitive(boolean sensitive) {
|
||||
this.sensitive = sensitive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether this property is dynamic.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isDynamic() {
|
||||
return dynamic;
|
||||
}
|
||||
|
||||
public void setDynamic(boolean dynamic) {
|
||||
this.dynamic = dynamic;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether or not this property support expression language.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean getSupportsEl() {
|
||||
return supportsEl;
|
||||
}
|
||||
|
||||
public void setSupportsEl(boolean supportsEl) {
|
||||
this.supportsEl = supportsEl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this descriptor represents a controller service.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean isIdentifiesControllerService() {
|
||||
return identifiesControllerService;
|
||||
}
|
||||
|
||||
public void setIdentifiesControllerService(boolean identifiesControllerService) {
|
||||
this.identifiesControllerService = identifiesControllerService;
|
||||
}
|
||||
|
||||
/**
|
||||
* The allowable values for a property with a constrained set of options.
|
||||
*/
|
||||
@XmlType(name = "allowableValue")
|
||||
public static class AllowableValueDTO {
|
||||
|
||||
private String displayName;
|
||||
private String value;
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* Returns the human-readable value that is allowed for this
|
||||
* PropertyDescriptor
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value for this allowable value.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a description of this Allowable Value, or <code>null</code>
|
||||
* if no description is given
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(obj instanceof AllowableValueDTO)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final AllowableValueDTO other = (AllowableValueDTO) obj;
|
||||
return (this.value.equals(other.getValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return 23984731 + 17 * value.hashCode();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,228 @@
|
|||
/*
|
||||
* 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.web.api.dto;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* Component that is capable of reporting internal NiFi state to an external service
|
||||
*/
|
||||
@XmlType(name = "reportingTask")
|
||||
public class ReportingTaskDTO extends NiFiComponentDTO {
|
||||
private String name;
|
||||
private String type;
|
||||
private String state;
|
||||
private String availability;
|
||||
private String comments;
|
||||
|
||||
private String schedulingPeriod;
|
||||
private String schedulingStrategy;
|
||||
private Map<String, String> defaultSchedulingPeriod;
|
||||
|
||||
private Map<String, String> properties;
|
||||
private Map<String, PropertyDescriptorDTO> descriptors;
|
||||
|
||||
private String customUiUrl;
|
||||
private String annotationData;
|
||||
|
||||
private Collection<String> validationErrors;
|
||||
private Integer activeThreadCount;
|
||||
|
||||
/**
|
||||
* The user-defined name of the reporting task
|
||||
* @return
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The user-defined comments for the reporting task
|
||||
* @return
|
||||
*/
|
||||
public String getComments() {
|
||||
return comments;
|
||||
}
|
||||
|
||||
public void setComments(String comments) {
|
||||
this.comments = comments;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of reporting task
|
||||
* @return
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* The frequency with which to schedule the reporting task. The format of the value will
|
||||
* depend on the value of {@link #getSchedulingStrategy()}.
|
||||
*
|
||||
* @return The scheduling period
|
||||
*/
|
||||
public String getSchedulingPeriod() {
|
||||
return schedulingPeriod;
|
||||
}
|
||||
|
||||
public void setSchedulingPeriod(String schedulingPeriod) {
|
||||
this.schedulingPeriod = schedulingPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* The current scheduling state of the reporting task
|
||||
* @return
|
||||
*/
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
/**
|
||||
* The scheduling strategy that determines how the {@link #getSchedulingPeriod()} value should
|
||||
* be interpreted
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getSchedulingStrategy() {
|
||||
return schedulingStrategy;
|
||||
}
|
||||
|
||||
public void setSchedulingStrategy(String schedulingStrategy) {
|
||||
this.schedulingStrategy = schedulingStrategy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Where this service is available. Possible values are CLUSTER_MANAGER_ONLY, NODE_ONLY, BOTH.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getAvailability() {
|
||||
return availability;
|
||||
}
|
||||
|
||||
public void setAvailability(String availability) {
|
||||
this.availability = availability;
|
||||
}
|
||||
|
||||
/**
|
||||
* The reporting task's properties
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getProperties() {
|
||||
return properties;
|
||||
}
|
||||
|
||||
public void setProperties(Map<String, String> properties) {
|
||||
this.properties = properties;
|
||||
}
|
||||
|
||||
/**
|
||||
* Map of property name to descriptor
|
||||
* @return
|
||||
*/
|
||||
public Map<String, PropertyDescriptorDTO> getDescriptors() {
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
public void setDescriptors(Map<String, PropertyDescriptorDTO> descriptors) {
|
||||
this.descriptors = descriptors;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the URL for this reporting task custom configuration UI
|
||||
* if applicable. Null otherwise.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getCustomUiUrl() {
|
||||
return customUiUrl;
|
||||
}
|
||||
|
||||
public void setCustomUiUrl(String customUiUrl) {
|
||||
this.customUiUrl = customUiUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* The currently configured annotation data for the reporting task
|
||||
* @return
|
||||
*/
|
||||
public String getAnnotationData() {
|
||||
return annotationData;
|
||||
}
|
||||
|
||||
public void setAnnotationData(String annotationData) {
|
||||
this.annotationData = annotationData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the validation errors from this reporting task. These validation errors
|
||||
* represent the problems with the reporting task that must be resolved before it
|
||||
* can be scheduled to run.
|
||||
*
|
||||
* @return The validation errors
|
||||
*/
|
||||
public Collection<String> getValidationErrors() {
|
||||
return validationErrors;
|
||||
}
|
||||
|
||||
public void setValidationErrors(Collection<String> validationErrors) {
|
||||
this.validationErrors = validationErrors;
|
||||
}
|
||||
|
||||
/**
|
||||
* The default scheduling period for the different scheduling strategies.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, String> getDefaultSchedulingPeriod() {
|
||||
return defaultSchedulingPeriod;
|
||||
}
|
||||
|
||||
public void setDefaultSchedulingPeriod(Map<String, String> defaultSchedulingPeriod) {
|
||||
this.defaultSchedulingPeriod = defaultSchedulingPeriod;
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of active threads for this reporting task.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Integer getActiveThreadCount() {
|
||||
return activeThreadCount;
|
||||
}
|
||||
|
||||
public void setActiveThreadCount(Integer activeThreadCount) {
|
||||
this.activeThreadCount = activeThreadCount;
|
||||
}
|
||||
|
||||
}
|
|
@ -26,8 +26,10 @@ public class RevisionDTO {
|
|||
|
||||
private String clientId;
|
||||
private Long version;
|
||||
private String lastModifier;
|
||||
|
||||
/* getters / setters */
|
||||
|
||||
/**
|
||||
* A client identifier used to make a request. By including a client
|
||||
* identifier, the API can allow multiple requests without needing the
|
||||
|
@ -60,4 +62,17 @@ public class RevisionDTO {
|
|||
this.version = version;
|
||||
}
|
||||
|
||||
/**
|
||||
* The user that last modified the flow.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public String getLastModifier() {
|
||||
return lastModifier;
|
||||
}
|
||||
|
||||
public void setLastModifier(String lastModifier) {
|
||||
this.lastModifier = lastModifier;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import javax.xml.bind.annotation.XmlType;
|
|||
*/
|
||||
@XmlType(name = "componentDetails")
|
||||
@XmlSeeAlso({
|
||||
ProcessorDetailsDTO.class,
|
||||
ExtensionDetailsDTO.class,
|
||||
RemoteProcessGroupDetailsDTO.class
|
||||
})
|
||||
public class ComponentDetailsDTO {
|
||||
|
|
|
@ -19,15 +19,15 @@ package org.apache.nifi.web.api.dto.action.component.details;
|
|||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
/**
|
||||
* Processor details for an action.
|
||||
* Extension details for an action.
|
||||
*/
|
||||
@XmlType(name = "processorDetails")
|
||||
public class ProcessorDetailsDTO extends ComponentDetailsDTO {
|
||||
@XmlType(name = "extensionDetails")
|
||||
public class ExtensionDetailsDTO extends ComponentDetailsDTO {
|
||||
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* The processors type.
|
||||
* The extension type.
|
||||
*
|
||||
* @return
|
||||
*/
|
|
@ -17,29 +17,29 @@
|
|||
package org.apache.nifi.web.api.entity;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ProcessorHistoryDTO;
|
||||
import org.apache.nifi.web.api.dto.ComponentHistoryDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a request or response to or from the API. This particular entity holds a
|
||||
* reference to a ProcessorHistoryDTO.
|
||||
* reference to a ComponentHistoryDTO.
|
||||
*/
|
||||
@XmlRootElement(name = "processorHistoryEntity")
|
||||
public class ProcessorHistoryEntity extends Entity {
|
||||
@XmlRootElement(name = "componentHistoryEntity")
|
||||
public class ComponentHistoryEntity extends Entity {
|
||||
|
||||
private ProcessorHistoryDTO propertyHistory;
|
||||
private ComponentHistoryDTO componentHistory;
|
||||
|
||||
/**
|
||||
* The ProcessorHistoryDTO that is being serialized.
|
||||
* The ComponentHistoryDTO that is being serialized.
|
||||
*
|
||||
* @return The ProcessorHistoryDTO object
|
||||
* @return The ComponentHistoryDTO object
|
||||
*/
|
||||
public ProcessorHistoryDTO getProcessorHistory() {
|
||||
return propertyHistory;
|
||||
public ComponentHistoryDTO getComponentHistory() {
|
||||
return componentHistory;
|
||||
}
|
||||
|
||||
public void setProcessorHistory(ProcessorHistoryDTO propertyHistory) {
|
||||
this.propertyHistory = propertyHistory;
|
||||
public void setComponentHistory(ComponentHistoryDTO componentHistory) {
|
||||
this.componentHistory = componentHistory;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a
|
||||
* controller service.
|
||||
*/
|
||||
@XmlRootElement(name = "controllerServiceEntity")
|
||||
public class ControllerServiceEntity extends Entity {
|
||||
|
||||
private ControllerServiceDTO controllerService;
|
||||
|
||||
/**
|
||||
* The controller service that is being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ControllerServiceDTO getControllerService() {
|
||||
return controllerService;
|
||||
}
|
||||
|
||||
public void setControllerService(ControllerServiceDTO controllerService) {
|
||||
this.controllerService = controllerService;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ControllerServiceReferencingComponentDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a list of
|
||||
* controller services referencing components.
|
||||
*/
|
||||
@XmlRootElement(name = "controllerServiceReferencingComponentsEntity")
|
||||
public class ControllerServiceReferencingComponentsEntity extends Entity {
|
||||
|
||||
private Set<ControllerServiceReferencingComponentDTO> controllerServiceReferencingComponents;
|
||||
|
||||
/**
|
||||
* The list of controller service referencing components that are being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<ControllerServiceReferencingComponentDTO> getControllerServiceReferencingComponents() {
|
||||
return controllerServiceReferencingComponents;
|
||||
}
|
||||
|
||||
public void setControllerServiceReferencingComponents(Set<ControllerServiceReferencingComponentDTO> controllerServiceReferencingComponents) {
|
||||
this.controllerServiceReferencingComponents = controllerServiceReferencingComponents;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.DocumentedTypeDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a list of
|
||||
* controller service types.
|
||||
*/
|
||||
@XmlRootElement(name = "controllerServiceTypesEntity")
|
||||
public class ControllerServiceTypesEntity extends Entity {
|
||||
|
||||
private Set<DocumentedTypeDTO> controllerServiceTypes;
|
||||
|
||||
/**
|
||||
* The list of controller service types that are being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<DocumentedTypeDTO> getControllerServiceTypes() {
|
||||
return controllerServiceTypes;
|
||||
}
|
||||
|
||||
public void setControllerServiceTypes(Set<DocumentedTypeDTO> controllerServiceTypes) {
|
||||
this.controllerServiceTypes = controllerServiceTypes;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a list of
|
||||
* controller services.
|
||||
*/
|
||||
@XmlRootElement(name = "controllerServicesEntity")
|
||||
public class ControllerServicesEntity extends Entity {
|
||||
|
||||
private Set<ControllerServiceDTO> controllerServices;
|
||||
|
||||
/**
|
||||
* The list of controller services that are being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<ControllerServiceDTO> getControllerServices() {
|
||||
return controllerServices;
|
||||
}
|
||||
|
||||
public void setControllerServices(Set<ControllerServiceDTO> controllerServices) {
|
||||
this.controllerServices = controllerServices;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ProcessorDTO;
|
||||
import org.apache.nifi.web.api.dto.PropertyDescriptorDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a request or response to or from the API. This particular entity holds a
|
||||
* reference to a PropertyDescriptorDTO.
|
||||
*/
|
||||
@XmlRootElement(name = "propertyDescriptor")
|
||||
public class PropertyDescriptorEntity extends Entity {
|
||||
|
||||
private PropertyDescriptorDTO propertyDescriptor;
|
||||
|
||||
/**
|
||||
* The PropertyDescriptorDTO that is being serialized.
|
||||
*
|
||||
* @return The PropertyDescriptorDTO object
|
||||
*/
|
||||
public PropertyDescriptorDTO getPropertyDescriptor() {
|
||||
return propertyDescriptor;
|
||||
}
|
||||
|
||||
public void setPropertyDescriptor(PropertyDescriptorDTO propertyDescriptor) {
|
||||
this.propertyDescriptor = propertyDescriptor;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ReportingTaskDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a
|
||||
* reporting task.
|
||||
*/
|
||||
@XmlRootElement(name = "reportingTaskEntity")
|
||||
public class ReportingTaskEntity extends Entity {
|
||||
|
||||
private ReportingTaskDTO reportingTask;
|
||||
|
||||
/**
|
||||
* The reporting task that is being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ReportingTaskDTO getReportingTask() {
|
||||
return reportingTask;
|
||||
}
|
||||
|
||||
public void setReportingTask(ReportingTaskDTO reportingTask) {
|
||||
this.reportingTask = reportingTask;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.DocumentedTypeDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a list of
|
||||
* reporting task types.
|
||||
*/
|
||||
@XmlRootElement(name = "reportingTaskTypesEntity")
|
||||
public class ReportingTaskTypesEntity extends Entity {
|
||||
|
||||
private Set<DocumentedTypeDTO> reportingTaskTypes;
|
||||
|
||||
/**
|
||||
* The list of reporting task types that are being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<DocumentedTypeDTO> getReportingTaskTypes() {
|
||||
return reportingTaskTypes;
|
||||
}
|
||||
|
||||
public void setReportingTaskTypes(Set<DocumentedTypeDTO> reportingTaskTypes) {
|
||||
this.reportingTaskTypes = reportingTaskTypes;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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.web.api.entity;
|
||||
|
||||
import java.util.Set;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import org.apache.nifi.web.api.dto.ReportingTaskDTO;
|
||||
|
||||
/**
|
||||
* A serialized representation of this class can be placed in the entity body of
|
||||
* a response to the API. This particular entity holds a reference to a list of
|
||||
* reporting tasks.
|
||||
*/
|
||||
@XmlRootElement(name = "reportingTasksEntity")
|
||||
public class ReportingTasksEntity extends Entity {
|
||||
|
||||
private Set<ReportingTaskDTO> reportingTasks;
|
||||
|
||||
/**
|
||||
* The list of reporting tasks that are being serialized.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Set<ReportingTaskDTO> getReportingTasks() {
|
||||
return reportingTasks;
|
||||
}
|
||||
|
||||
public void setReportingTasks(Set<ReportingTaskDTO> reportingTasks) {
|
||||
this.reportingTasks = reportingTasks;
|
||||
}
|
||||
|
||||
}
|
|
@ -18,6 +18,7 @@ package org.apache.nifi.documentation.mock;
|
|||
|
||||
import org.apache.nifi.controller.ControllerServiceInitializationContext;
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
|
||||
/**
|
||||
* A Mock ControllerServiceInitializationContext so that ControllerServices can
|
||||
|
@ -37,4 +38,9 @@ public class MockControllerServiceInitializationContext implements ControllerSer
|
|||
return new MockControllerServiceLookup();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComponentLog getLogger() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -52,4 +52,14 @@ public class MockControllerServiceLookup implements ControllerServiceLookup {
|
|||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isControllerServiceEnabling(String serviceIdentifier) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControllerServiceName(String serviceIdentifier) {
|
||||
return serviceIdentifier;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.apache.nifi.documentation.mock;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.reporting.ReportingInitializationContext;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
|
||||
|
@ -26,8 +27,6 @@ import org.apache.nifi.scheduling.SchedulingStrategy;
|
|||
* A Mock ReportingInitializationContext that can be used to initialize a
|
||||
* ReportingTask for the purposes of documentation generation.
|
||||
*
|
||||
* @author Alligator
|
||||
*
|
||||
*/
|
||||
public class MockReportingInitializationContext implements ReportingInitializationContext {
|
||||
|
||||
|
@ -60,4 +59,9 @@ public class MockReportingInitializationContext implements ReportingInitializati
|
|||
public SchedulingStrategy getSchedulingStrategy() {
|
||||
return SchedulingStrategy.TIMER_DRIVEN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ComponentLog getLogger() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,10 +32,6 @@
|
|||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-properties</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-web-optimistic-locking</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-administration</artifactId>
|
||||
|
|
|
@ -32,12 +32,7 @@ public class ClusterContextThreadLocal {
|
|||
}
|
||||
|
||||
public static ClusterContext getContext() {
|
||||
ClusterContext ctx = contextHolder.get();
|
||||
if(ctx == null) {
|
||||
ctx = createEmptyContext();
|
||||
contextHolder.set(ctx);
|
||||
}
|
||||
return ctx;
|
||||
return contextHolder.get();
|
||||
}
|
||||
|
||||
public static void setContext(final ClusterContext context) {
|
||||
|
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* 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.web;
|
||||
|
||||
import org.apache.nifi.cluster.context.ClusterContext;
|
||||
import org.apache.nifi.cluster.context.ClusterContextThreadLocal;
|
||||
|
||||
/**
|
||||
* An optimistic locking manager that provides for optimistic locking in a clustered
|
||||
* environment.
|
||||
*
|
||||
* @author unattributed
|
||||
*/
|
||||
public class ClusterAwareOptimisticLockingManager implements OptimisticLockingManager {
|
||||
|
||||
private final OptimisticLockingManager optimisticLockingManager;
|
||||
|
||||
public ClusterAwareOptimisticLockingManager(final OptimisticLockingManager optimisticLockingManager) {
|
||||
this.optimisticLockingManager = optimisticLockingManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Revision checkRevision(Revision revision) throws InvalidRevisionException {
|
||||
final Revision currentRevision = getRevision();
|
||||
if(currentRevision.equals(revision) == false) {
|
||||
throw new InvalidRevisionException(String.format("Given revision %s does not match current revision %s.", revision, currentRevision));
|
||||
} else {
|
||||
return revision.increment(revision.getClientId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCurrent(Revision revision) {
|
||||
return getRevision().equals(revision);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Revision getRevision() {
|
||||
final ClusterContext ctx = ClusterContextThreadLocal.getContext();
|
||||
if(ctx == null || ctx.getRevision() == null) {
|
||||
return optimisticLockingManager.getRevision();
|
||||
} else {
|
||||
return ctx.getRevision();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRevision(final Revision revision) {
|
||||
final ClusterContext ctx = ClusterContextThreadLocal.getContext();
|
||||
if(ctx != null) {
|
||||
ctx.setRevision(revision);
|
||||
}
|
||||
optimisticLockingManager.setRevision(revision);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Revision incrementRevision() {
|
||||
final Revision currentRevision = getRevision();
|
||||
final Revision incRevision = currentRevision.increment();
|
||||
setRevision(incRevision);
|
||||
return incRevision;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Revision incrementRevision(final String clientId) {
|
||||
final Revision currentRevision = getRevision();
|
||||
final Revision incRevision = currentRevision.increment(clientId);
|
||||
setRevision(incRevision);
|
||||
return incRevision;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastModifier() {
|
||||
return optimisticLockingManager.getLastModifier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLastModifier(final String lastModifier) {
|
||||
optimisticLockingManager.setLastModifier(lastModifier);
|
||||
}
|
||||
|
||||
}
|
|
@ -45,6 +45,10 @@
|
|||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-client-dto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-web-optimistic-locking</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.nifi</groupId>
|
||||
<artifactId>nifi-framework-core</artifactId>
|
||||
|
|
|
@ -27,14 +27,25 @@ import org.apache.nifi.cluster.protocol.StandardDataFlow;
|
|||
public class ClusterDataFlow {
|
||||
|
||||
private final StandardDataFlow dataFlow;
|
||||
|
||||
private final NodeIdentifier primaryNodeId;
|
||||
private final byte[] controllerServices;
|
||||
private final byte[] reportingTasks;
|
||||
|
||||
public ClusterDataFlow(final StandardDataFlow dataFlow, final NodeIdentifier primaryNodeId) {
|
||||
public ClusterDataFlow(final StandardDataFlow dataFlow, final NodeIdentifier primaryNodeId, final byte[] controllerServices, final byte[] reportingTasks) {
|
||||
this.dataFlow = dataFlow;
|
||||
this.primaryNodeId = primaryNodeId;
|
||||
this.controllerServices = controllerServices;
|
||||
this.reportingTasks = reportingTasks;
|
||||
}
|
||||
|
||||
public byte[] getControllerServices() {
|
||||
return controllerServices;
|
||||
}
|
||||
|
||||
public byte[] getReportingTasks() {
|
||||
return reportingTasks;
|
||||
}
|
||||
|
||||
public NodeIdentifier getPrimaryNodeId() {
|
||||
return primaryNodeId;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.nifi.cluster.flow;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.nifi.cluster.protocol.NodeIdentifier;
|
||||
|
||||
/**
|
||||
|
@ -66,6 +67,22 @@ public interface DataFlowManagementService {
|
|||
*/
|
||||
void updatePrimaryNode(NodeIdentifier nodeId) throws DaoException;
|
||||
|
||||
/**
|
||||
* Updates the dataflow with the given serialized form of the Controller Services that are to exist on the NCM.
|
||||
*
|
||||
* @param serializedControllerServices
|
||||
* @throws DaoException
|
||||
*/
|
||||
void updateControllerServices(byte[] serializedControllerServices) throws DaoException;
|
||||
|
||||
/**
|
||||
* Updates the dataflow with the given serialized form of Reporting Tasks that are to exist on the NCM.
|
||||
*
|
||||
* @param serviceNodes
|
||||
* @throws DaoException
|
||||
*/
|
||||
void updateReportingTasks(byte[] serializedReportingTasks) throws DaoException;
|
||||
|
||||
/**
|
||||
* Sets the state of the flow.
|
||||
*
|
||||
|
|
|
@ -111,6 +111,8 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
public static final String FLOW_XML_FILENAME = "flow.xml";
|
||||
public static final String TEMPLATES_FILENAME = "templates.xml";
|
||||
public static final String SNIPPETS_FILENAME = "snippets.xml";
|
||||
public static final String CONTROLLER_SERVICES_FILENAME = "controller-services.xml";
|
||||
public static final String REPORTING_TASKS_FILENAME = "reporting-tasks.xml";
|
||||
public static final String CLUSTER_INFO_FILENAME = "cluster-info.xml";
|
||||
|
||||
private static final Logger logger = new NiFiLog(LoggerFactory.getLogger(DataFlowDaoImpl.class));
|
||||
|
@ -408,13 +410,7 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
final File stateFile = new File(dir, FLOW_PACKAGE);
|
||||
stateFile.createNewFile();
|
||||
|
||||
final byte[] flowBytes = getEmptyFlowBytes();
|
||||
final byte[] templateBytes = new byte[0];
|
||||
final byte[] snippetBytes = new byte[0];
|
||||
final DataFlow dataFlow = new StandardDataFlow(flowBytes, templateBytes, snippetBytes);
|
||||
|
||||
final ClusterMetadata clusterMetadata = new ClusterMetadata();
|
||||
writeDataFlow(stateFile, dataFlow, clusterMetadata);
|
||||
writeDataFlow(stateFile, new ClusterDataFlow(null, null, new byte[0], new byte[0]), new ClusterMetadata());
|
||||
|
||||
return stateFile;
|
||||
}
|
||||
|
@ -479,7 +475,9 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
byte[] templateBytes = new byte[0];
|
||||
byte[] snippetBytes = new byte[0];
|
||||
byte[] clusterInfoBytes = new byte[0];
|
||||
|
||||
byte[] controllerServiceBytes = new byte[0];
|
||||
byte[] reportingTaskBytes = new byte[0];
|
||||
|
||||
try (final InputStream inStream = new FileInputStream(file);
|
||||
final TarArchiveInputStream tarIn = new TarArchiveInputStream(new BufferedInputStream(inStream))) {
|
||||
TarArchiveEntry tarEntry;
|
||||
|
@ -501,6 +499,14 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
clusterInfoBytes = new byte[(int) tarEntry.getSize()];
|
||||
StreamUtils.fillBuffer(tarIn, clusterInfoBytes, true);
|
||||
break;
|
||||
case CONTROLLER_SERVICES_FILENAME:
|
||||
controllerServiceBytes = new byte[(int) tarEntry.getSize()];
|
||||
StreamUtils.fillBuffer(tarIn, controllerServiceBytes, true);
|
||||
break;
|
||||
case REPORTING_TASKS_FILENAME:
|
||||
reportingTaskBytes = new byte[(int) tarEntry.getSize()];
|
||||
StreamUtils.fillBuffer(tarIn, reportingTaskBytes, true);
|
||||
break;
|
||||
default:
|
||||
throw new DaoException("Found Unexpected file in dataflow configuration: " + tarEntry.getName());
|
||||
}
|
||||
|
@ -518,7 +524,7 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
final StandardDataFlow dataFlow = new StandardDataFlow(flowBytes, templateBytes, snippetBytes);
|
||||
dataFlow.setAutoStartProcessors(autoStart);
|
||||
|
||||
return new ClusterDataFlow(dataFlow, (clusterMetadata == null) ? null : clusterMetadata.getPrimaryNodeId());
|
||||
return new ClusterDataFlow(dataFlow, (clusterMetadata == null) ? null : clusterMetadata.getPrimaryNodeId(), controllerServiceBytes, reportingTaskBytes);
|
||||
}
|
||||
|
||||
private void writeDataFlow(final File file, final ClusterDataFlow clusterDataFlow) throws IOException, JAXBException {
|
||||
|
@ -536,7 +542,7 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
clusterMetadata.setPrimaryNodeId(clusterDataFlow.getPrimaryNodeId());
|
||||
|
||||
// write to disk
|
||||
writeDataFlow(file, dataFlow, clusterMetadata);
|
||||
writeDataFlow(file, clusterDataFlow, clusterMetadata);
|
||||
}
|
||||
|
||||
private void writeTarEntry(final TarArchiveOutputStream tarOut, final String filename, final byte[] bytes) throws IOException {
|
||||
|
@ -547,14 +553,23 @@ public class DataFlowDaoImpl implements DataFlowDao {
|
|||
tarOut.closeArchiveEntry();
|
||||
}
|
||||
|
||||
private void writeDataFlow(final File file, final DataFlow dataFlow, final ClusterMetadata clusterMetadata) throws IOException, JAXBException {
|
||||
private void writeDataFlow(final File file, final ClusterDataFlow clusterDataFlow, final ClusterMetadata clusterMetadata) throws IOException, JAXBException {
|
||||
|
||||
try (final OutputStream fos = new FileOutputStream(file);
|
||||
final TarArchiveOutputStream tarOut = new TarArchiveOutputStream(new BufferedOutputStream(fos))) {
|
||||
|
||||
writeTarEntry(tarOut, FLOW_XML_FILENAME, dataFlow.getFlow());
|
||||
writeTarEntry(tarOut, TEMPLATES_FILENAME, dataFlow.getTemplates());
|
||||
writeTarEntry(tarOut, SNIPPETS_FILENAME, dataFlow.getSnippets());
|
||||
final DataFlow dataFlow = clusterDataFlow.getDataFlow();
|
||||
if ( dataFlow == null ) {
|
||||
writeTarEntry(tarOut, FLOW_XML_FILENAME, getEmptyFlowBytes());
|
||||
writeTarEntry(tarOut, TEMPLATES_FILENAME, new byte[0]);
|
||||
writeTarEntry(tarOut, SNIPPETS_FILENAME, new byte[0]);
|
||||
} else {
|
||||
writeTarEntry(tarOut, FLOW_XML_FILENAME, dataFlow.getFlow());
|
||||
writeTarEntry(tarOut, TEMPLATES_FILENAME, dataFlow.getTemplates());
|
||||
writeTarEntry(tarOut, SNIPPETS_FILENAME, dataFlow.getSnippets());
|
||||
}
|
||||
writeTarEntry(tarOut, CONTROLLER_SERVICES_FILENAME, clusterDataFlow.getControllerServices());
|
||||
writeTarEntry(tarOut, REPORTING_TASKS_FILENAME, clusterDataFlow.getReportingTasks());
|
||||
|
||||
final ByteArrayOutputStream baos = new ByteArrayOutputStream(256);
|
||||
writeClusterMetadata(clusterMetadata, baos);
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.apache.nifi.cluster.protocol.message.FlowRequestMessage;
|
|||
import org.apache.nifi.cluster.protocol.message.FlowResponseMessage;
|
||||
import org.apache.nifi.logging.NiFiLog;
|
||||
import org.apache.nifi.util.FormatUtils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
@ -154,17 +153,74 @@ public class DataFlowManagementServiceImpl implements DataFlowManagementService
|
|||
final ClusterDataFlow existingClusterDataFlow = flowDao.loadDataFlow();
|
||||
|
||||
final StandardDataFlow dataFlow;
|
||||
final byte[] controllerServiceBytes;
|
||||
final byte[] reportingTaskBytes;
|
||||
if (existingClusterDataFlow == null) {
|
||||
dataFlow = null;
|
||||
controllerServiceBytes = new byte[0];
|
||||
reportingTaskBytes = new byte[0];
|
||||
} else {
|
||||
dataFlow = existingClusterDataFlow.getDataFlow();
|
||||
controllerServiceBytes = existingClusterDataFlow.getControllerServices();
|
||||
reportingTaskBytes = existingClusterDataFlow.getReportingTasks();
|
||||
}
|
||||
|
||||
flowDao.saveDataFlow(new ClusterDataFlow(dataFlow, nodeId));
|
||||
flowDao.saveDataFlow(new ClusterDataFlow(dataFlow, nodeId, controllerServiceBytes, reportingTaskBytes));
|
||||
} finally {
|
||||
resourceLock.unlock("updatePrimaryNode");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateControllerServices(final byte[] controllerServiceBytes) throws DaoException {
|
||||
resourceLock.lock();
|
||||
try {
|
||||
final ClusterDataFlow existingClusterDataFlow = flowDao.loadDataFlow();
|
||||
|
||||
final StandardDataFlow dataFlow;
|
||||
final byte[] reportingTaskBytes;
|
||||
final NodeIdentifier nodeId;
|
||||
if (existingClusterDataFlow == null) {
|
||||
dataFlow = null;
|
||||
nodeId = null;
|
||||
reportingTaskBytes = new byte[0];
|
||||
} else {
|
||||
dataFlow = existingClusterDataFlow.getDataFlow();
|
||||
nodeId = existingClusterDataFlow.getPrimaryNodeId();
|
||||
reportingTaskBytes = existingClusterDataFlow.getReportingTasks();
|
||||
}
|
||||
|
||||
flowDao.saveDataFlow(new ClusterDataFlow(dataFlow, nodeId, controllerServiceBytes, reportingTaskBytes));
|
||||
} finally {
|
||||
resourceLock.unlock("updateControllerServices");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateReportingTasks(final byte[] reportingTaskBytes) throws DaoException {
|
||||
resourceLock.lock();
|
||||
try {
|
||||
final ClusterDataFlow existingClusterDataFlow = flowDao.loadDataFlow();
|
||||
|
||||
final StandardDataFlow dataFlow;
|
||||
final byte[] controllerServiceBytes;
|
||||
final NodeIdentifier nodeId;
|
||||
if (existingClusterDataFlow == null) {
|
||||
dataFlow = null;
|
||||
nodeId = null;
|
||||
controllerServiceBytes = null;
|
||||
} else {
|
||||
dataFlow = existingClusterDataFlow.getDataFlow();
|
||||
nodeId = existingClusterDataFlow.getPrimaryNodeId();
|
||||
controllerServiceBytes = existingClusterDataFlow.getControllerServices();
|
||||
}
|
||||
|
||||
flowDao.saveDataFlow(new ClusterDataFlow(dataFlow, nodeId, controllerServiceBytes, reportingTaskBytes));
|
||||
} finally {
|
||||
resourceLock.unlock("updateControllerServices");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PersistedFlowState getPersistedFlowState() {
|
||||
|
@ -303,9 +359,10 @@ public class DataFlowManagementServiceImpl implements DataFlowManagementService
|
|||
final ClusterDataFlow existingClusterDataFlow = flowDao.loadDataFlow();
|
||||
final ClusterDataFlow currentClusterDataFlow;
|
||||
if (existingClusterDataFlow == null) {
|
||||
currentClusterDataFlow = new ClusterDataFlow(dataFlow, null);
|
||||
currentClusterDataFlow = new ClusterDataFlow(dataFlow, null, new byte[0], new byte[0]);
|
||||
} else {
|
||||
currentClusterDataFlow = new ClusterDataFlow(dataFlow, existingClusterDataFlow.getPrimaryNodeId());
|
||||
currentClusterDataFlow = new ClusterDataFlow(dataFlow, existingClusterDataFlow.getPrimaryNodeId(),
|
||||
existingClusterDataFlow.getControllerServices(), existingClusterDataFlow.getReportingTasks());
|
||||
}
|
||||
flowDao.saveDataFlow(currentClusterDataFlow);
|
||||
flowDao.setPersistedFlowState(PersistedFlowState.CURRENT);
|
||||
|
|
|
@ -191,6 +191,20 @@ public class NodeResponse {
|
|||
return clientResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this node response has been merged returns the updated entity,
|
||||
* otherwise null. Also returns null if hasThrowable() is true. The
|
||||
* intent of this method is to support getting the response entity
|
||||
* when it was already consumed during the merge operation. In this
|
||||
* case the client response rom getClientResponse() will not support
|
||||
* a getEntity(...) or getEntityInputStream() call.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Entity getUpdatedEntity() {
|
||||
return updatedEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Response by mapping the ClientResponse values to it. Since the
|
||||
* ClientResponse's input stream can only be read once, this method should
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -16,7 +16,6 @@
|
|||
*/
|
||||
package org.apache.nifi.cluster.spring;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import org.apache.nifi.admin.service.AuditService;
|
||||
import org.apache.nifi.cluster.event.EventManager;
|
||||
import org.apache.nifi.cluster.firewall.ClusterNodeFirewall;
|
||||
|
@ -26,11 +25,11 @@ import org.apache.nifi.cluster.manager.HttpResponseMapper;
|
|||
import org.apache.nifi.cluster.manager.impl.WebClusterManager;
|
||||
import org.apache.nifi.cluster.protocol.impl.ClusterManagerProtocolSenderListener;
|
||||
import org.apache.nifi.cluster.protocol.impl.ClusterServicesBroadcaster;
|
||||
import org.apache.nifi.controller.service.ControllerServiceLoader;
|
||||
import org.apache.nifi.encrypt.StringEncryptor;
|
||||
import org.apache.nifi.io.socket.multicast.DiscoverableService;
|
||||
import org.apache.nifi.io.socket.multicast.DiscoverableServiceImpl;
|
||||
import org.apache.nifi.util.NiFiProperties;
|
||||
import org.apache.nifi.web.OptimisticLockingManager;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
|
@ -50,6 +49,8 @@ public class WebClusterManagerFactoryBean implements FactoryBean, ApplicationCon
|
|||
private NiFiProperties properties;
|
||||
|
||||
private StringEncryptor encryptor;
|
||||
|
||||
private OptimisticLockingManager optimisticLockingManager;
|
||||
|
||||
@Override
|
||||
public Object getObject() throws Exception {
|
||||
|
@ -62,13 +63,6 @@ public class WebClusterManagerFactoryBean implements FactoryBean, ApplicationCon
|
|||
*/
|
||||
return null;
|
||||
} else if (clusterManager == null) {
|
||||
|
||||
// get the service configuration path (fail early)
|
||||
final String serviceConfigurationFile = properties.getProperty(NiFiProperties.SERVICE_CONFIGURATION_FILE);
|
||||
if (serviceConfigurationFile == null) {
|
||||
throw new NullPointerException("The service configuration file has not been specified.");
|
||||
}
|
||||
|
||||
final HttpRequestReplicator requestReplicator = applicationContext.getBean("httpRequestReplicator", HttpRequestReplicator.class);
|
||||
final HttpResponseMapper responseMapper = applicationContext.getBean("httpResponseMapper", HttpResponseMapper.class);
|
||||
final DataFlowManagementService dataFlowService = applicationContext.getBean("dataFlowManagementService", DataFlowManagementService.class);
|
||||
|
@ -81,7 +75,8 @@ public class WebClusterManagerFactoryBean implements FactoryBean, ApplicationCon
|
|||
dataFlowService,
|
||||
senderListener,
|
||||
properties,
|
||||
encryptor
|
||||
encryptor,
|
||||
optimisticLockingManager
|
||||
);
|
||||
|
||||
// set the service broadcaster
|
||||
|
@ -106,10 +101,6 @@ public class WebClusterManagerFactoryBean implements FactoryBean, ApplicationCon
|
|||
|
||||
// set the audit service
|
||||
clusterManager.setAuditService(applicationContext.getBean("auditService", AuditService.class));
|
||||
|
||||
// load the controller services
|
||||
final ControllerServiceLoader serviceLoader = new ControllerServiceLoader(Paths.get(serviceConfigurationFile));
|
||||
serviceLoader.loadControllerServices(clusterManager);
|
||||
}
|
||||
return clusterManager;
|
||||
}
|
||||
|
@ -136,4 +127,8 @@ public class WebClusterManagerFactoryBean implements FactoryBean, ApplicationCon
|
|||
public void setEncryptor(final StringEncryptor encryptor) {
|
||||
this.encryptor = encryptor;
|
||||
}
|
||||
|
||||
public void setOptimisticLockingManager(OptimisticLockingManager optimisticLockingManager) {
|
||||
this.optimisticLockingManager = optimisticLockingManager;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,10 +91,14 @@
|
|||
<property name="properties" ref="nifiProperties"/>
|
||||
</bean>
|
||||
|
||||
<!-- cluster manager optimistic locking manager -->
|
||||
<bean id="clusterManagerOptimisticLockingManager" class="org.apache.nifi.web.StandardOptimisticLockingManager"/>
|
||||
|
||||
<!-- cluster manager -->
|
||||
<bean id="clusterManager" class="org.apache.nifi.cluster.spring.WebClusterManagerFactoryBean">
|
||||
<property name="properties" ref="nifiProperties"/>
|
||||
<property name="encryptor" ref="stringEncryptor"/>
|
||||
<property name="optimisticLockingManager" ref="clusterManagerOptimisticLockingManager"/>
|
||||
</bean>
|
||||
|
||||
<!-- discoverable services -->
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
/target
|
||||
/target/
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.LinkedHashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
@ -149,6 +150,16 @@ public abstract class AbstractConfiguredComponent implements ConfigurableCompone
|
|||
final PropertyDescriptor descriptor = component.getPropertyDescriptor(name);
|
||||
String value = null;
|
||||
if (!descriptor.isRequired() && (value = properties.remove(descriptor)) != null) {
|
||||
|
||||
if ( descriptor.getControllerServiceDefinition() != null ) {
|
||||
if (value != null) {
|
||||
final ControllerServiceNode oldNode = serviceProvider.getControllerServiceNode(value);
|
||||
if (oldNode != null) {
|
||||
oldNode.removeReference(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component.onPropertyModified(descriptor, value, null);
|
||||
return true;
|
||||
}
|
||||
|
@ -250,12 +261,17 @@ public abstract class AbstractConfiguredComponent implements ConfigurableCompone
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<ValidationResult> getValidationErrors() {
|
||||
return getValidationErrors(Collections.<String>emptySet());
|
||||
}
|
||||
|
||||
public Collection<ValidationResult> getValidationErrors(final Set<String> serviceIdentifiersNotToValidate) {
|
||||
final List<ValidationResult> results = new ArrayList<>();
|
||||
lock.lock();
|
||||
try {
|
||||
final ValidationContext validationContext = validationContextFactory.newValidationContext(getProperties(), getAnnotationData());
|
||||
final ValidationContext validationContext = validationContextFactory.newValidationContext(serviceIdentifiersNotToValidate, getProperties(), getAnnotationData());
|
||||
|
||||
final Collection<ValidationResult> validationResults;
|
||||
try (final NarCloseable narCloseable = NarCloseable.withNarLoader()) {
|
||||
|
|
|
@ -19,8 +19,7 @@ package org.apache.nifi.controller;
|
|||
import org.apache.nifi.connectable.Connectable;
|
||||
import org.apache.nifi.connectable.Funnel;
|
||||
import org.apache.nifi.connectable.Port;
|
||||
import org.apache.nifi.processor.annotation.OnScheduled;
|
||||
import org.apache.nifi.processor.annotation.OnUnscheduled;
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
|
||||
public interface ProcessScheduler {
|
||||
|
@ -143,4 +142,28 @@ public interface ProcessScheduler {
|
|||
* @param procNode
|
||||
*/
|
||||
void yield(ProcessorNode procNode);
|
||||
|
||||
/**
|
||||
* Stops scheduling the given Reporting Task to run
|
||||
* @param taskNode
|
||||
*/
|
||||
void unschedule(ReportingTaskNode taskNode);
|
||||
|
||||
/**
|
||||
* Begins scheduling the given Reporting Task to run
|
||||
* @param taskNode
|
||||
*/
|
||||
void schedule(ReportingTaskNode taskNode);
|
||||
|
||||
/**
|
||||
* Enables the Controller Service so that it can be used by Reporting Tasks and Processors
|
||||
* @param service
|
||||
*/
|
||||
void enableControllerService(ControllerServiceNode service);
|
||||
|
||||
/**
|
||||
* Disables the Controller Service so that it can be updated
|
||||
* @param service
|
||||
*/
|
||||
void disableControllerService(ControllerServiceNode service);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.connectable.Connectable;
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.controller.service.ControllerServiceProvider;
|
||||
import org.apache.nifi.logging.LogLevel;
|
||||
import org.apache.nifi.processor.Processor;
|
||||
|
@ -77,4 +78,19 @@ public abstract class ProcessorNode extends AbstractConfiguredComponent implemen
|
|||
|
||||
public abstract void setStyle(Map<String, String> style);
|
||||
|
||||
/**
|
||||
* Returns the number of threads (concurrent tasks) currently being used by this Processor
|
||||
* @return
|
||||
*/
|
||||
public abstract int getActiveThreadCount();
|
||||
|
||||
/**
|
||||
* Verifies that this Processor can be started if the provided set of
|
||||
* services are enabled. This is introduced because we need to verify that all components
|
||||
* can be started before starting any of them. In order to do that, we need to know that this
|
||||
* component can be started if the given services are enabled, as we will then enable the given
|
||||
* services before starting this component.
|
||||
* @param ignoredReferences
|
||||
*/
|
||||
public abstract void verifyCanStart(Set<ControllerServiceNode> ignoredReferences);
|
||||
}
|
||||
|
|
|
@ -16,18 +16,16 @@
|
|||
*/
|
||||
package org.apache.nifi.controller;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.reporting.ReportingContext;
|
||||
import org.apache.nifi.reporting.ReportingTask;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
|
||||
public interface ReportingTaskNode extends ConfiguredComponent {
|
||||
|
||||
Availability getAvailability();
|
||||
|
||||
void setAvailability(Availability availability);
|
||||
|
||||
void setSchedulingStrategy(SchedulingStrategy schedulingStrategy);
|
||||
|
||||
SchedulingStrategy getSchedulingStrategy();
|
||||
|
@ -53,6 +51,12 @@ public interface ReportingTaskNode extends ConfiguredComponent {
|
|||
ConfigurationContext getConfigurationContext();
|
||||
|
||||
boolean isRunning();
|
||||
|
||||
/**
|
||||
* Returns the number of threads (concurrent tasks) currently being used by this ReportingTask
|
||||
* @return
|
||||
*/
|
||||
int getActiveThreadCount();
|
||||
|
||||
/**
|
||||
* Indicates the {@link ScheduledState} of this <code>ReportingTask</code>. A
|
||||
|
@ -68,6 +72,20 @@ public interface ReportingTaskNode extends ConfiguredComponent {
|
|||
|
||||
void setScheduledState(ScheduledState state);
|
||||
|
||||
String getComments();
|
||||
|
||||
void setComments(String comment);
|
||||
|
||||
/**
|
||||
* Verifies that this Reporting Task can be enabled if the provided set of
|
||||
* services are enabled. This is introduced because we need to verify that all components
|
||||
* can be started before starting any of them. In order to do that, we need to know that this
|
||||
* component can be started if the given services are enabled, as we will then enable the given
|
||||
* services before starting this component.
|
||||
* @param ignoredReferences
|
||||
*/
|
||||
void verifyCanStart(Set<ControllerServiceNode> ignoredReferences);
|
||||
|
||||
void verifyCanStart();
|
||||
void verifyCanStop();
|
||||
void verifyCanDisable();
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package org.apache.nifi.controller;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
import org.apache.nifi.components.ValidationContext;
|
||||
|
@ -24,4 +25,7 @@ import org.apache.nifi.components.ValidationContext;
|
|||
public interface ValidationContextFactory {
|
||||
|
||||
ValidationContext newValidationContext(Map<PropertyDescriptor, String> properties, String annotationData);
|
||||
|
||||
ValidationContext newValidationContext(Set<String> serviceIdentifiersToNotValidate, Map<PropertyDescriptor, String> properties, String annotationData);
|
||||
|
||||
}
|
||||
|
|
|
@ -16,28 +16,28 @@
|
|||
*/
|
||||
package org.apache.nifi.controller.exception;
|
||||
|
||||
public class ControllerServiceNotFoundException extends RuntimeException {
|
||||
public class ControllerServiceInstantiationException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = -544424320587059277L;
|
||||
|
||||
/**
|
||||
* Constructs a default exception
|
||||
*/
|
||||
public ControllerServiceNotFoundException() {
|
||||
public ControllerServiceInstantiationException() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param message
|
||||
*/
|
||||
public ControllerServiceNotFoundException(String message) {
|
||||
public ControllerServiceInstantiationException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cause
|
||||
*/
|
||||
public ControllerServiceNotFoundException(Throwable cause) {
|
||||
public ControllerServiceInstantiationException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class ControllerServiceNotFoundException extends RuntimeException {
|
|||
* @param message
|
||||
* @param cause
|
||||
*/
|
||||
public ControllerServiceNotFoundException(String message, Throwable cause) {
|
||||
public ControllerServiceInstantiationException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
* 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.controller.reporting;
|
||||
|
||||
import java.util.Set;
|
||||
import org.apache.nifi.controller.ReportingTaskNode;
|
||||
|
||||
/**
|
||||
* A ReportingTaskProvider is responsible for providing management of, and access to, Reporting Tasks
|
||||
*/
|
||||
public interface ReportingTaskProvider {
|
||||
|
||||
/**
|
||||
* Creates a new instance of a reporting task
|
||||
*
|
||||
* @param type the type (fully qualified class name) of the reporting task to instantiate
|
||||
* @param id the identifier for the Reporting Task
|
||||
* @param firstTimeAdded whether or not this is the first time that the reporting task is being added
|
||||
* to the flow. I.e., this will be true only when the user adds the reporting task to the flow, not when
|
||||
* the flow is being restored after a restart of the software
|
||||
*
|
||||
* @return the ReportingTaskNode that is used to manage the reporting task
|
||||
*
|
||||
* @throws ReportingTaskInstantiationException if unable to create the Reporting Task
|
||||
*/
|
||||
ReportingTaskNode createReportingTask(String type, String id, boolean firstTimeAdded) throws ReportingTaskInstantiationException;
|
||||
|
||||
/**
|
||||
* Returns the reporting task that has the given identifier, or <code>null</code> if no reporting task
|
||||
* exists with that ID.
|
||||
*
|
||||
* @param identifier
|
||||
* @return
|
||||
*/
|
||||
ReportingTaskNode getReportingTaskNode(String identifier);
|
||||
|
||||
/**
|
||||
* Returns a Set of all Reporting Tasks that exist for this service provider.
|
||||
* @return
|
||||
*/
|
||||
Set<ReportingTaskNode> getAllReportingTasks();
|
||||
|
||||
/**
|
||||
* Removes the given reporting task from the flow
|
||||
*
|
||||
* @param reportingTask
|
||||
*
|
||||
* @throws IllegalStateException if the reporting task cannot be removed because it is not stopped, or
|
||||
* if the reporting task is not known in the flow
|
||||
*/
|
||||
void removeReportingTask(ReportingTaskNode reportingTask);
|
||||
|
||||
/**
|
||||
* Begins scheduling the reporting task to run and invokes appropriate lifecycle methods
|
||||
* @param reportingTask
|
||||
*
|
||||
* @throws IllegalStateException if the ReportingTask's state is not STOPPED, or if the Reporting Task has active
|
||||
* threads, or if the ReportingTask is not valid
|
||||
*/
|
||||
void startReportingTask(ReportingTaskNode reportingTask);
|
||||
|
||||
/**
|
||||
* Stops scheduling the reporting task to run and invokes appropriate lifecycle methods
|
||||
* @param reportingTask
|
||||
*
|
||||
* @throws IllegalStateException if the ReportingTask's state is not RUNNING
|
||||
*/
|
||||
void stopReportingTask(ReportingTaskNode reportingTask);
|
||||
|
||||
|
||||
/**
|
||||
* Enables the reporting task to be scheduled to run
|
||||
* @param reportingTask
|
||||
*
|
||||
* @throws IllegalStateException if the ReportingTask's state is not DISABLED
|
||||
*/
|
||||
void enableReportingTask(ReportingTaskNode reportingTask);
|
||||
|
||||
|
||||
/**
|
||||
* Disables the ability to schedul the reporting task to run
|
||||
*
|
||||
* @param reportingTask
|
||||
*
|
||||
* @throws IllegalStateException if the ReportingTask's state is not STOPPED, or if the Reporting Task has active
|
||||
* threads
|
||||
*/
|
||||
void disableReportingTask(ReportingTaskNode reportingTask);
|
||||
}
|
|
@ -16,7 +16,8 @@
|
|||
*/
|
||||
package org.apache.nifi.controller.service;
|
||||
|
||||
import org.apache.nifi.controller.Availability;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.nifi.controller.ConfiguredComponent;
|
||||
import org.apache.nifi.controller.ControllerService;
|
||||
|
||||
|
@ -26,22 +27,42 @@ public interface ControllerServiceNode extends ConfiguredComponent {
|
|||
|
||||
ControllerService getControllerServiceImplementation();
|
||||
|
||||
Availability getAvailability();
|
||||
|
||||
void setAvailability(Availability availability);
|
||||
|
||||
boolean isDisabled();
|
||||
|
||||
void setDisabled(boolean disabled);
|
||||
|
||||
ControllerServiceState getState();
|
||||
void setState(ControllerServiceState state);
|
||||
|
||||
ControllerServiceReference getReferences();
|
||||
|
||||
void addReference(ConfiguredComponent referringComponent);
|
||||
|
||||
void removeReference(ConfiguredComponent referringComponent);
|
||||
|
||||
void setComments(String comment);
|
||||
String getComments();
|
||||
|
||||
void verifyCanEnable();
|
||||
void verifyCanDisable();
|
||||
|
||||
/**
|
||||
* Verifies that this Controller Service can be disabled if the provided set of
|
||||
* services are also disabled. This is introduced because we can have an instance
|
||||
* where A references B, which references C, which references A and we want
|
||||
* to disable service C. In this case, the cycle needs to not cause us to fail,
|
||||
* so we want to verify that C can be disabled if A and B also are.
|
||||
*
|
||||
* @param ignoredReferences
|
||||
*/
|
||||
void verifyCanDisable(Set<ControllerServiceNode> ignoredReferences);
|
||||
|
||||
/**
|
||||
* Verifies that this Controller Service can be enabled if the provided set of
|
||||
* services are also enabled. This is introduced because we can have an instance where
|
||||
* A reference B, which references C, which references A and we want to enable
|
||||
* Service A. In this case, the cycle needs to not cause us to fail, so we want to verify
|
||||
* that A can be enabled if A and B also are.
|
||||
* @param ignoredReferences
|
||||
*/
|
||||
void verifyCanEnable(Set<ControllerServiceNode> ignoredReferences);
|
||||
|
||||
void verifyCanDelete();
|
||||
void verifyCanUpdate();
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
*/
|
||||
package org.apache.nifi.controller.service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.nifi.annotation.lifecycle.OnAdded;
|
||||
import org.apache.nifi.controller.ControllerServiceLookup;
|
||||
|
||||
|
@ -25,7 +28,7 @@ import org.apache.nifi.controller.ControllerServiceLookup;
|
|||
public interface ControllerServiceProvider extends ControllerServiceLookup {
|
||||
|
||||
/**
|
||||
* Creates a new Controller Service of the given type and assigns it the given id. If <code>firstTimeadded</code>
|
||||
* Creates a new Controller Service of the specified type and assigns it the given id. If <code>firstTimeadded</code>
|
||||
* is true, calls any methods that are annotated with {@link OnAdded}
|
||||
*
|
||||
* @param type
|
||||
|
@ -60,10 +63,88 @@ public interface ControllerServiceProvider extends ControllerServiceLookup {
|
|||
*/
|
||||
void enableControllerService(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Enables the collection of services. If a service in this collection depends on another service,
|
||||
* the service being depended on must either already be enabled or must be in the collection as well.
|
||||
* @param serviceNodes
|
||||
*/
|
||||
void enableControllerServices(Collection<ControllerServiceNode> serviceNodes);
|
||||
|
||||
/**
|
||||
* Disables the given controller service so that it cannot be used by other components. This allows
|
||||
* configuration to be updated or allows service to be removed.
|
||||
* @param serviceNode
|
||||
*/
|
||||
void disableControllerService(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Returns a Set of all Controller Services that exist for this service provider.
|
||||
* @return
|
||||
*/
|
||||
Set<ControllerServiceNode> getAllControllerServices();
|
||||
|
||||
/**
|
||||
* Verifies that all running Processors and Reporting Tasks referencing the Controller Service (or a service
|
||||
* that depends on the provided service) can be stopped.
|
||||
* @param serviceNode
|
||||
*
|
||||
* @throws IllegalStateException if any referencing component cannot be stopped
|
||||
*/
|
||||
void verifyCanStopReferencingComponents(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Recursively unschedules all schedulable components (Processors and Reporting Tasks) that reference the given
|
||||
* Controller Service. For any Controller services that reference this one, its schedulable referencing components will also
|
||||
* be unscheduled.
|
||||
* @param serviceNode
|
||||
*/
|
||||
void unscheduleReferencingComponents(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Verifies that all Controller Services referencing the provided Controller Service can be disabled.
|
||||
* @param serviceNode
|
||||
*
|
||||
* @throws IllegalStateException if any referencing service cannot be disabled
|
||||
*/
|
||||
void verifyCanDisableReferencingServices(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Disables any Controller Service that references the provided Controller Service. This action is performed recursively
|
||||
* so that if service A references B and B references C, disabling references for C will first disable A, then B.
|
||||
* @param serviceNode
|
||||
*/
|
||||
void disableReferencingServices(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Verifies that all Controller Services referencing the provided ControllerService can be enabled.
|
||||
* @param serviceNode
|
||||
*
|
||||
* @throws IllegalStateException if any referencing component cannot be enabled
|
||||
*/
|
||||
void verifyCanEnableReferencingServices(ControllerServiceNode serviceNode);
|
||||
|
||||
|
||||
/**
|
||||
* Enables all Controller Services that are referencing the given service. If Service A references Service B and Service
|
||||
* B references serviceNode, Service A and B will both be enabled.
|
||||
* @param serviceNode
|
||||
*/
|
||||
void enableReferencingServices(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Verifies that all enabled Processors referencing the ControllerService (or a service that depends on
|
||||
* the provided service) can be scheduled to run.
|
||||
* @param serviceNode
|
||||
*
|
||||
* @throws IllegalStateException if any referencing component cannot be scheduled
|
||||
*/
|
||||
void verifyCanScheduleReferencingComponents(ControllerServiceNode serviceNode);
|
||||
|
||||
/**
|
||||
* Schedules any schedulable component (Processor, ReportingTask) that is referencing the given Controller Service
|
||||
* to run. This is performed recursively, so if a Processor is referencing Service A, which is referencing serviceNode,
|
||||
* then the Processor will also be started.
|
||||
* @param serviceNode
|
||||
*/
|
||||
void scheduleReferencingComponents(ControllerServiceNode serviceNode);
|
||||
}
|
||||
|
|
|
@ -41,10 +41,11 @@ public interface ControllerServiceReference {
|
|||
Set<ConfiguredComponent> getReferencingComponents();
|
||||
|
||||
/**
|
||||
* Returns a {@link Set} of all Processors and Reporting Tasks that are
|
||||
* referencing the Controller Service and are running, in addition to all
|
||||
* Returns a {@link Set} of all Processors, Reporting Tasks, and Controller Services that are
|
||||
* referencing the Controller Service and are running (in the case of Processors and Reporting Tasks)
|
||||
* or enabled (in the case of Controller Services)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Set<ConfiguredComponent> getRunningReferences();
|
||||
Set<ConfiguredComponent> getActiveReferences();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* 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.controller.service;
|
||||
|
||||
|
||||
/**
|
||||
* Represents the valid states for a Controller Service.
|
||||
*/
|
||||
public enum ControllerServiceState {
|
||||
/**
|
||||
* Controller Service is disabled and cannot be used.
|
||||
*/
|
||||
DISABLED,
|
||||
|
||||
/**
|
||||
* Controller Service has been disabled but has not yet finished its lifecycle
|
||||
* methods.
|
||||
*/
|
||||
DISABLING,
|
||||
|
||||
/**
|
||||
* Controller Service has been enabled but has not yet finished its lifecycle methods.
|
||||
*/
|
||||
ENABLING,
|
||||
|
||||
/**
|
||||
* Controller Service has been enabled and has finished its lifecycle methods. The Controller SErvice
|
||||
* is ready to be used.
|
||||
*/
|
||||
ENABLED;
|
||||
}
|
|
@ -52,6 +52,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.apache.nifi.admin.service.UserService;
|
||||
import org.apache.nifi.annotation.lifecycle.OnAdded;
|
||||
import org.apache.nifi.annotation.lifecycle.OnRemoved;
|
||||
import org.apache.nifi.annotation.lifecycle.OnShutdown;
|
||||
import org.apache.nifi.cluster.BulletinsPayload;
|
||||
import org.apache.nifi.cluster.HeartbeatPayload;
|
||||
import org.apache.nifi.cluster.protocol.DataFlow;
|
||||
|
@ -62,6 +63,7 @@ import org.apache.nifi.cluster.protocol.NodeProtocolSender;
|
|||
import org.apache.nifi.cluster.protocol.UnknownServiceAddressException;
|
||||
import org.apache.nifi.cluster.protocol.message.HeartbeatMessage;
|
||||
import org.apache.nifi.cluster.protocol.message.NodeBulletinsMessage;
|
||||
import org.apache.nifi.components.PropertyDescriptor;
|
||||
import org.apache.nifi.connectable.Connectable;
|
||||
import org.apache.nifi.connectable.ConnectableType;
|
||||
import org.apache.nifi.connectable.Connection;
|
||||
|
@ -77,6 +79,8 @@ import org.apache.nifi.controller.exception.ProcessorLifeCycleException;
|
|||
import org.apache.nifi.controller.label.Label;
|
||||
import org.apache.nifi.controller.label.StandardLabel;
|
||||
import org.apache.nifi.controller.reporting.ReportingTaskInstantiationException;
|
||||
import org.apache.nifi.controller.reporting.ReportingTaskProvider;
|
||||
import org.apache.nifi.controller.reporting.StandardReportingInitializationContext;
|
||||
import org.apache.nifi.controller.reporting.StandardReportingTaskNode;
|
||||
import org.apache.nifi.controller.repository.ContentRepository;
|
||||
import org.apache.nifi.controller.repository.CounterRepository;
|
||||
|
@ -103,6 +107,7 @@ import org.apache.nifi.controller.scheduling.StandardProcessScheduler;
|
|||
import org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent;
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.controller.service.ControllerServiceProvider;
|
||||
import org.apache.nifi.controller.service.StandardConfigurationContext;
|
||||
import org.apache.nifi.controller.service.StandardControllerServiceProvider;
|
||||
import org.apache.nifi.controller.status.ConnectionStatus;
|
||||
import org.apache.nifi.controller.status.PortStatus;
|
||||
|
@ -129,6 +134,7 @@ import org.apache.nifi.groups.ProcessGroup;
|
|||
import org.apache.nifi.groups.RemoteProcessGroup;
|
||||
import org.apache.nifi.groups.RemoteProcessGroupPortDescriptor;
|
||||
import org.apache.nifi.groups.StandardProcessGroup;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.logging.LogLevel;
|
||||
import org.apache.nifi.logging.LogRepository;
|
||||
import org.apache.nifi.logging.LogRepositoryFactory;
|
||||
|
@ -161,6 +167,8 @@ import org.apache.nifi.remote.protocol.socket.SocketFlowFileServerProtocol;
|
|||
import org.apache.nifi.reporting.Bulletin;
|
||||
import org.apache.nifi.reporting.BulletinRepository;
|
||||
import org.apache.nifi.reporting.EventAccess;
|
||||
import org.apache.nifi.reporting.InitializationException;
|
||||
import org.apache.nifi.reporting.ReportingInitializationContext;
|
||||
import org.apache.nifi.reporting.ReportingTask;
|
||||
import org.apache.nifi.reporting.Severity;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
|
@ -170,6 +178,7 @@ import org.apache.nifi.util.NiFiProperties;
|
|||
import org.apache.nifi.util.ReflectionUtils;
|
||||
import org.apache.nifi.web.api.dto.ConnectableDTO;
|
||||
import org.apache.nifi.web.api.dto.ConnectionDTO;
|
||||
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
|
||||
import org.apache.nifi.web.api.dto.FlowSnippetDTO;
|
||||
import org.apache.nifi.web.api.dto.FunnelDTO;
|
||||
import org.apache.nifi.web.api.dto.LabelDTO;
|
||||
|
@ -189,7 +198,7 @@ import org.slf4j.LoggerFactory;
|
|||
|
||||
import com.sun.jersey.api.client.ClientHandlerException;
|
||||
|
||||
public class FlowController implements EventAccess, ControllerServiceProvider, Heartbeater, QueueProvider {
|
||||
public class FlowController implements EventAccess, ControllerServiceProvider, ReportingTaskProvider, Heartbeater, QueueProvider {
|
||||
|
||||
// default repository implementations
|
||||
public static final String DEFAULT_FLOWFILE_REPO_IMPLEMENTATION = "org.apache.nifi.controller.repository.WriteAheadFlowFileRepository";
|
||||
|
@ -374,7 +383,6 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
this.properties = properties;
|
||||
sslContext = SslContextFactory.createSslContext(properties, false);
|
||||
extensionManager = new ExtensionManager();
|
||||
controllerServiceProvider = new StandardControllerServiceProvider();
|
||||
|
||||
timerDrivenEngineRef = new AtomicReference<>(new FlowEngine(maxTimerDrivenThreads.get(), "Timer-Driven Process"));
|
||||
eventDrivenEngineRef = new AtomicReference<>(new FlowEngine(maxEventDrivenThreads.get(), "Event-Driven Process"));
|
||||
|
@ -398,6 +406,7 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
|
||||
processScheduler = new StandardProcessScheduler(this, this, encryptor);
|
||||
eventDrivenWorkerQueue = new EventDrivenWorkerQueue(false, false, processScheduler);
|
||||
controllerServiceProvider = new StandardControllerServiceProvider(processScheduler, bulletinRepository);
|
||||
|
||||
final ProcessContextFactory contextFactory = new ProcessContextFactory(contentRepository, flowFileRepository, flowFileEventRepository, counterRepositoryRef.get(), provenanceEventRepository);
|
||||
processScheduler.setSchedulingAgent(SchedulingStrategy.EVENT_DRIVEN, new EventDrivenSchedulingAgent(
|
||||
|
@ -593,7 +602,10 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
startConnectable(connectable);
|
||||
}
|
||||
} catch (final Throwable t) {
|
||||
LOG.error("Unable to start {} due to {}", new Object[]{connectable, t});
|
||||
LOG.error("Unable to start {} due to {}", new Object[]{connectable, t.toString()});
|
||||
if ( LOG.isDebugEnabled() ) {
|
||||
LOG.error("", t);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1063,7 +1075,23 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
|
||||
// Trigger any processors' methods marked with @OnShutdown to be called
|
||||
rootGroup.shutdown();
|
||||
|
||||
|
||||
// invoke any methods annotated with @OnShutdown on Controller Services
|
||||
for ( final ControllerServiceNode serviceNode : getAllControllerServices() ) {
|
||||
try (final NarCloseable narCloseable = NarCloseable.withNarLoader()) {
|
||||
final ConfigurationContext configContext = new StandardConfigurationContext(serviceNode, controllerServiceProvider);
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnShutdown.class, serviceNode.getControllerServiceImplementation(), configContext);
|
||||
}
|
||||
}
|
||||
|
||||
// invoke any methods annotated with @OnShutdown on Reporting Tasks
|
||||
for ( final ReportingTaskNode taskNode : getAllReportingTasks() ) {
|
||||
final ConfigurationContext configContext = taskNode.getConfigurationContext();
|
||||
try (final NarCloseable narCloseable = NarCloseable.withNarLoader()) {
|
||||
ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnShutdown.class, taskNode.getReportingTask(), configContext);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
this.timerDrivenEngineRef.get().awaitTermination(gracefulShutdownSeconds / 2, TimeUnit.SECONDS);
|
||||
this.eventDrivenEngineRef.get().awaitTermination(gracefulShutdownSeconds / 2, TimeUnit.SECONDS);
|
||||
|
@ -1401,6 +1429,30 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
try {
|
||||
validateSnippetContents(requireNonNull(group), dto);
|
||||
|
||||
//
|
||||
// Instantiate Controller Services
|
||||
//
|
||||
for ( final ControllerServiceDTO controllerServiceDTO : dto.getControllerServices() ) {
|
||||
final ControllerServiceNode serviceNode = createControllerService(controllerServiceDTO.getType(), controllerServiceDTO.getId(), true);
|
||||
|
||||
serviceNode.setAnnotationData(controllerServiceDTO.getAnnotationData());
|
||||
serviceNode.setComments(controllerServiceDTO.getComments());
|
||||
serviceNode.setName(controllerServiceDTO.getName());
|
||||
}
|
||||
|
||||
// configure controller services. We do this after creating all of them in case 1 service
|
||||
// references another service.
|
||||
for ( final ControllerServiceDTO controllerServiceDTO : dto.getControllerServices() ) {
|
||||
final String serviceId = controllerServiceDTO.getId();
|
||||
final ControllerServiceNode serviceNode = getControllerServiceNode(serviceId);
|
||||
|
||||
for ( final Map.Entry<String, String> entry : controllerServiceDTO.getProperties().entrySet() ) {
|
||||
if ( entry.getValue() != null ) {
|
||||
serviceNode.setProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Instantiate the labels
|
||||
//
|
||||
|
@ -1411,7 +1463,7 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
label.setSize(new Size(labelDTO.getWidth(), labelDTO.getHeight()));
|
||||
}
|
||||
|
||||
// TODO: Update the label's "style"
|
||||
label.setStyle(labelDTO.getStyle());
|
||||
group.addLabel(label);
|
||||
}
|
||||
|
||||
|
@ -1737,14 +1789,18 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
}
|
||||
|
||||
// validate that all Processor Types and Prioritizer Types are valid
|
||||
final List<String> processorClasses = new ArrayList<>();
|
||||
final Set<String> processorClasses = new HashSet<>();
|
||||
for (final Class<?> c : ExtensionManager.getExtensions(Processor.class)) {
|
||||
processorClasses.add(c.getName());
|
||||
}
|
||||
final List<String> prioritizerClasses = new ArrayList<>();
|
||||
final Set<String> prioritizerClasses = new HashSet<>();
|
||||
for (final Class<?> c : ExtensionManager.getExtensions(FlowFilePrioritizer.class)) {
|
||||
prioritizerClasses.add(c.getName());
|
||||
}
|
||||
final Set<String> controllerServiceClasses = new HashSet<>();
|
||||
for (final Class<?> c : ExtensionManager.getExtensions(ControllerService.class)) {
|
||||
controllerServiceClasses.add(c.getName());
|
||||
}
|
||||
|
||||
final Set<ProcessorDTO> allProcs = new HashSet<>();
|
||||
final Set<ConnectionDTO> allConns = new HashSet<>();
|
||||
|
@ -1760,6 +1816,15 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
throw new IllegalStateException("Invalid Processor Type: " + proc.getType());
|
||||
}
|
||||
}
|
||||
|
||||
final Set<ControllerServiceDTO> controllerServices = templateContents.getControllerServices();
|
||||
if (controllerServices != null) {
|
||||
for (final ControllerServiceDTO service : controllerServices) {
|
||||
if (!controllerServiceClasses.contains(service.getType())) {
|
||||
throw new IllegalStateException("Invalid Controller Service Type: " + service.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (final ConnectionDTO conn : allConns) {
|
||||
final List<String> prioritizers = conn.getPrioritizers();
|
||||
|
@ -2480,17 +2545,20 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
lookupGroup(groupId).stopProcessing();
|
||||
}
|
||||
|
||||
public ReportingTaskNode createReportingTask(final String type, String id) throws ReportingTaskInstantiationException {
|
||||
return createReportingTask(type, id, true);
|
||||
public ReportingTaskNode createReportingTask(final String type) throws ReportingTaskInstantiationException {
|
||||
return createReportingTask(type, true);
|
||||
}
|
||||
|
||||
public ReportingTaskNode createReportingTask(final String type, String id, final boolean firstTimeAdded) throws ReportingTaskInstantiationException {
|
||||
if (type == null) {
|
||||
public ReportingTaskNode createReportingTask(final String type, final boolean firstTimeAdded) throws ReportingTaskInstantiationException {
|
||||
return createReportingTask(type, UUID.randomUUID().toString(), firstTimeAdded);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReportingTaskNode createReportingTask(final String type, final String id, final boolean firstTimeAdded) throws ReportingTaskInstantiationException {
|
||||
if (type == null || id == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
id = requireNonNull(id).intern();
|
||||
|
||||
|
||||
ReportingTask task = null;
|
||||
final ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
|
||||
try {
|
||||
|
@ -2516,8 +2584,19 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
|
||||
final ValidationContextFactory validationContextFactory = new StandardValidationContextFactory(controllerServiceProvider);
|
||||
final ReportingTaskNode taskNode = new StandardReportingTaskNode(task, id, this, processScheduler, validationContextFactory);
|
||||
taskNode.setName(task.getClass().getSimpleName());
|
||||
|
||||
if ( firstTimeAdded ) {
|
||||
final ComponentLog componentLog = new SimpleProcessLogger(id, taskNode.getReportingTask());
|
||||
final ReportingInitializationContext config = new StandardReportingInitializationContext(id, taskNode.getName(),
|
||||
SchedulingStrategy.TIMER_DRIVEN, "1 min", componentLog, this);
|
||||
|
||||
try {
|
||||
task.initialize(config);
|
||||
} catch (final InitializationException ie) {
|
||||
throw new ReportingTaskInstantiationException("Failed to initialize reporting task of type " + type, ie);
|
||||
}
|
||||
|
||||
try (final NarCloseable x = NarCloseable.withNarLoader()) {
|
||||
ReflectionUtils.invokeMethodsWithAnnotation(OnAdded.class, task);
|
||||
} catch (final Exception e) {
|
||||
|
@ -2529,30 +2608,33 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
return taskNode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ReportingTaskNode getReportingTaskNode(final String taskId) {
|
||||
return reportingTasks.get(taskId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startReportingTask(final ReportingTaskNode reportingTaskNode) {
|
||||
if (isTerminated()) {
|
||||
throw new IllegalStateException("Cannot start reporting task " + reportingTaskNode + " because the controller is terminated");
|
||||
}
|
||||
|
||||
reportingTaskNode.verifyCanStart();
|
||||
|
||||
processScheduler.schedule(reportingTaskNode);
|
||||
processScheduler.schedule(reportingTaskNode);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void stopReportingTask(final ReportingTaskNode reportingTaskNode) {
|
||||
if (isTerminated()) {
|
||||
return;
|
||||
}
|
||||
|
||||
reportingTaskNode.verifyCanStop();
|
||||
|
||||
processScheduler.unschedule(reportingTaskNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeReportingTask(final ReportingTaskNode reportingTaskNode) {
|
||||
final ReportingTaskNode existing = reportingTasks.get(reportingTaskNode.getIdentifier());
|
||||
if ( existing == null || existing != reportingTaskNode ) {
|
||||
|
@ -2565,43 +2647,100 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnRemoved.class, reportingTaskNode.getReportingTask(), reportingTaskNode.getConfigurationContext());
|
||||
}
|
||||
|
||||
for ( final Map.Entry<PropertyDescriptor, String> entry : reportingTaskNode.getProperties().entrySet() ) {
|
||||
final PropertyDescriptor descriptor = entry.getKey();
|
||||
if (descriptor.getControllerServiceDefinition() != null ) {
|
||||
final String value = entry.getValue() == null ? descriptor.getDefaultValue() : entry.getValue();
|
||||
if ( value != null ) {
|
||||
final ControllerServiceNode serviceNode = controllerServiceProvider.getControllerServiceNode(value);
|
||||
if ( serviceNode != null ) {
|
||||
serviceNode.removeReference(reportingTaskNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reportingTasks.remove(reportingTaskNode.getIdentifier());
|
||||
}
|
||||
|
||||
Collection<ReportingTaskNode> getReportingTasks() {
|
||||
return reportingTasks.values();
|
||||
@Override
|
||||
public Set<ReportingTaskNode> getAllReportingTasks() {
|
||||
return new HashSet<>(reportingTasks.values());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ControllerServiceNode createControllerService(final String type, final String id, final boolean firstTimeAdded) {
|
||||
return controllerServiceProvider.createControllerService(type, id, firstTimeAdded);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableReportingTask(final ReportingTaskNode reportingTaskNode) {
|
||||
reportingTaskNode.verifyCanEnable();
|
||||
|
||||
processScheduler.enableReportingTask(reportingTaskNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableReportingTask(final ReportingTaskNode reportingTaskNode) {
|
||||
reportingTaskNode.verifyCanDisable();
|
||||
|
||||
processScheduler.disableReportingTask(reportingTaskNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableReferencingServices(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.disableReferencingServices(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableReferencingServices(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.enableReferencingServices(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleReferencingComponents(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.scheduleReferencingComponents(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unscheduleReferencingComponents(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.unscheduleReferencingComponents(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableControllerService(final ControllerServiceNode serviceNode) {
|
||||
serviceNode.verifyCanEnable();
|
||||
controllerServiceProvider.enableControllerService(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableControllerServices(final Collection<ControllerServiceNode> serviceNodes) {
|
||||
controllerServiceProvider.enableControllerServices(serviceNodes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableControllerService(final ControllerServiceNode serviceNode) {
|
||||
serviceNode.verifyCanDisable();
|
||||
controllerServiceProvider.disableControllerService(serviceNode);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ControllerServiceNode createControllerService(final String type, final String id, final boolean firstTimeAdded) {
|
||||
return controllerServiceProvider.createControllerService(type, id.intern(), firstTimeAdded);
|
||||
public void verifyCanEnableReferencingServices(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.verifyCanEnableReferencingServices(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyCanScheduleReferencingComponents(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.verifyCanScheduleReferencingComponents(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyCanDisableReferencingServices(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.verifyCanDisableReferencingServices(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyCanStopReferencingComponents(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.verifyCanStopReferencingComponents(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ControllerService getControllerService(final String serviceIdentifier) {
|
||||
return controllerServiceProvider.getControllerService(serviceIdentifier);
|
||||
|
@ -2623,10 +2762,24 @@ public class FlowController implements EventAccess, ControllerServiceProvider, H
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isControllerServiceEnabling(final String serviceIdentifier) {
|
||||
return controllerServiceProvider.isControllerServiceEnabling(serviceIdentifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getControllerServiceName(final String serviceIdentifier) {
|
||||
return controllerServiceProvider.getControllerServiceName(serviceIdentifier);
|
||||
}
|
||||
|
||||
public void removeControllerService(final ControllerServiceNode serviceNode) {
|
||||
controllerServiceProvider.removeControllerService(serviceNode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<ControllerServiceNode> getAllControllerServices() {
|
||||
return controllerServiceProvider.getAllControllerServices();
|
||||
}
|
||||
|
||||
//
|
||||
// Counters
|
||||
//
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Set;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.nifi.connectable.Size;
|
||||
import org.apache.nifi.controller.service.ControllerServiceState;
|
||||
import org.apache.nifi.encrypt.StringEncryptor;
|
||||
import org.apache.nifi.groups.RemoteProcessGroupPortDescriptor;
|
||||
import org.apache.nifi.remote.StandardRemoteProcessGroupPortDescriptor;
|
||||
|
@ -33,6 +34,7 @@ import org.apache.nifi.scheduling.SchedulingStrategy;
|
|||
import org.apache.nifi.util.DomUtils;
|
||||
import org.apache.nifi.web.api.dto.ConnectableDTO;
|
||||
import org.apache.nifi.web.api.dto.ConnectionDTO;
|
||||
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
|
||||
import org.apache.nifi.web.api.dto.FlowSnippetDTO;
|
||||
import org.apache.nifi.web.api.dto.FunnelDTO;
|
||||
import org.apache.nifi.web.api.dto.LabelDTO;
|
||||
|
@ -42,7 +44,7 @@ import org.apache.nifi.web.api.dto.ProcessGroupDTO;
|
|||
import org.apache.nifi.web.api.dto.ProcessorConfigDTO;
|
||||
import org.apache.nifi.web.api.dto.ProcessorDTO;
|
||||
import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO;
|
||||
|
||||
import org.apache.nifi.web.api.dto.ReportingTaskDTO;
|
||||
import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
|
||||
|
@ -77,6 +79,40 @@ public class FlowFromDOMFactory {
|
|||
|
||||
return styles;
|
||||
}
|
||||
|
||||
public static ControllerServiceDTO getControllerService(final Element element, final StringEncryptor encryptor) {
|
||||
final ControllerServiceDTO dto = new ControllerServiceDTO();
|
||||
|
||||
dto.setId(getString(element, "id"));
|
||||
dto.setName(getString(element, "name"));
|
||||
dto.setComments(getString(element, "comment"));
|
||||
dto.setType(getString(element, "class"));
|
||||
|
||||
final boolean enabled = getBoolean(element, "enabled");
|
||||
dto.setState(enabled ? ControllerServiceState.ENABLED.name() : ControllerServiceState.DISABLED.name());
|
||||
|
||||
dto.setProperties(getProperties(element, encryptor));
|
||||
dto.setAnnotationData(getString(element, "annotationData"));
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static ReportingTaskDTO getReportingTask(final Element element, final StringEncryptor encryptor) {
|
||||
final ReportingTaskDTO dto = new ReportingTaskDTO();
|
||||
|
||||
dto.setId(getString(element, "id"));
|
||||
dto.setName(getString(element, "name"));
|
||||
dto.setComments(getString(element, "comment"));
|
||||
dto.setType(getString(element, "class"));
|
||||
dto.setSchedulingPeriod(getString(element, "schedulingPeriod"));
|
||||
dto.setState(getString(element, "scheduledState"));
|
||||
dto.setSchedulingStrategy(getString(element, "schedulingStrategy"));
|
||||
|
||||
dto.setProperties(getProperties(element, encryptor));
|
||||
dto.setAnnotationData(getString(element, "annotationData"));
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static ProcessGroupDTO getProcessGroup(final String parentId, final Element element, final StringEncryptor encryptor) {
|
||||
final ProcessGroupDTO dto = new ProcessGroupDTO();
|
||||
|
@ -310,7 +346,6 @@ public class FlowFromDOMFactory {
|
|||
final ProcessorConfigDTO configDto = new ProcessorConfigDTO();
|
||||
dto.setConfig(configDto);
|
||||
configDto.setComments(getString(element, "comment"));
|
||||
configDto.setAnnotationData(getString(element, "annotationData"));
|
||||
configDto.setConcurrentlySchedulableTaskCount(getInt(element, "maxConcurrentTasks"));
|
||||
final String schedulingPeriod = getString(element, "schedulingPeriod");
|
||||
configDto.setSchedulingPeriod(schedulingPeriod);
|
||||
|
@ -334,14 +369,8 @@ public class FlowFromDOMFactory {
|
|||
configDto.setRunDurationMillis(TimeUnit.NANOSECONDS.toMillis(runDurationNanos));
|
||||
}
|
||||
|
||||
final LinkedHashMap<String, String> properties = new LinkedHashMap<>();
|
||||
final List<Element> propertyNodeList = getChildrenByTagName(element, "property");
|
||||
for (final Element propertyElement : propertyNodeList) {
|
||||
final String name = getString(propertyElement, "name");
|
||||
final String value = decrypt(getString(propertyElement, "value"), encryptor);
|
||||
properties.put(name, value);
|
||||
}
|
||||
configDto.setProperties(properties);
|
||||
configDto.setProperties(getProperties(element, encryptor));
|
||||
configDto.setAnnotationData(getString(element, "annotationData"));
|
||||
|
||||
final Set<String> autoTerminatedRelationships = new HashSet<>();
|
||||
final List<Element> autoTerminateList = getChildrenByTagName(element, "autoTerminatedRelationship");
|
||||
|
@ -353,6 +382,17 @@ public class FlowFromDOMFactory {
|
|||
return dto;
|
||||
}
|
||||
|
||||
private static LinkedHashMap<String, String> getProperties(final Element element, final StringEncryptor encryptor) {
|
||||
final LinkedHashMap<String, String> properties = new LinkedHashMap<>();
|
||||
final List<Element> propertyNodeList = getChildrenByTagName(element, "property");
|
||||
for (final Element propertyElement : propertyNodeList) {
|
||||
final String name = getString(propertyElement, "name");
|
||||
final String value = decrypt(getString(propertyElement, "value"), encryptor);
|
||||
properties.put(name, value);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
|
||||
private static String getString(final Element element, final String childElementName) {
|
||||
final List<Element> nodeList = getChildrenByTagName(element, childElementName);
|
||||
if (nodeList == null || nodeList.isEmpty()) {
|
||||
|
|
|
@ -40,6 +40,8 @@ import org.apache.nifi.connectable.Port;
|
|||
import org.apache.nifi.connectable.Position;
|
||||
import org.apache.nifi.connectable.Size;
|
||||
import org.apache.nifi.controller.label.Label;
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.controller.service.ControllerServiceState;
|
||||
import org.apache.nifi.encrypt.StringEncryptor;
|
||||
import org.apache.nifi.flowfile.FlowFilePrioritizer;
|
||||
import org.apache.nifi.groups.ProcessGroup;
|
||||
|
@ -47,7 +49,6 @@ import org.apache.nifi.groups.RemoteProcessGroup;
|
|||
import org.apache.nifi.processor.Relationship;
|
||||
import org.apache.nifi.remote.RemoteGroupPort;
|
||||
import org.apache.nifi.remote.RootGroupPort;
|
||||
|
||||
import org.w3c.dom.DOMException;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
|
@ -79,6 +80,18 @@ public class StandardFlowSerializer implements FlowSerializer {
|
|||
addTextElement(rootNode, "maxTimerDrivenThreadCount", controller.getMaxTimerDrivenThreadCount());
|
||||
addTextElement(rootNode, "maxEventDrivenThreadCount", controller.getMaxEventDrivenThreadCount());
|
||||
addProcessGroup(rootNode, controller.getGroup(controller.getRootGroupId()), "rootGroup");
|
||||
|
||||
final Element controllerServicesNode = doc.createElement("controllerServices");
|
||||
rootNode.appendChild(controllerServicesNode);
|
||||
for ( final ControllerServiceNode serviceNode : controller.getAllControllerServices() ) {
|
||||
addControllerService(controllerServicesNode, serviceNode, encryptor);
|
||||
}
|
||||
|
||||
final Element reportingTasksNode = doc.createElement("reportingTasks");
|
||||
rootNode.appendChild(reportingTasksNode);
|
||||
for ( final ReportingTaskNode taskNode : controller.getAllReportingTasks() ) {
|
||||
addReportingTask(reportingTasksNode, taskNode, encryptor);
|
||||
}
|
||||
|
||||
final DOMSource domSource = new DOMSource(doc);
|
||||
final StreamResult streamResult = new StreamResult(new BufferedOutputStream(os));
|
||||
|
@ -300,8 +313,16 @@ public class StandardFlowSerializer implements FlowSerializer {
|
|||
addTextElement(element, "schedulingStrategy", processor.getSchedulingStrategy().name());
|
||||
addTextElement(element, "runDurationNanos", processor.getRunDuration(TimeUnit.NANOSECONDS));
|
||||
|
||||
// properties.
|
||||
for (final Map.Entry<PropertyDescriptor, String> entry : processor.getProperties().entrySet()) {
|
||||
addConfiguration(element, processor.getProperties(), processor.getAnnotationData(), encryptor);
|
||||
|
||||
for (final Relationship rel : processor.getAutoTerminatedRelationships()) {
|
||||
addTextElement(element, "autoTerminatedRelationship", rel.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private static void addConfiguration(final Element element, final Map<PropertyDescriptor, String> properties, final String annotationData, final StringEncryptor encryptor) {
|
||||
final Document doc = element.getOwnerDocument();
|
||||
for (final Map.Entry<PropertyDescriptor, String> entry : properties.entrySet()) {
|
||||
final PropertyDescriptor descriptor = entry.getKey();
|
||||
String value = entry.getValue();
|
||||
|
||||
|
@ -322,14 +343,9 @@ public class StandardFlowSerializer implements FlowSerializer {
|
|||
element.appendChild(propElement);
|
||||
}
|
||||
|
||||
final String annotationData = processor.getAnnotationData();
|
||||
if (annotationData != null) {
|
||||
addTextElement(element, "annotationData", annotationData);
|
||||
}
|
||||
|
||||
for (final Relationship rel : processor.getAutoTerminatedRelationships()) {
|
||||
addTextElement(element, "autoTerminatedRelationship", rel.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private void addConnection(final Element parentElement, final Connection connection) {
|
||||
|
@ -390,11 +406,43 @@ public class StandardFlowSerializer implements FlowSerializer {
|
|||
parentElement.appendChild(element);
|
||||
}
|
||||
|
||||
private void addTextElement(final Element element, final String name, final long value) {
|
||||
|
||||
public static void addControllerService(final Element element, final ControllerServiceNode serviceNode, final StringEncryptor encryptor) {
|
||||
final Element serviceElement = element.getOwnerDocument().createElement("controllerService");
|
||||
addTextElement(serviceElement, "id", serviceNode.getIdentifier());
|
||||
addTextElement(serviceElement, "name", serviceNode.getName());
|
||||
addTextElement(serviceElement, "comment", serviceNode.getComments());
|
||||
addTextElement(serviceElement, "class", serviceNode.getControllerServiceImplementation().getClass().getCanonicalName());
|
||||
|
||||
final ControllerServiceState state = serviceNode.getState();
|
||||
final boolean enabled = (state == ControllerServiceState.ENABLED || state == ControllerServiceState.ENABLING);
|
||||
addTextElement(serviceElement, "enabled", String.valueOf(enabled));
|
||||
|
||||
addConfiguration(serviceElement, serviceNode.getProperties(), serviceNode.getAnnotationData(), encryptor);
|
||||
|
||||
element.appendChild(serviceElement);
|
||||
}
|
||||
|
||||
public static void addReportingTask(final Element element, final ReportingTaskNode taskNode, final StringEncryptor encryptor) {
|
||||
final Element taskElement = element.getOwnerDocument().createElement("reportingTask");
|
||||
addTextElement(taskElement, "id", taskNode.getIdentifier());
|
||||
addTextElement(taskElement, "name", taskNode.getName());
|
||||
addTextElement(taskElement, "comment", taskNode.getComments());
|
||||
addTextElement(taskElement, "class", taskNode.getReportingTask().getClass().getCanonicalName());
|
||||
addTextElement(taskElement, "schedulingPeriod", taskNode.getSchedulingPeriod());
|
||||
addTextElement(taskElement, "scheduledState", taskNode.getScheduledState().name());
|
||||
addTextElement(taskElement, "schedulingStrategy", taskNode.getSchedulingStrategy().name());
|
||||
|
||||
addConfiguration(taskElement, taskNode.getProperties(), taskNode.getAnnotationData(), encryptor);
|
||||
|
||||
element.appendChild(taskElement);
|
||||
}
|
||||
|
||||
private static void addTextElement(final Element element, final String name, final long value) {
|
||||
addTextElement(element, name, String.valueOf(value));
|
||||
}
|
||||
|
||||
private void addTextElement(final Element element, final String name, final String value) {
|
||||
private static void addTextElement(final Element element, final String name, final String value) {
|
||||
final Document doc = element.getOwnerDocument();
|
||||
final Element toAdd = doc.createElement(name);
|
||||
toAdd.setTextContent(value);
|
||||
|
|
|
@ -81,8 +81,6 @@ public class StandardFlowService implements FlowService, ProtocolHandler {
|
|||
|
||||
private final FlowController controller;
|
||||
private final Path flowXml;
|
||||
private final Path taskConfigXml;
|
||||
private final Path serviceConfigXml;
|
||||
private final FlowConfigurationDAO dao;
|
||||
private final int gracefulShutdownSeconds;
|
||||
private final boolean autoResumeState;
|
||||
|
@ -154,14 +152,12 @@ public class StandardFlowService implements FlowService, ProtocolHandler {
|
|||
this.controller = controller;
|
||||
this.encryptor = encryptor;
|
||||
flowXml = Paths.get(properties.getProperty(NiFiProperties.FLOW_CONFIGURATION_FILE));
|
||||
taskConfigXml = Paths.get(properties.getProperty(NiFiProperties.TASK_CONFIGURATION_FILE));
|
||||
serviceConfigXml = Paths.get(properties.getProperty(NiFiProperties.SERVICE_CONFIGURATION_FILE));
|
||||
|
||||
gracefulShutdownSeconds = (int) FormatUtils.getTimeDuration(properties.getProperty(NiFiProperties.FLOW_CONTROLLER_GRACEFUL_SHUTDOWN_PERIOD), TimeUnit.SECONDS);
|
||||
autoResumeState = properties.getAutoResumeState();
|
||||
connectionRetryMillis = (int) FormatUtils.getTimeDuration(properties.getClusterManagerFlowRetrievalDelay(), TimeUnit.MILLISECONDS);
|
||||
|
||||
dao = new StandardXMLFlowConfigurationDAO(flowXml, taskConfigXml, serviceConfigXml, encryptor);
|
||||
dao = new StandardXMLFlowConfigurationDAO(flowXml, encryptor);
|
||||
|
||||
if (configuredForClustering) {
|
||||
|
||||
|
@ -605,7 +601,6 @@ public class StandardFlowService implements FlowService, ProtocolHandler {
|
|||
if (firstControllerInitialization) {
|
||||
// load the controller services
|
||||
logger.debug("Loading controller services");
|
||||
dao.loadControllerServices(controller);
|
||||
}
|
||||
|
||||
// load the flow
|
||||
|
@ -622,7 +617,7 @@ public class StandardFlowService implements FlowService, ProtocolHandler {
|
|||
logger.debug("First controller initialization. Loading reporting tasks and initializing controller.");
|
||||
|
||||
// load the controller tasks
|
||||
dao.loadReportingTasks(controller);
|
||||
// dao.loadReportingTasks(controller);
|
||||
|
||||
// initialize the flow
|
||||
controller.initializeFlow();
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.nio.file.Path;
|
|||
import java.nio.file.StandardOpenOption;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -40,6 +41,7 @@ import javax.xml.parsers.ParserConfigurationException;
|
|||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.nifi.cluster.protocol.DataFlow;
|
||||
import org.apache.nifi.cluster.protocol.StandardDataFlow;
|
||||
import org.apache.nifi.connectable.Connectable;
|
||||
|
@ -51,23 +53,35 @@ import org.apache.nifi.connectable.Position;
|
|||
import org.apache.nifi.connectable.Size;
|
||||
import org.apache.nifi.controller.exception.ProcessorInstantiationException;
|
||||
import org.apache.nifi.controller.label.Label;
|
||||
import org.apache.nifi.controller.reporting.ReportingTaskInstantiationException;
|
||||
import org.apache.nifi.controller.reporting.StandardReportingInitializationContext;
|
||||
import org.apache.nifi.controller.service.ControllerServiceLoader;
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.controller.service.ControllerServiceState;
|
||||
import org.apache.nifi.encrypt.StringEncryptor;
|
||||
import org.apache.nifi.events.BulletinFactory;
|
||||
import org.apache.nifi.util.file.FileUtils;
|
||||
import org.apache.nifi.fingerprint.FingerprintException;
|
||||
import org.apache.nifi.fingerprint.FingerprintFactory;
|
||||
import org.apache.nifi.flowfile.FlowFilePrioritizer;
|
||||
import org.apache.nifi.groups.ProcessGroup;
|
||||
import org.apache.nifi.groups.RemoteProcessGroup;
|
||||
import org.apache.nifi.groups.RemoteProcessGroupPortDescriptor;
|
||||
import org.apache.nifi.logging.ComponentLog;
|
||||
import org.apache.nifi.logging.LogLevel;
|
||||
import org.apache.nifi.processor.Relationship;
|
||||
import org.apache.nifi.processor.SimpleProcessLogger;
|
||||
import org.apache.nifi.remote.RemoteGroupPort;
|
||||
import org.apache.nifi.remote.RootGroupPort;
|
||||
import org.apache.nifi.reporting.InitializationException;
|
||||
import org.apache.nifi.reporting.ReportingInitializationContext;
|
||||
import org.apache.nifi.reporting.Severity;
|
||||
import org.apache.nifi.scheduling.SchedulingStrategy;
|
||||
import org.apache.nifi.util.DomUtils;
|
||||
import org.apache.nifi.util.NiFiProperties;
|
||||
import org.apache.nifi.util.file.FileUtils;
|
||||
import org.apache.nifi.web.api.dto.ConnectableDTO;
|
||||
import org.apache.nifi.web.api.dto.ConnectionDTO;
|
||||
import org.apache.nifi.web.api.dto.ControllerServiceDTO;
|
||||
import org.apache.nifi.web.api.dto.FlowSnippetDTO;
|
||||
import org.apache.nifi.web.api.dto.FunnelDTO;
|
||||
import org.apache.nifi.web.api.dto.LabelDTO;
|
||||
|
@ -77,9 +91,7 @@ import org.apache.nifi.web.api.dto.ProcessGroupDTO;
|
|||
import org.apache.nifi.web.api.dto.ProcessorConfigDTO;
|
||||
import org.apache.nifi.web.api.dto.ProcessorDTO;
|
||||
import org.apache.nifi.web.api.dto.RemoteProcessGroupDTO;
|
||||
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.nifi.encrypt.StringEncryptor;
|
||||
import org.apache.nifi.web.api.dto.ReportingTaskDTO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.w3c.dom.Document;
|
||||
|
@ -96,9 +108,11 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
|
|||
private static final Logger logger = LoggerFactory.getLogger(StandardFlowSynchronizer.class);
|
||||
public static final URL FLOW_XSD_RESOURCE = StandardFlowSynchronizer.class.getResource("/FlowConfiguration.xsd");
|
||||
private final StringEncryptor encryptor;
|
||||
private final boolean autoResumeState;
|
||||
|
||||
public StandardFlowSynchronizer(final StringEncryptor encryptor) {
|
||||
this.encryptor = encryptor;
|
||||
autoResumeState = NiFiProperties.getInstance().getAutoResumeState();
|
||||
}
|
||||
|
||||
public static boolean isEmpty(final DataFlow dataFlow, final StringEncryptor encryptor) {
|
||||
|
@ -157,10 +171,26 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
|
|||
controller.setMaxEventDrivenThreadCount(maxThreadCount / 3);
|
||||
}
|
||||
|
||||
final Element reportingTasksElement = (Element) DomUtils.getChild(rootElement, "reportingTasks");
|
||||
final List<Element> taskElements;
|
||||
if ( reportingTasksElement == null ) {
|
||||
taskElements = Collections.emptyList();
|
||||
} else {
|
||||
taskElements = DomUtils.getChildElementsByTagName(reportingTasksElement, "reportingTask");
|
||||
}
|
||||
|
||||
final Element controllerServicesElement = (Element) DomUtils.getChild(rootElement, "controllerServices");
|
||||
final List<Element> controllerServiceElements;
|
||||
if ( controllerServicesElement == null ) {
|
||||
controllerServiceElements = Collections.emptyList();
|
||||
} else {
|
||||
controllerServiceElements = DomUtils.getChildElementsByTagName(controllerServicesElement, "controllerService");
|
||||
}
|
||||
|
||||
logger.trace("Parsing process group from DOM");
|
||||
final Element rootGroupElement = (Element) rootElement.getElementsByTagName("rootGroup").item(0);
|
||||
final ProcessGroupDTO rootGroupDto = FlowFromDOMFactory.getProcessGroup(null, rootGroupElement, encryptor);
|
||||
existingFlowEmpty = isEmpty(rootGroupDto);
|
||||
existingFlowEmpty = taskElements.isEmpty() && controllerServiceElements.isEmpty() && isEmpty(rootGroupDto);
|
||||
logger.debug("Existing Flow Empty = {}", existingFlowEmpty);
|
||||
}
|
||||
}
|
||||
|
@ -200,37 +230,64 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
|
|||
// create document by parsing proposed flow bytes
|
||||
logger.trace("Parsing proposed flow bytes as DOM document");
|
||||
final Document configuration = parseFlowBytes(proposedFlow.getFlow());
|
||||
|
||||
|
||||
// attempt to sync controller with proposed flow
|
||||
try {
|
||||
if (configuration != null) {
|
||||
// get the root element
|
||||
final Element rootElement = (Element) configuration.getElementsByTagName("flowController").item(0);
|
||||
|
||||
// set controller config
|
||||
logger.trace("Updating flow config");
|
||||
final Integer maxThreadCount = getInteger(rootElement, "maxThreadCount");
|
||||
if (maxThreadCount == null) {
|
||||
controller.setMaxTimerDrivenThreadCount(getInt(rootElement, "maxTimerDrivenThreadCount"));
|
||||
controller.setMaxEventDrivenThreadCount(getInt(rootElement, "maxEventDrivenThreadCount"));
|
||||
} else {
|
||||
controller.setMaxTimerDrivenThreadCount(maxThreadCount * 2 / 3);
|
||||
controller.setMaxEventDrivenThreadCount(maxThreadCount / 3);
|
||||
}
|
||||
|
||||
// get the root group XML element
|
||||
final Element rootGroupElement = (Element) rootElement.getElementsByTagName("rootGroup").item(0);
|
||||
|
||||
// if this controller isn't initialized or its emtpy, add the root group, otherwise update
|
||||
if (!initialized || existingFlowEmpty) {
|
||||
logger.trace("Adding root process group");
|
||||
addProcessGroup(controller, /* parent group */ null, rootGroupElement, encryptor);
|
||||
} else {
|
||||
logger.trace("Updating root process group");
|
||||
updateProcessGroup(controller, /* parent group */ null, rootGroupElement, encryptor);
|
||||
synchronized (configuration) {
|
||||
// get the root element
|
||||
final Element rootElement = (Element) configuration.getElementsByTagName("flowController").item(0);
|
||||
|
||||
// set controller config
|
||||
logger.trace("Updating flow config");
|
||||
final Integer maxThreadCount = getInteger(rootElement, "maxThreadCount");
|
||||
if (maxThreadCount == null) {
|
||||
controller.setMaxTimerDrivenThreadCount(getInt(rootElement, "maxTimerDrivenThreadCount"));
|
||||
controller.setMaxEventDrivenThreadCount(getInt(rootElement, "maxEventDrivenThreadCount"));
|
||||
} else {
|
||||
controller.setMaxTimerDrivenThreadCount(maxThreadCount * 2 / 3);
|
||||
controller.setMaxEventDrivenThreadCount(maxThreadCount / 3);
|
||||
}
|
||||
|
||||
// get the root group XML element
|
||||
final Element rootGroupElement = (Element) rootElement.getElementsByTagName("rootGroup").item(0);
|
||||
|
||||
final Element controllerServicesElement = (Element) DomUtils.getChild(rootElement, "controllerServices");
|
||||
if ( controllerServicesElement != null ) {
|
||||
final List<Element> serviceElements = DomUtils.getChildElementsByTagName(controllerServicesElement, "controllerService");
|
||||
|
||||
if ( !initialized || existingFlowEmpty ) {
|
||||
ControllerServiceLoader.loadControllerServices(serviceElements, controller, encryptor, controller.getBulletinRepository(), autoResumeState);
|
||||
} else {
|
||||
for ( final Element serviceElement : serviceElements ) {
|
||||
updateControllerService(controller, serviceElement, encryptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if this controller isn't initialized or its emtpy, add the root group, otherwise update
|
||||
if (!initialized || existingFlowEmpty) {
|
||||
logger.trace("Adding root process group");
|
||||
addProcessGroup(controller, /* parent group */ null, rootGroupElement, encryptor);
|
||||
} else {
|
||||
logger.trace("Updating root process group");
|
||||
updateProcessGroup(controller, /* parent group */ null, rootGroupElement, encryptor);
|
||||
}
|
||||
|
||||
final Element reportingTasksElement = (Element) DomUtils.getChild(rootElement, "reportingTasks");
|
||||
if ( reportingTasksElement != null ) {
|
||||
final List<Element> taskElements = DomUtils.getChildElementsByTagName(reportingTasksElement, "reportingTask");
|
||||
for ( final Element taskElement : taskElements ) {
|
||||
if ( !initialized || existingFlowEmpty ) {
|
||||
addReportingTask(controller, taskElement, encryptor);
|
||||
} else {
|
||||
updateReportingTask(controller, taskElement, encryptor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
logger.trace("Synching templates");
|
||||
if ((existingTemplates == null || existingTemplates.length == 0) && proposedFlow.getTemplates() != null && proposedFlow.getTemplates().length > 0) {
|
||||
// need to load templates
|
||||
|
@ -313,7 +370,124 @@ public class StandardFlowSynchronizer implements FlowSynchronizer {
|
|||
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
private void updateControllerService(final FlowController controller, final Element controllerServiceElement, final StringEncryptor encryptor) {
|
||||
final ControllerServiceDTO dto = FlowFromDOMFactory.getControllerService(controllerServiceElement, encryptor);
|
||||
|
||||
final ControllerServiceState dtoState = ControllerServiceState.valueOf(dto.getState());
|
||||
final boolean dtoEnabled = (dtoState == ControllerServiceState.ENABLED || dtoState == ControllerServiceState.ENABLING);
|
||||
|
||||
final ControllerServiceNode serviceNode = controller.getControllerServiceNode(dto.getId());
|
||||
final ControllerServiceState serviceState = serviceNode.getState();
|
||||
final boolean serviceEnabled = (serviceState == ControllerServiceState.ENABLED || serviceState == ControllerServiceState.ENABLING);
|
||||
|
||||
if (dtoEnabled && !serviceEnabled) {
|
||||
controller.enableControllerService(controller.getControllerServiceNode(dto.getId()));
|
||||
} else if (!dtoEnabled && serviceEnabled) {
|
||||
controller.disableControllerService(controller.getControllerServiceNode(dto.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
private void addReportingTask(final FlowController controller, final Element reportingTaskElement, final StringEncryptor encryptor) throws ReportingTaskInstantiationException {
|
||||
final ReportingTaskDTO dto = FlowFromDOMFactory.getReportingTask(reportingTaskElement, encryptor);
|
||||
|
||||
final ReportingTaskNode reportingTask = controller.createReportingTask(dto.getType(), dto.getId(), false);
|
||||
reportingTask.setName(dto.getName());
|
||||
reportingTask.setComments(dto.getComments());
|
||||
reportingTask.setScheduldingPeriod(dto.getSchedulingPeriod());
|
||||
reportingTask.setSchedulingStrategy(SchedulingStrategy.valueOf(dto.getSchedulingStrategy()));
|
||||
|
||||
reportingTask.setAnnotationData(dto.getAnnotationData());
|
||||
|
||||
for (final Map.Entry<String, String> entry : dto.getProperties().entrySet()) {
|
||||
if (entry.getValue() == null) {
|
||||
reportingTask.removeProperty(entry.getKey());
|
||||
} else {
|
||||
reportingTask.setProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
final ComponentLog componentLog = new SimpleProcessLogger(dto.getId(), reportingTask.getReportingTask());
|
||||
final ReportingInitializationContext config = new StandardReportingInitializationContext(dto.getId(), dto.getName(),
|
||||
SchedulingStrategy.valueOf(dto.getSchedulingStrategy()), dto.getSchedulingPeriod(), componentLog, controller);
|
||||
|
||||
try {
|
||||
reportingTask.getReportingTask().initialize(config);
|
||||
} catch (final InitializationException ie) {
|
||||
throw new ReportingTaskInstantiationException("Failed to initialize reporting task of type " + dto.getType(), ie);
|
||||
}
|
||||
|
||||
if ( autoResumeState ) {
|
||||
if ( ScheduledState.RUNNING.name().equals(dto.getState()) ) {
|
||||
try {
|
||||
controller.startReportingTask(reportingTask);
|
||||
} catch (final Exception e) {
|
||||
logger.error("Failed to start {} due to {}", reportingTask, e);
|
||||
if ( logger.isDebugEnabled() ) {
|
||||
logger.error("", e);
|
||||
}
|
||||
controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin(
|
||||
"Reporting Tasks", Severity.ERROR.name(), "Failed to start " + reportingTask + " due to " + e));
|
||||
}
|
||||
} else if ( ScheduledState.DISABLED.name().equals(dto.getState()) ) {
|
||||
try {
|
||||
controller.disableReportingTask(reportingTask);
|
||||
} catch (final Exception e) {
|
||||
logger.error("Failed to mark {} as disabled due to {}", reportingTask, e);
|
||||
if ( logger.isDebugEnabled() ) {
|
||||
logger.error("", e);
|
||||
}
|
||||
controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin(
|
||||
"Reporting Tasks", Severity.ERROR.name(), "Failed to mark " + reportingTask + " as disabled due to " + e));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updateReportingTask(final FlowController controller, final Element reportingTaskElement, final StringEncryptor encryptor) {
|
||||
final ReportingTaskDTO dto = FlowFromDOMFactory.getReportingTask(reportingTaskElement, encryptor);
|
||||
final ReportingTaskNode taskNode = controller.getReportingTaskNode(dto.getId());
|
||||
|
||||
if (!taskNode.getScheduledState().name().equals(dto.getState())) {
|
||||
try {
|
||||
switch (ScheduledState.valueOf(dto.getState())) {
|
||||
case DISABLED:
|
||||
if ( taskNode.isRunning() ) {
|
||||
controller.stopReportingTask(taskNode);
|
||||
}
|
||||
controller.disableReportingTask(taskNode);
|
||||
break;
|
||||
case RUNNING:
|
||||
if ( taskNode.getScheduledState() == ScheduledState.DISABLED ) {
|
||||
controller.enableReportingTask(taskNode);
|
||||
}
|
||||
controller.startReportingTask(taskNode);
|
||||
break;
|
||||
case STOPPED:
|
||||
if (taskNode.getScheduledState() == ScheduledState.DISABLED) {
|
||||
controller.enableReportingTask(taskNode);
|
||||
} else if (taskNode.getScheduledState() == ScheduledState.RUNNING) {
|
||||
controller.stopReportingTask(taskNode);
|
||||
}
|
||||
break;
|
||||
}
|
||||
} catch (final IllegalStateException ise) {
|
||||
logger.error("Failed to change Scheduled State of {} from {} to {} due to {}", taskNode, taskNode.getScheduledState().name(), dto.getState(), ise.toString());
|
||||
logger.error("", ise);
|
||||
|
||||
// create bulletin for the Processor Node
|
||||
controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin("Node Reconnection", Severity.ERROR.name(),
|
||||
"Failed to change Scheduled State of " + taskNode + " from " + taskNode.getScheduledState().name() + " to " + dto.getState() + " due to " + ise.toString()));
|
||||
|
||||
// create bulletin at Controller level.
|
||||
controller.getBulletinRepository().addBulletin(BulletinFactory.createBulletin("Node Reconnection", Severity.ERROR.name(),
|
||||
"Failed to change Scheduled State of " + taskNode + " from " + taskNode.getScheduledState().name() + " to " + dto.getState() + " due to " + ise.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private ProcessGroup updateProcessGroup(final FlowController controller, final ProcessGroup parentGroup, final Element processGroupElement, final StringEncryptor encryptor) throws ProcessorInstantiationException {
|
||||
|
||||
// get the parent group ID
|
||||
|
|
|
@ -52,6 +52,7 @@ import org.apache.nifi.connectable.Connectable;
|
|||
import org.apache.nifi.connectable.ConnectableType;
|
||||
import org.apache.nifi.connectable.Connection;
|
||||
import org.apache.nifi.connectable.Position;
|
||||
import org.apache.nifi.controller.service.ControllerServiceNode;
|
||||
import org.apache.nifi.controller.service.ControllerServiceProvider;
|
||||
import org.apache.nifi.groups.ProcessGroup;
|
||||
import org.apache.nifi.logging.LogLevel;
|
||||
|
@ -120,7 +121,7 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||
private SchedulingStrategy schedulingStrategy; // guarded by read/write lock
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
StandardProcessorNode(final Processor processor, final String uuid, final ValidationContextFactory validationContextFactory,
|
||||
public StandardProcessorNode(final Processor processor, final String uuid, final ValidationContextFactory validationContextFactory,
|
||||
final ProcessScheduler scheduler, final ControllerServiceProvider controllerServiceProvider) {
|
||||
super(processor, uuid, validationContextFactory, controllerServiceProvider);
|
||||
|
||||
|
@ -985,6 +986,16 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getActiveThreadCount() {
|
||||
readLock.lock();
|
||||
try {
|
||||
return processScheduler.getActiveThreadCount(this);
|
||||
} finally {
|
||||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
|
@ -1182,8 +1193,13 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||
public void verifyCanStart() {
|
||||
readLock.lock();
|
||||
try {
|
||||
if (scheduledState.get() != ScheduledState.STOPPED) {
|
||||
throw new IllegalStateException(this + " is not stopped");
|
||||
switch (getScheduledState()) {
|
||||
case DISABLED:
|
||||
throw new IllegalStateException(this + " cannot be started because it is disabled");
|
||||
case RUNNING:
|
||||
throw new IllegalStateException(this + " cannot be started because it is already running");
|
||||
case STOPPED:
|
||||
break;
|
||||
}
|
||||
verifyNoActiveThreads();
|
||||
|
||||
|
@ -1194,6 +1210,31 @@ public class StandardProcessorNode extends ProcessorNode implements Connectable
|
|||
readLock.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyCanStart(final Set<ControllerServiceNode> ignoredReferences) {
|
||||
switch (getScheduledState()) {
|
||||
case DISABLED:
|
||||
throw new IllegalStateException(this + " cannot be started because it is disabled");
|
||||
case RUNNING:
|
||||
throw new IllegalStateException(this + " cannot be started because it is already running");
|
||||
case STOPPED:
|
||||
break;
|
||||
}
|
||||
verifyNoActiveThreads();
|
||||
|
||||
final Set<String> ids = new HashSet<>();
|
||||
for ( final ControllerServiceNode node : ignoredReferences ) {
|
||||
ids.add(node.getIdentifier());
|
||||
}
|
||||
|
||||
final Collection<ValidationResult> validationResults = getValidationErrors(ids);
|
||||
for ( final ValidationResult result : validationResults ) {
|
||||
if ( !result.isValid() ) {
|
||||
throw new IllegalStateException(this + " cannot be started because it is not valid: " + result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void verifyCanStop() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue