Merge "VES Heartbeat and Software Management Feature"
[oam/tr069-adapter.git] / mapper / src / main / java / org / commscope / tr069adapter / mapper / util / ErrorCodeUtil.java
index 13f9a6a..9537f9b 100644 (file)
@@ -30,7 +30,7 @@ import java.util.Map.Entry;
 import javax.annotation.PostConstruct;\r
 \r
 import org.apache.commons.io.FileUtils;\r
-import org.commscope.tr069adapter.mapper.ErrorCodeMetaData;\r
+import org.commscope.tr069adapter.mapper.model.ErrorCodeDetails;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 import org.springframework.stereotype.Component;\r
@@ -38,11 +38,10 @@ import org.springframework.stereotype.Component;
 @Component\r
 public class ErrorCodeUtil {\r
 \r
-\r
   private static final Logger LOG = LoggerFactory.getLogger(ErrorCodeUtil.class);\r
 \r
   private static final String ERROR_CODE_FILE = "error-code-mapping.json";\r
-  private static Map<String, ErrorCodeMetaData> errorCodeMap;\r
+  private static Map<String, ErrorCodeDetails> errorCodeMap;\r
 \r
   @PostConstruct\r
   public static void loadErrorCodeData() {\r
@@ -55,20 +54,20 @@ public class ErrorCodeUtil {
   }\r
 \r
   public void printErrorCodeMap() {\r
-    for (Entry<String, ErrorCodeMetaData> entry : errorCodeMap.entrySet()) {\r
+    for (Entry<String, ErrorCodeDetails> entry : errorCodeMap.entrySet()) {\r
       LOG.debug("KEY= {}", entry.getKey());\r
       LOG.debug("VALUE= {}", entry.getValue());\r
     }\r
   }\r
 \r
-  private static Map<String, ErrorCodeMetaData> getMetaDataAsMap(File file) throws IOException {\r
+  private static Map<String, ErrorCodeDetails> getMetaDataAsMap(File file) throws IOException {\r
 \r
     String json = FileUtils.readFileToString(file, StandardCharsets.UTF_8);\r
 \r
-    Map<String, ErrorCodeMetaData> result = null;\r
+    Map<String, ErrorCodeDetails> result = null;\r
     ObjectMapper mapper = new ObjectMapper();\r
     try {\r
-      result = mapper.readValue(json, new TypeReference<Map<String, ErrorCodeMetaData>>() {});\r
+      result = mapper.readValue(json, new TypeReference<Map<String, ErrorCodeDetails>>() {});\r
     } catch (IOException e) {\r
       LOG.error("IOException while loading device model meta data {}", e.toString());\r
       LOG.error("Exception : {}", e.getMessage());\r
@@ -76,7 +75,7 @@ public class ErrorCodeUtil {
     return result;\r
   }\r
 \r
-  public ErrorCodeMetaData getErrorCodeMetaData(String errorCode) {\r
+  public ErrorCodeDetails getErrorCodeMetaData(String errorCode) {\r
     return errorCodeMap.get(errorCode);\r
   }\r
 \r