diff --git a/registration-processor/core-processor/registration-processor-abis/Dockerfile b/registration-processor/core-processor/registration-processor-abis/Dockerfile index ee5b26edf18..f05538e215d 100644 --- a/registration-processor/core-processor/registration-processor-abis/Dockerfile +++ b/registration-processor/core-processor/registration-processor-abis/Dockerfile @@ -1,5 +1,14 @@ FROM openjdk:11 +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + #Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image #FROM openjdk:8-jdk-alpine diff --git a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java index 63c05ac64ac..8e98f9614a4 100644 --- a/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java +++ b/registration-processor/core-processor/registration-processor-uin-generator-stage/src/main/java/io/mosip/registration/processor/stages/uingenerator/stage/UinGeneratorStage.java @@ -463,35 +463,48 @@ public MessageDTO process(MessageDTO object) { return object; } - private void loadDemographicIdentity(Map fieldMap, JSONObject demographicIdentity) throws IOException, JSONException { - for (Map.Entry e : fieldMap.entrySet()) { - if (e.getValue() != null) { - String value = e.getValue().toString(); - if (value != null) { - Object json = new JSONTokener(value).nextValue(); - if (json instanceof org.json.JSONObject) { - HashMap hashMap = objectMapper.readValue(value, HashMap.class); - demographicIdentity.putIfAbsent(e.getKey(), hashMap); - } - else if (json instanceof JSONArray) { - List jsonList = new ArrayList<>(); - JSONArray jsonArray = new JSONArray(value); - for (int i = 0; i < jsonArray.length(); i++) { - Object obj = jsonArray.get(i); - HashMap hashMap = objectMapper.readValue(obj.toString(), HashMap.class); - if(trimWhitespaces && hashMap.get("value") instanceof String) { - hashMap.put("value",((String)hashMap.get("value")).trim()); - } - jsonList.add(hashMap); - } - demographicIdentity.putIfAbsent(e.getKey(), jsonList); - } else - demographicIdentity.putIfAbsent(e.getKey(), value); - } else - demographicIdentity.putIfAbsent(e.getKey(), value); - } - } - } + private void loadDemographicIdentity(Map fieldMap, JSONObject demographicIdentity) throws IOException, JSONException { + for (Map.Entry e : fieldMap.entrySet()) { + if (e.getValue() == null) { + continue; + } + + String value = e.getValue().toString(); + if (value == null) { + demographicIdentity.putIfAbsent(e.getKey(), value); + continue; + } + + Object json = new JSONTokener(value).nextValue(); + if (json instanceof org.json.JSONObject) { + HashMap hashMap = objectMapper.readValue(value, HashMap.class); + demographicIdentity.putIfAbsent(e.getKey(), hashMap); + continue; + } + + if (json instanceof JSONArray) { + List jsonList = new ArrayList<>(); + JSONArray jsonArray = new JSONArray(value); + for (int i = 0; i < jsonArray.length(); i++) { + Object obj = jsonArray.get(i); + if (obj instanceof String) { + jsonList.add(obj); + } else { + HashMap hashMap = objectMapper.readValue(obj.toString(), HashMap.class); + + if (trimWhitespaces && hashMap.containsKey("value") && hashMap.get("value") instanceof String) { + hashMap.put("value", ((String) hashMap.get("value")).trim()); + } + jsonList.add(hashMap); + } + } + demographicIdentity.putIfAbsent(e.getKey(), jsonList); + } + else { + demographicIdentity.putIfAbsent(e.getKey(), value); + } + } + } /** * Send id repo with uin. diff --git a/registration-processor/init/registration-processor-dmz-packet-server/Dockerfile b/registration-processor/init/registration-processor-dmz-packet-server/Dockerfile index a0ded0a963d..731559d732f 100644 --- a/registration-processor/init/registration-processor-dmz-packet-server/Dockerfile +++ b/registration-processor/init/registration-processor-dmz-packet-server/Dockerfile @@ -1,5 +1,14 @@ FROM nginx +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + VOLUME /home/mosip COPY nginx.conf /etc/nginx/nginx.conf diff --git a/registration-processor/init/registration-processor-registration-status-service/Dockerfile b/registration-processor/init/registration-processor-registration-status-service/Dockerfile index 6f4b8b88b67..5d1c142e1c0 100644 --- a/registration-processor/init/registration-processor-registration-status-service/Dockerfile +++ b/registration-processor/init/registration-processor-registration-status-service/Dockerfile @@ -1,5 +1,14 @@ FROM openjdk:11 +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + #Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image #FROM openjdk:8-jdk-alpine diff --git a/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile b/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile index 1d6dfc2031a..f4f55286b62 100644 --- a/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile +++ b/registration-processor/post-processor/registration-processor-registration-transaction-service/Dockerfile @@ -1,5 +1,14 @@ FROM openjdk:11 +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + #Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image #FROM openjdk:8-jdk-alpine diff --git a/registration-processor/registration-processor-landing-zone/Dockerfile b/registration-processor/registration-processor-landing-zone/Dockerfile index b9e4a372aab..4e73ab57719 100644 --- a/registration-processor/registration-processor-landing-zone/Dockerfile +++ b/registration-processor/registration-processor-landing-zone/Dockerfile @@ -1,5 +1,14 @@ FROM openjdk:11 +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + #Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image #FROM openjdk:8-jdk-alpine diff --git a/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile b/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile index 2585338e371..8cc6ea1b3a8 100644 --- a/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile +++ b/registration-processor/workflow-engine/registration-processor-reprocessor/Dockerfile @@ -1,5 +1,14 @@ FROM openjdk:11 +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + #Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image #FROM openjdk:8-jdk-alpine diff --git a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile index 869902c1ee6..cdeafeb63a7 100644 --- a/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile +++ b/registration-processor/workflow-engine/registration-processor-workflow-manager-service/Dockerfile @@ -1,5 +1,14 @@ FROM openjdk:11 +ARG SOURCE +ARG COMMIT_HASH +ARG COMMIT_ID +ARG BUILD_TIME +LABEL source=${SOURCE} +LABEL commit_hash=${COMMIT_HASH} +LABEL commit_id=${COMMIT_ID} +LABEL build_time=${BUILD_TIME} + #Uncomment below and Comment above line(i.e. FROM openjdk:8) for OS specific (e.g. Alpine OS ) docker base image #FROM openjdk:8-jdk-alpine