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.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,
26 final ErrorSeverity errorSeverity) {
27 super(message, errorType, errorTag, errorSeverity);
30 public NetconfDocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag,
31 final ErrorSeverity errorSeverity, final Map<String, String> errorInfo) {
32 super(message, errorType, errorTag, errorSeverity, errorInfo);
35 public NetconfDocumentedException(final String message, final Exception cause, final ErrorType errorType,
36 final ErrorTag errorTag, final ErrorSeverity errorSeverity) {
37 super(message, cause, errorType, errorTag, errorSeverity);
40 public NetconfDocumentedException(final String message, final Exception cause, final ErrorType errorType,
41 final ErrorTag errorTag, final ErrorSeverity errorSeverity,
42 final Map<String, String> errorInfo) {
43 super(message, cause, errorType, errorTag, errorSeverity, errorInfo);
46 public NetconfDocumentedException(DocumentedException exception) {
47 super(exception.getMessage(), (Exception) exception.getCause(), exception.getErrorType(),
48 exception.getErrorTag(), exception.getErrorSeverity(), exception.getErrorInfo());
51 public static NetconfDocumentedException fromXMLDocument(Document fromDoc) {
52 return new NetconfDocumentedException(DocumentedException.fromXMLDocument(fromDoc));