X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb-rfc8040%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Frests%2Fservices%2Fimpl%2FRestconfDataServiceImpl.java;h=075fd1a09dcbeab16814071f8a1bc8466d10c7cd;hb=485ad9e9946bf38f9e50033e7e91e0acd9042f0a;hp=de9291627516999edd92e3229f25eb3bc7ccb505;hpb=5defe99f336b51d4e96473aff6de4b9e6af8cb34;p=netconf.git diff --git a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java index de92916275..075fd1a09d 100644 --- a/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java +++ b/restconf/restconf-nb-rfc8040/src/main/java/org/opendaylight/restconf/nb/rfc8040/rests/services/impl/RestconfDataServiceImpl.java @@ -12,7 +12,6 @@ import static org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsCo import static org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsConstants.STREAM_LOCATION_PATH_PART; import static org.opendaylight.restconf.nb.rfc8040.rests.utils.RestconfStreamsConstants.STREAM_PATH; -import com.google.common.base.Optional; import com.google.common.base.Preconditions; import java.time.Clock; import java.time.LocalDateTime; @@ -20,12 +19,13 @@ import java.time.format.DateTimeFormatter; import java.util.List; import java.util.Map.Entry; import java.util.Objects; +import java.util.Optional; import javax.annotation.Nonnull; import javax.ws.rs.Path; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; -import org.opendaylight.controller.md.sal.dom.api.DOMDataBroker; -import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; +import org.opendaylight.mdsal.dom.api.DOMDataBroker; +import org.opendaylight.mdsal.dom.api.DOMMountPoint; import org.opendaylight.restconf.common.context.InstanceIdentifierContext; import org.opendaylight.restconf.common.context.NormalizedNodeContext; import org.opendaylight.restconf.common.context.WriterParameters; @@ -194,7 +194,8 @@ public class RestconfDataServiceImpl implements RestconfDataService { insertUsed = true; insert = entry.getValue().iterator().next(); } else { - throw new RestconfDocumentedException("Insert parameter can be used only once."); + throw new RestconfDocumentedException("Insert parameter can be used only once.", + RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.BAD_ELEMENT); } break; case "point": @@ -202,11 +203,13 @@ public class RestconfDataServiceImpl implements RestconfDataService { pointUsed = true; point = entry.getValue().iterator().next(); } else { - throw new RestconfDocumentedException("Point parameter can be used only once."); + throw new RestconfDocumentedException("Point parameter can be used only once.", + RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.BAD_ELEMENT); } break; default: - throw new RestconfDocumentedException("Bad parameter for post: " + entry.getKey()); + throw new RestconfDocumentedException("Bad parameter for post: " + entry.getKey(), + RestconfError.ErrorType.PROTOCOL, RestconfError.ErrorTag.BAD_ELEMENT); } }