Skip to content

Commit

Permalink
merged from upstream
Browse files Browse the repository at this point in the history
Signed-off-by: Sowmya Ujjappa Banakar <[email protected]>
  • Loading branch information
Sowmya Ujjappa Banakar committed Feb 8, 2024
2 parents bb824b9 + f41f099 commit a05eecc
Show file tree
Hide file tree
Showing 10 changed files with 0 additions and 236 deletions.
Empty file removed pom.xml
Empty file.
21 changes: 0 additions & 21 deletions registration-processor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,6 @@
</developer>
</developers>

<licenses>
<license>
<name>MPL 2.0</name>
<url>https://www.mozilla.org/en-US/MPL/2.0/</url>
</license>
</licenses>
<scm>
<connection>scm:git:git://github.com/mosip/registration.git</connection>
<developerConnection>scm:git:ssh://github.com:mosip/registration.git</developerConnection>
<url>https://github.com/mosip/registration</url>
<tag>HEAD</tag>
</scm>
<developers>
<developer>
<name>Mosip</name>
<email>[email protected]</email>
<organization>io.mosip</organization>
<organizationUrl>https://github.com/mosip/registration</organizationUrl>
</developer>
</developers>

<groupId>io.mosip.registrationprocessor</groupId>
<artifactId>registration-processor</artifactId>
<version>1.2.1-SNAPSHOT</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@ ENV artifactory_url_env=${artifactory_url}
# change volume to whichever storage directory you want to use for this container.
VOLUME /home/logs

<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/Dockerfile-not-used
COPY ./target/registration-processor-credential-requestor-stage-*.jar registration-processor-credential-requestor-stage.jar
========
COPY ./target/registration-processor-printing-stage-*.jar registration-processor-printing-stage.jar
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/Dockerfile-not-used

CMD if [ "$is_glowroot_env" = "present" ]; then \
wget "${artifactory_url_env}"/artifactory/libs-release-local/io/mosip/testing/glowroot.zip ; \
apt-get update && apt-get install -y unzip ; \
unzip glowroot.zip ; \
rm -rf glowroot.zip ; \

<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/Dockerfile-not-used
sed -i 's/<service_name>/registration-processor-credential-requestor-stage/g' glowroot/glowroot.properties ; \
java -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar -javaagent:glowroot/glowroot.jar registration-processor-credential-requestor-stage.jar ; \
else \
Expand All @@ -57,14 +52,4 @@ CMD if [ "$is_glowroot_env" = "present" ]; then \


#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-credential-requestor-stage.jar"]
========
sed -i 's/<service_name>/registration-processor-printing-stage/g' glowroot/glowroot.properties ; \
java -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar -javaagent:glowroot/glowroot.jar registration-processor-printing-stage.jar ; \
else \
java -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -jar registration-processor-printing-stage.jar ; \
fi


#CMD ["java","-Dspring.cloud.config.label=${spring_config_label_env}","-Dspring.profiles.active=${active_profile_env}","-Dspring.cloud.config.uri=${spring_config_url_env}","-jar","registration-processor-printing-stage.jar"]
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/Dockerfile-not-used

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
<artifactId>post-processor</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/pom.xml
<artifactId>registration-processor-credential-requestor-stage</artifactId>
========
<artifactId>registration-processor-event-handler-stage</artifactId>
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/pom.xml
<version>1.2.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/CredentialRequestorStageApplication.java
package io.mosip.registration.processor.credentialrequestor;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import io.mosip.registration.processor.credentialrequestor.stage.CredentialRequestorStage;
========
package io.mosip.registration.processor.eventhandler;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import io.mosip.registration.processor.eventhandler.stage.EventHandlerStage;
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/EventHandlerStageApplication.java

/**
* @author M1048399
*
*/
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/CredentialRequestorStageApplication.java
public class CredentialRequestorStageApplication {
========
public class EventHandlerStageApplication {
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/EventHandlerStageApplication.java

public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
Expand All @@ -31,11 +19,7 @@ public static void main(String[] args) {
"io.mosip.registration.processor.packet.storage.config");
ctx.refresh();

<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/CredentialRequestorStageApplication.java
CredentialRequestorStage printStage = ctx.getBean(CredentialRequestorStage.class);
========
EventHandlerStage printStage = ctx.getBean(EventHandlerStage.class);
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/EventHandlerStageApplication.java
printStage.deployVerticle();

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java
package io.mosip.registration.processor.credentialrequestor.stage;
========
package io.mosip.registration.processor.eventhandler.stage;
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/EventHandlerStage.java

import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.kernel.core.exception.BaseUncheckedException;
Expand Down Expand Up @@ -35,11 +31,6 @@ >>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):
import io.mosip.registration.processor.credentialrequestor.stage.exception.VidNotAvailableException;
import io.mosip.registration.processor.credentialrequestor.util.CredentialPartnerUtil;
import io.mosip.registration.processor.packet.storage.utils.Utilities;
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java
========
import io.mosip.registration.processor.eventhandler.stage.exception.VidNotAvailableException;
import io.mosip.registration.processor.eventhandler.util.CredentialPartnerUtil;
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/EventHandlerStage.java
import io.mosip.registration.processor.rest.client.audit.builder.AuditLogRequestBuilder;
import io.mosip.registration.processor.status.code.RegistrationStatusCode;
import io.mosip.registration.processor.status.dto.InternalRegistrationStatusDto;
Expand Down Expand Up @@ -83,35 +74,23 @@ >>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):
@ComponentScan(basePackages = { "${mosip.auth.adapter.impl.basepackage}",
"io.mosip.registration.processor.core.config",
"io.mosip.registration.processor.stages.config",
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java
"io.mosip.registration.processor.credentialrequestor.config",
========
"io.mosip.registration.processor.eventhandler.config",
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/EventHandlerStage.java
"io.mosip.registrationprocessor.stages.config",
"io.mosip.registration.processor.status.config",
"io.mosip.registration.processor.rest.client.config",
"io.mosip.registration.processor.packet.storage.config",
"io.mosip.registration.processor.packet.manager.config",
"io.mosip.kernel.idobjectvalidator.config",
"io.mosip.registration.processor.core.kernel.beans" })
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java
public class CredentialRequestorStage extends MosipVerticleAPIManager {
========
public class EventHandlerStage extends MosipVerticleAPIManager {
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/EventHandlerStage.java

private static final String STAGE_PROPERTY_PREFIX = "mosip.regproc.credentialrequestor.";
private Random sr = null;
private static final int max = 999999;
private static final int min = 100000;

/** The reg proc logger. */
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java
private static Logger regProcLogger = RegProcessorLogger.getLogger(CredentialRequestorStage.class);
========
private static Logger regProcLogger = RegProcessorLogger.getLogger(EventHandlerStage.class);
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/EventHandlerStage.java

/** The cluster manager url. */
@Value("${vertx.cluster.configuration}")
Expand Down Expand Up @@ -162,9 +141,6 @@ >>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):
@Value("#{T(java.util.Arrays).asList('${mosip.registration.processor.credential.default.partner-ids:}')}")
private List<String> defaultPartners;

@Value("${mosip.registration.processor.opencrvs.credential.additionalparams}")
private String opencrvsAdditionalParam;

private static String COMMA = ",";
private static String HASH_DELIMITER = "#";

Expand Down Expand Up @@ -404,27 +380,11 @@ private void getAdditionalCredentialFields(String regId, String process,
}
}

<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/CredentialRequestorStage.java
} catch (Exception e) {
regProcLogger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(),
regId, RegistrationStatusCode.FAILED + e.getMessage() + ExceptionUtils.getStackTrace(e));
throw new BaseUncheckedException(PlatformErrorMessages.RPR_PRT_PARSING_ADDITIONAL_CRED_CONFIG.getCode(),
PlatformErrorMessages.RPR_PRT_PARSING_ADDITIONAL_CRED_CONFIG.getMessage(), e);
========
private String getCrvsField(String regId, String process, String additionalAttr){
try {
Map<String,String> metaInfo = utilities.getPacketManagerService().getMetaInfo(regId, process, ProviderStageName.EVENT_HANDLER);
JSONArray metadata = new JSONArray(metaInfo.get("metaData"));
for(int i=0;i<metadata.length();i++){
if(metadata.getJSONObject(i).getString("label").equalsIgnoreCase(additionalAttr)){
regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), regId, "OpencrvsBRN obtained.");
return metadata.getJSONObject(i).getString("value");
}
}
} catch (Exception e){
regProcLogger.warn(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), regId, "Failed opencrvsBRN obtained. Exception: " + org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace(e));
return null;
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/EventHandlerStage.java
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/stage/exception/VidNotAvailableException.java
package io.mosip.registration.processor.credentialrequestor.stage.exception;
========
package io.mosip.registration.processor.eventhandler.stage.exception;
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/stage/exception/VidNotAvailableException.java

import io.mosip.kernel.core.exception.BaseCheckedException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/util/CredentialPartnerUtil.java
package io.mosip.registration.processor.credentialrequestor.util;
========
package io.mosip.registration.processor.eventhandler.util;
>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/util/CredentialPartnerUtil.java

import com.fasterxml.jackson.databind.ObjectMapper;
import io.mosip.kernel.core.exception.BaseCheckedException;
Expand Down Expand Up @@ -86,69 +82,6 @@ public class CredentialPartnerUtil {
*/
private List<String> requiredIdObjectFieldNames;

<<<<<<<< HEAD:registration-processor/post-processor/registration-processor-credential-requestor-stage/src/main/java/io/mosip/registration/processor/credentialrequestor/util/CredentialPartnerUtil.java
========
public List<String> getCredentialPartners(String regId, String registrationType, JSONObject identity) throws PacketManagerException, JSONException, ApisResourceAccessException, IOException, JsonProcessingException {

regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(),
regId, "CredentialPartnerUtil::getCredentialPartners()::entry");

List<String> filteredPartners = new ArrayList<>();
if (credentialPartnerExpression == null || credentialPartnerExpression.isEmpty()) {
regProcLogger.debug(LoggerFileConstant.SESSIONID.toString(),
LoggerFileConstant.REGISTRATIONID.toString(), regId,
PlatformErrorMessages.RPR_PRT_ISSUER_NOT_FOUND_IN_PROPERTY.name());
return filteredPartners;
}

Map<String, String> identityFieldValueMap = utilities.getPacketManagerService().getFields(regId,
requiredIdObjectFieldNames, registrationType, ProviderStageName.EVENT_HANDLER);

Map<String, Object> context = new HashMap<>();
for (Map.Entry<String, String> identityAttribute: identityFieldValueMap.entrySet()) {
JSONObject attributeObject = new JSONObject(identityFieldValueMap);
try {
JSONParser parser = new JSONParser();
Object obj = parser.parse((String)attributeObject.get(identityAttribute.getKey()));
if (obj instanceof org.json.simple.JSONArray) {
org.json.simple.JSONArray attributeArray = (org.json.simple.JSONArray) obj;
for (int i = 0; i < attributeArray.size(); i++) {
JSONObject jsonObject = (JSONObject) attributeArray.get(i);
if (mandatoryLanguages.get(0).equalsIgnoreCase((String) jsonObject.get(LANGUAGE))) {
context.put(identityAttribute.getKey(), jsonObject.get(VALUE_LABEL));
}
}
} else {
if (obj != null) {
context.put(identityAttribute.getKey(), obj.toString());
}
}
} catch (org.json.simple.parser.ParseException e) {
regProcLogger.error(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(), "",
ExceptionUtils.getStackTrace(e));
throw new ParsingException(PlatformErrorMessages.RPR_BDD_JSON_PARSING_EXCEPTION.getCode(), e);
}
}

regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(),
regId, "CredentialPartnerUtil::CredentialPartnerExpression::" + credentialPartnerExpression.toString());

for(Map.Entry<String, String> entry : credentialPartnerExpression.entrySet()) {
Boolean result = (Boolean) MVEL.eval(entry.getValue(), context);
if (result) {
filteredPartners.add(entry.getKey());
}
}
if (StringUtils.hasText(noMatchIssuer) && filteredPartners.isEmpty()) {
filteredPartners.add(noMatchIssuer);
}
regProcLogger.info(LoggerFileConstant.SESSIONID.toString(), LoggerFileConstant.REGISTRATIONID.toString(),
regId, "CredentialPartnerUtil::FilteredPartners::" + filteredPartners.toString());

return filteredPartners;
}

>>>>>>>> df41852ca05 (MOSIP-28121 : renamed print stage to event handler stage):registration-processor/post-processor/registration-processor-event-handler-stage/src/main/java/io/mosip/registration/processor/eventhandler/util/CredentialPartnerUtil.java
@PostConstruct
private void getIdObjectFieldNames() throws BaseCheckedException {
regProcLogger.info( "CredentialPartnerUtil::getIdObjectFieldNames()::PostConstruct");
Expand Down
Loading

0 comments on commit a05eecc

Please sign in to comment.