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;
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;
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":
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);
}
}