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.controller.md.sal.dom.store.impl.tree;
10 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
12 import com.google.common.base.Preconditions;
15 * Exception thrown when a proposed change fails validation before being
16 * applied into the datastore. This can have multiple reasons, for example
17 * the datastore has been concurrently modified such that a conflicting
18 * node is present, or the modification is structurally incorrect.
20 public class DataValidationFailedException extends Exception {
21 private static final long serialVersionUID = 1L;
22 private final InstanceIdentifier 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 InstanceIdentifier path, final String message) {
31 this(path, message, null);
34 * Create a new instance, initializing
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 InstanceIdentifier path, final String message, final Throwable cause) {
41 super(message, cause);
42 this.path = Preconditions.checkNotNull(path);
46 * Returns the offending object path.
48 * @return Path of the offending object
50 public InstanceIdentifier getPath() {