Remove netconf from commons/opendaylight pom
[controller.git] / opendaylight / netconf / netconf-api / src / main / java / org / opendaylight / controller / netconf / api / NetconfDocumentedException.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 package org.opendaylight.controller.netconf.api;
10
11 import java.util.Map;
12 import org.opendaylight.controller.config.util.xml.DocumentedException;
13 import org.w3c.dom.Document;
14
15 /**
16  * Checked exception to communicate an error that needs to be sent to the
17  * netconf client.
18  */
19 public class NetconfDocumentedException extends DocumentedException {
20
21     public NetconfDocumentedException(final String message) {
22         super(message);
23     }
24
25     public NetconfDocumentedException(final String message, final ErrorType errorType, final ErrorTag errorTag, final ErrorSeverity errorSeverity) {
26         super(message, errorType, errorTag, errorSeverity);
27     }
28
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);
31     }
32
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);
35     }
36
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);
39     }
40
41     public NetconfDocumentedException(DocumentedException e) {
42         super(e.getMessage(), e.getErrorType(), e.getErrorTag(), e.getErrorSeverity(), e.getErrorInfo());
43     }
44
45     public static NetconfDocumentedException fromXMLDocument( Document fromDoc) {
46         return new NetconfDocumentedException(DocumentedException.fromXMLDocument(fromDoc));
47     }
48 }