Move CreateOrReplaceResult 97/107797/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Sep 2023 19:38:35 +0000 (21:38 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 11 Sep 2023 19:39:20 +0000 (21:39 +0200)
This is the result of a create-or-replace operation, which we will be
introducing in RestconfStrategy. Move the class there for co-location.

JIRA: NETCONF-1125
Change-Id: Id26574e2b567c769e54737316f8bd840cc4767af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/transactions/RestconfStrategy.java
restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/utils/PutDataTransactionUtil.java

index 70f5a7a2fa59e8911f60afdb837cd5e945fcee11..6143cf7c55dfb06b714ccb3a8775095f2c4cbda3 100644 (file)
@@ -38,6 +38,22 @@ import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 // FIXME: it seems the first three operations deal with lifecycle of a transaction, while others invoke various
 //        operations. This should be handled through proper allocation indirection.
 public abstract class RestconfStrategy {
+    /**
+     * Result of a {@code PUT} request as defined in
+     * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.5">RFC8040 section 4.5</a>. The definition makes it
+     * clear that the logical operation is {@code create-or-replace}.
+     */
+    public enum CreateOrReplaceResult {
+        /**
+         * A new resource has been created.
+         */
+        CREATED,
+        /*
+         * An existing resources has been replaced.
+         */
+        REPLACED;
+    }
+
     RestconfStrategy() {
         // Hidden on purpose
     }
index bdd16bd19b1872012b45969a7014c4672578f133..fd1997a79fc3d24334f8e602e6a3964855330933 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.restconf.api.query.PointParam;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.nb.rfc8040.WriteDataParams;
 import org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy;
+import org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy.CreateOrReplaceResult;
 import org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfTransaction;
 import org.opendaylight.restconf.nb.rfc8040.utils.parser.YangInstanceIdentifierDeserializer;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
@@ -35,22 +36,6 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext;
  * Util class for put data to DS.
  */
 public final class PutDataTransactionUtil {
-    /**
-     * Result of a {@code PUT} request as defined in
-     * <a href="https://www.rfc-editor.org/rfc/rfc8040#section-4.5">RFC8040 section 4.5</a>. The definition makes it
-     * clear that the logical operation is {@code create-or-replace}.
-     */
-    public enum CreateOrReplaceResult {
-        /**
-         * A new resource has been created.
-         */
-        CREATED,
-        /*
-         * An existing resources has been replaced.
-         */
-        REPLACED;
-    }
-
     private PutDataTransactionUtil() {
         // Hidden on purpose
     }