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.common.api.data;
10 import org.opendaylight.yangtools.concepts.Path;
12 import com.google.common.base.Preconditions;
16 * Failure of asynchronous transaction commit caused by invalid data.
18 * This exception is raised and returned when transaction commit
19 * failed, because other data submitted via transactions
21 * Clients usually are not able recover from this error condition by
22 * retrieving same transaction, since data introduced by this transaction
26 public class DataValidationFailedException extends TransactionCommitFailedException {
28 private static final long serialVersionUID = 1L;
32 private Class<? extends Path<?>> pathType;
34 public <P extends Path<P>> DataValidationFailedException(final Class<P> pathType,final P path, final String message, final Throwable cause) {
35 super(message, cause);
36 this.pathType = Preconditions.checkNotNull(pathType, "path type must not be null");
37 this.path = Preconditions.checkNotNull(path,"path must not be null.");
40 public <P extends Path<P>> DataValidationFailedException(final Class<P> pathType,final P path,final String message) {
41 this(pathType,path,message,null);
44 public final Path<?> getPath() {
48 public final Class<? extends Path<?>> getPathType() {