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;
27 public class VesAgentException extends Exception {
28 private static final long serialVersionUID = -3742697051389101875L;
30 private static final String ERRORMSG_PREFIX = "ves-agent";
33 private String errorCode;
34 private String message;
36 // index of the error occurred in the given list or in the given file
37 protected int errorIndex = -1;
41 * Constructs a <code>VesOperationException</code> with no detail message.
44 public VesAgentException() {
49 * Constructs a <code>VesOperationException</code> with the specified detail message.
51 * @param s as the details message
53 public VesAgentException(String s) {
57 public VesAgentException(String... args) {
59 setErrorMessage(getErrorMessage());
62 public VesAgentException(String errorCode, String errorMsg) {
64 this.errorCode = errorCode;
65 setErrorMessage(getErrorMessage());
68 public int getErrorIndex() {
72 public void setErrorIndex(int errorIndex) {
73 this.errorIndex = errorIndex;
77 public String getMessage() {
81 private String getErrorMessage() {
82 return ERRORMSG_PREFIX + ".";
85 private void setErrorMessage(String message) {
86 this.message = message;
89 public String getErrorCode() {
93 public void setErrorCode(String errorCode) {
94 this.errorCode = errorCode;