2 * ============LICENSE_START========================================================================
3 * ONAP : tr-069-adapter
4 * =================================================================================================
5 * Copyright (C) 2020 CommScope Inc Intellectual Property.
6 * =================================================================================================
7 * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,
8 * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
9 * may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14 * either express or implied. See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ===============LICENSE_END=======================================================================
19 package org.commscope.tr069adapter.vesagent.exception;
\r
24 * @since May 21, 2020
\r
27 public class VesAgentException extends Exception {
\r
28 private static final long serialVersionUID = -3742697051389101875L;
\r
30 private static final String ERRORMSG_PREFIX = "ves-agent";
\r
32 private String[] arguments;
\r
34 private String errorCode;
\r
35 private String message;
\r
37 // index of the error occurred in the given list or in the given file
\r
38 protected int errorIndex = -1;
\r
42 * Constructs a <code>VesOperationException</code> with no detail message.
\r
45 public VesAgentException() {
\r
50 * Constructs a <code>VesOperationException</code> with the specified detail message.
\r
52 * @param s as the details message
\r
54 public VesAgentException(String s) {
\r
58 public VesAgentException(String... args) {
\r
61 setErrorMessage(getErrorMessage());
\r
64 public VesAgentException(String errorCode, String errorMsg) {
\r
66 this.errorCode = errorCode;
\r
67 setErrorMessage(getErrorMessage());
\r
70 public int getErrorIndex() {
\r
74 public void setErrorIndex(int errorIndex) {
\r
75 this.errorIndex = errorIndex;
\r
79 public String getMessage() {
\r
83 private String getErrorMessage() {
\r
84 String key = ERRORMSG_PREFIX + ".";
\r
88 private void setErrorMessage(String message) {
\r
89 this.message = message;
\r
92 public String getErrorCode() {
\r
96 public void setErrorCode(String errorCode) {
\r
97 this.errorCode = errorCode;
\r