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 com.google.common.base.Preconditions;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14 * Exception thrown when a proposed change fails validation before being applied into the datastore. This can have
15 * multiple reasons, for example the datastore has been concurrently modified such that a conflicting node is present,
16 * or the modification is structurally incorrect.
18 public class DataValidationFailedException extends Exception {
19 private static final long serialVersionUID = 1L;
21 private final YangInstanceIdentifier path;
24 * Create a new instance.
26 * @param path Object path which caused this exception
27 * @param message Specific message describing the failure
29 public DataValidationFailedException(final YangInstanceIdentifier path, final String message) {
30 this(path, message, null);
34 * Create a new instance, initializing the cause.
36 * @param path Object path which caused this exception
37 * @param message Specific message describing the failure
38 * @param cause Exception which triggered this failure, may be null
40 public DataValidationFailedException(final YangInstanceIdentifier path, final String message,
41 final Throwable cause) {
42 super(message, cause);
43 this.path = Preconditions.checkNotNull(path);
47 * Returns the offending object path.
49 * @return Path of the offending object
51 public YangInstanceIdentifier getPath() {