Package com.skava.service.impl
Class UserAuthValidateNotificationServiceImpl
java.lang.Object
com.skava.service.impl.UserAuthValidateNotificationServiceImpl
- All Implemented Interfaces:
com.skava.core.EcommService<UserNotificationRequest,
,UsersResponse> UserAuthValidateNotificationService
@Service
@Transactional(noRollbackFor=java.lang.Exception.class)
public class UserAuthValidateNotificationServiceImpl
extends Object
implements UserAuthValidateNotificationService
This service class implements UserAuthValidateNotificationService and handles the notification validation service
request, process it and save the details in DB. It also implements business logic required to validate the
notification request.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkParamExpired
(String locale, String[] valueFromDB, long collectionId) Used to check whether the notification param is expired or not.void
checkParamsMatched
(String locale, String[] valueFromDB, String[] valueFromRequest) Used to check whether the notification param is matched or not.getUserProperty
(String locale, long userId, String name) Used to gets the user notification property from DB for the requested user.List<com.skava.core.validation.ValidatorComponent>
This method is used to get the respective validator class for this user auth validate notification service.methodFallback
(UserNotificationRequest request) Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly.process
(UserNotificationRequest request) This service is used to authenticate an user action like Add to cart, Checkout, Update password etc. by validating the password sent to user Email / SMS at the time of placing the request.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.skava.core.EcommService
getValidateException, getValidator
-
Constructor Details
-
UserAuthValidateNotificationServiceImpl
public UserAuthValidateNotificationServiceImpl()Default Constructor
-
-
Method Details
-
process
@SendEvent(eventType="userservice/usernotification/patch", identifier="response_users.id") @HystrixCommand(commandKey="user-key", fallbackMethod="methodFallback", ignoreExceptions={com.skava.core.validation.ValidateException.class,java.lang.IllegalArgumentException.class,java.lang.IllegalStateException.class}) public UsersResponse process(UserNotificationRequest request) This service is used to authenticate an user action like Add to cart, Checkout, Update password etc. by validating the password sent to user Email / SMS at the time of placing the request.- Specified by:
process
in interfacecom.skava.core.EcommService<UserNotificationRequest,
UsersResponse> - Parameters:
request
- HoldsUserNotificationRequest
which is used to validate the notification param that is given from DB.- Returns:
- The
UsersResponse
which returns the success response code and message and if any validations fails, throws an validate exception.
-
checkParamExpired
Used to check whether the notification param is expired or not. If not yet matched then validate exception will be thrown.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.valueFromDB
- Indicates the notification param from db used for validating the notification param.collectionId
- Indicates the collection id for which the property gets loaded from DB within this collection id.
-
checkParamsMatched
Used to check whether the notification param is matched or not. If not yet matched then validate exception will be thrown.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.valueFromDB
- Indicates the notification param from db used for validating the notification param.valueFromRequest
- Indicates the notification param from request used for validating the notification param.
-
getUserProperty
Used to gets the user notification property from DB for the requested user.- Parameters:
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.userId
- Indicates the user id for which user the notification param gets loaded from DB.name
- Indicates the name of the property which needs to be loaded from DB.- Returns:
- The
PropertiesEntity
object which returns the property value that gets loaded from DB.
-
getValidator
This method is used to get the respective validator class for this user auth validate notification service.- Specified by:
getValidator
in interfacecom.skava.core.EcommService<UserNotificationRequest,
UsersResponse> - Returns:
- The list of
ValidatorComponent
object.
-
methodFallback
Circuit breaker fall-back method monitors for failures and once failures reach certain threshold, the circuit breaker trips and returns error response accordingly.- Parameters:
request
- HoldsUserNotificationRequest
object.- Returns:
- The
UsersResponse
object.
-