Class AuthTransactionHelper
- java.lang.Object
-
- io.mosip.authentication.common.service.helper.AuthTransactionHelper
-
@Component public class AuthTransactionHelper extends Object
The Class AuthTransactionHelper - the helper to create auth transaction entity- Author:
- Loganathan Sekar
-
-
Constructor Summary
Constructors Constructor Description AuthTransactionHelper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AutnTxnbuildAuthTransactionEntity(AuthTransactionBuilder authTxnBuilder)Builds the auth transaction entity.AuthTransactionBuildercreateAndSetAuthTxnBuilderMetadataToRequest(ObjectWithMetadata requestDTO, boolean isInternal, Optional<PartnerDTO> partner)Creates the and set auth txn builder metadata to request.IdAuthenticationAppExceptioncreateDataValidationException(AuthTransactionBuilder authTxnBuilder, IDDataValidationException e, ObjectWithMetadata targetObjectMetadata)Creates the data validation exception.IdAuthenticationAppExceptioncreateUnableToProcessException(AuthTransactionBuilder authTxnBuilder, IdAuthenticationBusinessException e, ObjectWithMetadata requestWithMetadata)Creates the unable to process exception.static booleanisFaceAuth(AuthRequestDTO authRequestDTO, EnvUtil env)Checks if is face auth.static booleanisFingerAuth(AuthRequestDTO authRequestDTO, EnvUtil env)Checks if is finger auth.static booleanisIrisAuth(AuthRequestDTO authRequestDTO, EnvUtil env)Checks if is iris auth.voidsetAuthTransactionBuilderMetadata(ObjectWithMetadata objectWithMetadata, AuthTransactionBuilder authTxnBuilder)Sets the auth transaction builder metadata.voidsetAuthTransactionEntityMetadata(ObjectWithMetadata objectWithMetadata, AuthTransactionBuilder authTxnBuilder)Sets the auth transaction entity metadata.voidsetAuthTransactionEntityMetadata(IdAuthenticationBaseException exception, AuthTransactionBuilder authTxnBuilder, ObjectWithMetadata targetObjectMetadata)Sets the auth transaction entity metadata.voidsetObjectToMetadata(ObjectWithMetadata objectWithMetadata, String key, Object value)Sets the object to metadata.
-
-
-
Method Detail
-
buildAuthTransactionEntity
public AutnTxn buildAuthTransactionEntity(AuthTransactionBuilder authTxnBuilder) throws IdAuthenticationBusinessException
Builds the auth transaction entity.- Parameters:
authTxnBuilder- the auth txn builder- Returns:
- the autn txn
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
setAuthTransactionBuilderMetadata
public void setAuthTransactionBuilderMetadata(ObjectWithMetadata objectWithMetadata, AuthTransactionBuilder authTxnBuilder)
Sets the auth transaction builder metadata.- Parameters:
objectWithMetadata- the object with metadataauthTxnBuilder- the auth txn builder
-
setAuthTransactionEntityMetadata
public void setAuthTransactionEntityMetadata(IdAuthenticationBaseException exception, AuthTransactionBuilder authTxnBuilder, ObjectWithMetadata targetObjectMetadata) throws IdAuthenticationBusinessException
Sets the auth transaction entity metadata.- Parameters:
exception- the exceptionauthTxnBuilder- the auth txn buildertargetObjectMetadata-- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
setAuthTransactionEntityMetadata
public void setAuthTransactionEntityMetadata(ObjectWithMetadata objectWithMetadata, AuthTransactionBuilder authTxnBuilder) throws IdAuthenticationBusinessException
Sets the auth transaction entity metadata.- Parameters:
objectWithMetadata- the object with metadataauthTxnBuilder- the auth txn builder- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
setObjectToMetadata
public void setObjectToMetadata(ObjectWithMetadata objectWithMetadata, String key, Object value)
Sets the object to metadata.- Parameters:
objectWithMetadata- the object with metadatakey- the keyvalue- the value
-
createAndSetAuthTxnBuilderMetadataToRequest
public AuthTransactionBuilder createAndSetAuthTxnBuilderMetadataToRequest(ObjectWithMetadata requestDTO, boolean isInternal, Optional<PartnerDTO> partner) throws IdAuthenticationBusinessException
Creates the and set auth txn builder metadata to request.- Parameters:
requestDTO- the request DTOisInternal- the is internalpartner- the partner- Returns:
- the auth transaction builder
- Throws:
IdAuthenticationBusinessException- the id authentication business exception
-
createDataValidationException
public IdAuthenticationAppException createDataValidationException(AuthTransactionBuilder authTxnBuilder, IDDataValidationException e, ObjectWithMetadata targetObjectMetadata) throws IdAuthenticationBusinessException, IdAuthenticationAppException
Creates the data validation exception.- Parameters:
authTxnBuilder- the auth txn buildere- the etargetObjectMetadata-- Returns:
- the id authentication app exception
- Throws:
IdAuthenticationBusinessException- the id authentication business exceptionIdAuthenticationAppException- the id authentication app exception
-
createUnableToProcessException
public IdAuthenticationAppException createUnableToProcessException(AuthTransactionBuilder authTxnBuilder, IdAuthenticationBusinessException e, ObjectWithMetadata requestWithMetadata) throws IdAuthenticationBusinessException, IdAuthenticationAppException
Creates the unable to process exception.- Parameters:
authTxnBuilder- the auth txn buildere- the erequestWithMetadata-- Returns:
- the id authentication app exception
- Throws:
IdAuthenticationBusinessException- the id authentication business exceptionIdAuthenticationAppException- the id authentication app exception
-
isFingerAuth
public static boolean isFingerAuth(AuthRequestDTO authRequestDTO, EnvUtil env)
Checks if is finger auth.- Parameters:
authRequestDTO- the auth request DTOenv- the env- Returns:
- true, if is finger auth
-
isIrisAuth
public static boolean isIrisAuth(AuthRequestDTO authRequestDTO, EnvUtil env)
Checks if is iris auth.- Parameters:
authRequestDTO- the auth request DTOenv- the env- Returns:
- true, if is iris auth
-
isFaceAuth
public static boolean isFaceAuth(AuthRequestDTO authRequestDTO, EnvUtil env)
Checks if is face auth.- Parameters:
authRequestDTO- the auth request DTOenv- the env- Returns:
- true, if is face auth
-
-