Remove RestconfError.ErrorTag
[netconf.git] / restconf / restconf-nb-rfc8040 / src / main / java / org / opendaylight / restconf / nb / rfc8040 / rests / utils / ReadDataTransactionUtil.java
index 875438290a519224d0707312f1e6a8cd5fddba5d..a109731dc9930495d131dc4d3649a3cde7d2ee90 100644 (file)
@@ -31,9 +31,9 @@ import org.opendaylight.restconf.common.context.WriterParameters;
 import org.opendaylight.restconf.common.context.WriterParameters.WriterParametersBuilder;
 import org.opendaylight.restconf.common.errors.RestconfDocumentedException;
 import org.opendaylight.restconf.common.errors.RestconfError;
-import org.opendaylight.restconf.common.errors.RestconfError.ErrorTag;
 import org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy;
 import org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfDataServiceConstant.ReadData.WithDefaults;
+import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
@@ -141,7 +141,7 @@ public final class ReadDataTransactionUtil {
                 break;
             default:
                 throw new RestconfDocumentedException(
-                    new RestconfError(ErrorType.PROTOCOL, RestconfError.ErrorTag.INVALID_VALUE,
+                    new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
                         "Invalid content parameter: " + contentValue, null,
                         "The content parameter value must be either config, nonconfig or all (default)"));
         }
@@ -153,7 +153,7 @@ public final class ReadDataTransactionUtil {
             if (value == null || value < RestconfDataServiceConstant.ReadData.MIN_DEPTH
                     || value > RestconfDataServiceConstant.ReadData.MAX_DEPTH) {
                 throw new RestconfDocumentedException(
-                        new RestconfError(ErrorType.PROTOCOL, RestconfError.ErrorTag.INVALID_VALUE,
+                        new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
                                 "Invalid depth parameter: " + depth, null,
                                 "The depth parameter must be an integer between 1 and 65535 or \"unbounded\""));
             } else {
@@ -175,8 +175,8 @@ public final class ReadDataTransactionUtil {
             final String str = withDefaults.get(0);
             final WithDefaults val = WithDefaults.forValue(str);
             if (val == null) {
-                throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL,
-                    RestconfError.ErrorTag.INVALID_VALUE, "Invalid with-defaults parameter: " + str, null,
+                throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
+                    "Invalid with-defaults parameter: " + str, null,
                     "The with-defaults parameter must be a string in " + WithDefaults.possibleValues()));
             }
 
@@ -223,7 +223,7 @@ public final class ReadDataTransactionUtil {
                 return readAllData(strategy, path, withDefa, ctx);
             default:
                 throw new RestconfDocumentedException(
-                        new RestconfError(ErrorType.PROTOCOL, RestconfError.ErrorTag.INVALID_VALUE,
+                        new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
                                 "Invalid content parameter: " + valueOfContent, null,
                                 "The content parameter value must be either config, nonconfig or all (default)"));
         }
@@ -259,8 +259,8 @@ public final class ReadDataTransactionUtil {
             case RestconfDataServiceConstant.ReadData.ALL:
                 return readAllData(strategy, path, withDefa, ctx, fields);
             default:
-                throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL,
-                        RestconfError.ErrorTag.INVALID_VALUE, "Invalid content parameter: " + valueOfContent, null,
+                throw new RestconfDocumentedException(new RestconfError(ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE,
+                        "Invalid content parameter: " + valueOfContent, null,
                         "The content parameter value must be either config, nonconfig or all (default)"));
         }
     }
@@ -295,7 +295,7 @@ public final class ReadDataTransactionUtil {
                 .collect(Collectors.toSet());
             throw new RestconfDocumentedException(
                 "Not allowed parameters for " + READ_TYPE_TX + " operation: " + notAllowedParameters,
-                ErrorType.PROTOCOL, RestconfError.ErrorTag.INVALID_VALUE);
+                ErrorType.PROTOCOL, ErrorTag.INVALID_VALUE);
         }
     }