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
8 package org.opendaylight.controller.sal.common.util;
10 import org.opendaylight.yangtools.yang.common.RpcError;
11 import org.opendaylight.yangtools.yang.common.RpcError.ErrorSeverity;
12 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
18 public class RpcErrors {
21 * @param applicationTag
28 * @return {@link RpcError} implementation
30 public static RpcError getRpcError(String applicationTag, String tag, String info,
31 ErrorSeverity severity, String message, ErrorType errorType, Throwable cause) {
32 RpcErrorTO ret = new RpcErrorTO(applicationTag, tag, info, severity, message,
37 private static class RpcErrorTO implements RpcError {
39 private final String applicationTag;
40 private final String tag;
41 private final String info;
42 private final ErrorSeverity severity;
43 private final String message;
44 private final ErrorType errorType;
45 private final Throwable cause;
48 * @param applicationTag
56 protected RpcErrorTO(String applicationTag, String tag, String info,
57 ErrorSeverity severity, String message, ErrorType errorType, Throwable cause) {
59 this.applicationTag = applicationTag;
62 this.severity = severity;
63 this.message = message;
64 this.errorType = errorType;
69 public String getApplicationTag() {
70 return applicationTag;
74 public String getInfo() {
79 public String getMessage() {
84 public ErrorSeverity getSeverity() {
89 public String getTag() {
94 public Throwable getCause() {
99 public ErrorType getErrorType() {