Skip to content

Commit

Permalink
[MOSIP-33145] (#131)
Browse files Browse the repository at this point in the history
* [MOSIP-33145]

Signed-off-by: JanardhanBS-SyncByte <janardhan@syncbyte.in>

* [MOSIP-33145]

Signed-off-by: JanardhanBS-SyncByte <janardhan@syncbyte.in>

* [MOSIP-33145]

Signed-off-by: JanardhanBS-SyncByte <janardhan@syncbyte.in>

---------

Signed-off-by: JanardhanBS-SyncByte <janardhan@syncbyte.in>
  • Loading branch information
JanardhanBS-SyncByte committed May 24, 2024
1 parent a4df9f7 commit 89df79d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package io.mosip.biosdk.services.constants;

public class AppConstants {
public static final String LOGGER_SESSIONID = "BIO-SDK-PROVIDER";
public static final String LOGGER_IDTYPE = "REGISTRATION / AUTH";
}
private AppConstants() {
throw new IllegalStateException("AppConstants class");
}

public static final String LOGGER_SESSIONID = "BIO-SDK-PROVIDER";
public static final String LOGGER_IDTYPE = "REGISTRATION / AUTH";
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
import io.mosip.kernel.core.logger.spi.Logger;

@Component
public class BioSdkServiceProviderImpl_V_1_0 implements BioSdkServiceProvider {
public class BioSdkServiceProviderImpl_V_1_0 // NOSONAR
implements BioSdkServiceProvider {

private Logger logger = LoggerConfig.logConfig(BioSdkServiceProviderImpl_V_1_0.class);

private static final String BIOSDK_SERVICE_SPEC_VERSION = "1.0";
private static final String INIT = "init";
private static final String CHECK_QUALITY = "checkQuality";
private static final String EXTRACT_TEMPLATE = "extractTemplate";
private static final String EXTRACT_TEMPLATE = "extractTemplate";
private static final String MATCH = "match";
private static final String SEGMENT = "segment";
private static final String CONVERT_FORMAT = "convertFormat";
Expand All @@ -57,7 +58,7 @@ public BioSdkServiceProviderImpl_V_1_0(IBioApiV2 iBioApi, Utils utils) {
this.utils = utils;
gson = new GsonBuilder().serializeNulls().create();
}

@Override
public String getSpecVersion() {
return BIOSDK_SERVICE_SPEC_VERSION;
Expand Down Expand Up @@ -188,7 +189,8 @@ public Object convertFormat(RequestDto request) {

private void logRequest(ExtractTemplateRequestDto extractTemplateRequestDto) {
if (isLogRequestResponse) {
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST::ExtractTemplateRequestDto", utils.toString(extractTemplateRequestDto));
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST::ExtractTemplateRequestDto",
utils.toString(extractTemplateRequestDto));
}
}

Expand All @@ -206,19 +208,22 @@ private void logRequest(InitRequestDto initRequestDto) {

private void logRequest(CheckQualityRequestDto checkQualityRequestDto) {
if (isLogRequestResponse) {
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST:: CheckQualityRequestDto", utils.toString(checkQualityRequestDto));
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST:: CheckQualityRequestDto",
utils.toString(checkQualityRequestDto));
}
}

private void logRequest(SegmentRequestDto segmentRequestDto) {
if (isLogRequestResponse) {
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST:: SegmentRequestDto", utils.toString(segmentRequestDto));
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST:: SegmentRequestDto",
utils.toString(segmentRequestDto));
}
}

private void logRequest(ConvertFormatRequestDto convertFormatRequestDto) {
if (isLogRequestResponse) {
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST:: ConvertFormatRequestDto", utils.toString(convertFormatRequestDto));
logger.debug(LOGGER_SESSIONID, LOGGER_IDTYPE, "REQUEST:: ConvertFormatRequestDto",
utils.toString(convertFormatRequestDto));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ public enum ErrorCode {

NO_PROVIDERS("BIO_SDK_001", "No Bio SDK service provider implementations found for given version");

private String errorCode;
private String errorCode; // NOSONAR
private String errorMessage;

ErrorCode(String errorCode, String errorMessage) {
Expand Down

0 comments on commit 89df79d

Please sign in to comment.