2 * Copyright (c) 2013 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
9 package org.opendaylight.controller.netconf.api;
12 import org.opendaylight.controller.config.util.xml.DocumentedException;
13 import org.w3c.dom.Document;
16 * Checked exception to communicate an error that needs to be sent to the
19 public class NetconfDocumentedException extends DocumentedException {
21 public NetconfDocumentedException(final String message) {
25 public NetconfDocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag, final ErrorSeverity errorSeverity) {
26 super(message, errorType, errorTag, errorSeverity);
29 public NetconfDocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag, final ErrorSeverity errorSeverity, final Map<String, String> errorInfo) {
30 super(message, errorType, errorTag, errorSeverity, errorInfo);
33 public NetconfDocumentedException(final String message, final Exception cause, final ErrorType errorType, final ErrorTag errorTag, final ErrorSeverity errorSeverity) {
34 super(message, cause, errorType, errorTag, errorSeverity);
37 public NetconfDocumentedException(final String message, final Exception cause, final ErrorType errorType, final ErrorTag errorTag, final ErrorSeverity errorSeverity, final Map<String, String> errorInfo) {
38 super(message, cause, errorType, errorTag, errorSeverity, errorInfo);
41 public NetconfDocumentedException(DocumentedException e) {
42 super(e.getMessage(), e.getErrorType(), e.getErrorTag(), e.getErrorSeverity(), e.getErrorInfo());
45 public static NetconfDocumentedException fromXMLDocument( Document fromDoc) {
46 return new NetconfDocumentedException(DocumentedException.fromXMLDocument(fromDoc));