You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/11/18 17:06:17 UTC

[GitHub] [nifi] YolandaMDavis commented on a change in pull request #3886: NIFI-6855 - added action type enforcement option for handlers

YolandaMDavis commented on a change in pull request #3886: NIFI-6855 - added action type enforcement option for handlers
URL: https://github.com/apache/nifi/pull/3886#discussion_r347500603
 
 

 ##########
 File path: nifi-nar-bundles/nifi-rules-action-handler-bundle/nifi-rules-action-handler-service/src/main/java/org/apache/nifi/rules/handlers/AbstractActionHandlerService.java
 ##########
 @@ -16,22 +16,54 @@
  */
 package org.apache.nifi.rules.handlers;
 
+import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.annotation.lifecycle.OnEnabled;
+import org.apache.nifi.components.PropertyDescriptor;
 import org.apache.nifi.context.PropertyContext;
 import org.apache.nifi.controller.AbstractControllerService;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.reporting.InitializationException;
 import org.apache.nifi.rules.Action;
 import org.apache.nifi.rules.PropertyContextActionHandler;
 
 import java.util.Map;
 
 public abstract class AbstractActionHandlerService extends AbstractControllerService implements PropertyContextActionHandler {
 
+    protected String enforceActionType;
+
     public static enum DebugLevels {
         trace, debug, info, warn, error
     }
-    public abstract void execute(Action action, Map<String, Object> facts);
+
+    public static final PropertyDescriptor ENFORCE_ACTION_TYPE = new PropertyDescriptor.Builder()
+            .name("action-handler-enforce-type")
+            .displayName("Enforce Action Type")
+            .required(false)
+            .description("The Action Type that should be supported by this handler.  If provided any other type an " +
 
 Review comment:
   I think that's reasonable, if people want to use multiple types to apply to a handler

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services