This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-api.git


The following commit(s) were added to refs/heads/main by this push:
     new 124b995  NIFI-14371 add support for DisallowRunOnce annotation This 
closes #3 Reviewed and approved by Pierre Villard
124b995 is described below

commit 124b995b2496adb7232a5095550e001893883f70
Author: Joseph Witt <[email protected]>
AuthorDate: Fri Mar 14 13:52:59 2025 -0700

    NIFI-14371 add support for DisallowRunOnce annotation
    This closes #3
    Reviewed and approved by Pierre Villard
---
 .../nifi/annotation/behavior/DisallowRunOnce.java  | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git 
a/src/main/java/org/apache/nifi/annotation/behavior/DisallowRunOnce.java 
b/src/main/java/org/apache/nifi/annotation/behavior/DisallowRunOnce.java
new file mode 100644
index 0000000..249a72d
--- /dev/null
+++ b/src/main/java/org/apache/nifi/annotation/behavior/DisallowRunOnce.java
@@ -0,0 +1,51 @@
+/*
+ * 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.annotation.behavior;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * <p>
+ * Marker annotation a {@link org.apache.nifi.processor.Processor Processor}
+ * implementation can use to indicate that the Processor is not designed in
+ * such a way that the 'Run Once' capability would function.
+ * </p>
+ *
+ * <p>
+ * Some processors need many execution cycles to perform any meaningful work
+ * and as such the user triggering a 'Run Once' execution will likely result
+ * in no response or outcome at all.
+ * </p>
+ */
+@Documented
+@Target({ElementType.TYPE})
+@Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface DisallowRunOnce {
+
+    /**
+     * An optional explanation for why run once is not supported
+     * @return explanation string that may end up being shared with users
+     */
+    String explanation();
+
+}

Reply via email to