2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.data.api.schema.tree;
10 import static java.util.Objects.requireNonNull;
12 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
15 * Exception thrown when a proposed change fails validation before being applied into the datastore. This can have
16 * multiple reasons, for example the datastore has been concurrently modified such that a conflicting node is present,
17 * or the modification is structurally incorrect.
19 public class DataValidationFailedException extends Exception {
20 private static final long serialVersionUID = 1L;
22 private final YangInstanceIdentifier path;
25 * Create a new instance.
27 * @param path Object path which caused this exception
28 * @param message Specific message describing the failure
30 public DataValidationFailedException(final YangInstanceIdentifier path, final String message) {
31 this(path, message, null);
35 * Create a new instance, initializing the cause.
37 * @param path Object path which caused this exception
38 * @param message Specific message describing the failure
39 * @param cause Exception which triggered this failure, may be null
41 public DataValidationFailedException(final YangInstanceIdentifier path, final String message,
42 final Throwable cause) {
43 super(message, cause);
44 this.path = requireNonNull(path);
48 * Returns the offending object path.
50 * @return Path of the offending object
52 public YangInstanceIdentifier getPath() {