VES Heartbeat and Software Management Feature
[oam/tr069-adapter.git] / common / src / main / java / org / commscope / tr069adapter / common / scheduler / SchedulerError.java
1 /*\r
2  * ============LICENSE_START========================================================================\r
3  * ONAP : tr-069-adapter\r
4  * =================================================================================================\r
5  * Copyright (C) 2020 CommScope Inc Intellectual Property.\r
6  * =================================================================================================\r
7  * This tr-069-adapter software file is distributed by CommScope Inc under the Apache License,\r
8  * Version 2.0 (the "License"); you may not use this file except in compliance with the License. You\r
9  * may obtain a copy of the License at\r
10  *\r
11  * http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\r
14  * either express or implied. See the License for the specific language governing permissions and\r
15  * limitations under the License.\r
16  * ===============LICENSE_END=======================================================================\r
17  */\r
18 \r
19 package org.commscope.tr069adapter.common.scheduler;\r
20 \r
21 public enum SchedulerError {\r
22 \r
23   INVALID_STARTDATE("QRTZ_01", "Given date is past date",\r
24       "Please provide a future date"), INVALID_TIME_INTERVAL("QRTZ_02",\r
25           "Invalid provided is zero or negative",\r
26           "Provide positive interval"), INVALID_ENDDATE("QRTZ_03", "Given date is past date",\r
27               "Please provide a future date"), UNKNOWN_ERROR("QRTZ_04", "Unexpected Exception",\r
28                   "Please see the system logs for more details."), INVALID_CRON_EXPRESSION(\r
29                       "QRTZ_05", "Not a valid cron expression",\r
30                       "Please provide valid cron expression for schedule"), SCHEDULE_DOES_NOT_EXIST(\r
31                           "QRTZ_06", "Schedule name provided does not exist",\r
32                           "Please provide a valid schedule name"), SCHEDULE_EXIST_ALREADY("QRTZ_07",\r
33                               "Schedule name provided is already exist in the system",\r
34                               "Please modify the existing or add new job with different name."), JOB_EXECUTION_ERROR(\r
35                                   "QRTZ_08", "Unexepcted exeception while executing the job",\r
36                                   "Please look in to system logs for more information"), DATABASE_ERROR(\r
37                                       "QRTZ_09", "There database problem with Sheduling",\r
38                                       "please see the logs for more information"), INVALID_CONFIG(\r
39                                           "QRTZ_10",\r
40                                           "There is some problem with Quartz scheduler configuration.",\r
41                                           "Please look in to system logs for more information "), INTERRUPT_ERROR(\r
42                                               "QRTZ_11", "Not able to interrupt the running job",\r
43                                               "Please look in  to system logs for more information");\r
44 \r
45 \r
46   private String errorCode;\r
47   private String errorDescription;\r
48   private String resolution;\r
49 \r
50   SchedulerError(String errorCode, String errorDescription, String resolution) {\r
51     this.errorCode = errorCode;\r
52     this.errorDescription = errorDescription;\r
53     this.resolution = resolution;\r
54   }\r
55 \r
56   public String getErrorCode() {\r
57     return errorCode;\r
58   }\r
59 \r
60   public String getErrorMessage() {\r
61     return errorDescription;\r
62   }\r
63 \r
64   public String getResolution() {\r
65     return resolution;\r
66   }\r
67 \r
68   @Override\r
69   public String toString() {\r
70     StringBuilder str =\r
71         new StringBuilder("**********************************************************\n");\r
72     str.append("* Error Code : " + errorCode + " *\n");\r
73     str.append("* Error : " + errorDescription + " *\n");\r
74     str.append("* Resolution : " + resolution + " *\n");\r
75     str.append("**********************************************************");\r
76     return str.toString();\r
77   }\r
78 \r
79 }\r