01c926e31b9c1cf8b72859b31aa215b564db736e
[oam/tr069-adapter.git] / mapper / src / main / java / org / commscope / tr069adapter / mapper / util / FirwareUpgradeErrorCode.java
1 /*
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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=======================================================================
17  */
18
19 package org.commscope.tr069adapter.mapper.util;\r
20 \r
21 import java.util.HashMap;\r
22 import java.util.Map;\r
23 \r
24 public class FirwareUpgradeErrorCode {\r
25   private static Map<Integer, String> ErrorCodes = new HashMap<Integer, String>();;\r
26 \r
27   static {\r
28     ErrorCodes.put(9019, "AUTHENTICATION_ERROR");\r
29     ErrorCodes.put(9001, "AUTHENTICATION_ERROR");\r
30     ErrorCodes.put(9016, "AUTHENTICATION_ERROR");\r
31     ErrorCodes.put(9012, "AUTHENTICATION_ERROR");\r
32     ErrorCodes.put(9015, "PROTOCOL_ERROR");\r
33     ErrorCodes.put(9002, "APPLICATION_ERROR");\r
34     ErrorCodes.put(9003, "APPLICATION_ERROR");\r
35     ErrorCodes.put(9020, "TIMEOUT");\r
36     ErrorCodes.put(0, "COMPLETED");\r
37   }\r
38 \r
39   public static String getErrorCodeMapping(int errorCode) {\r
40     return ErrorCodes.get(errorCode) != null ? ErrorCodes.get(errorCode) : "APPLICATION_ERROR";\r
41   }\r
42 \r
43 }\r