Class NotificationSettingService
java.lang.Object
es.kukenan.smartfi.microservice.communication.service.messaging.AbstractDomainEventService
es.kukenan.smartfi.microservice.communication.service.messaging.NotificationSettingService
Service class that holds and manage all the push notification settings.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringEvent asociated to send messsage for push activated.private KafkaControllerKafka Controller.private MessagingControllerMessagingController controller.private MobileOperationSystemRepositorymobile operation system repository.private PushNotificationRepositorypush notification repository.private es.kukenan.smartfi.common.context.RequestContextManagerRequestContextManager context manager.private UsersRepositoryuser repository.Fields inherited from class es.kukenan.smartfi.microservice.communication.service.messaging.AbstractDomainEventService
CAT_DESTINATION_PREFIX, CAT_LANG, CAT_USER, notificationService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate UsercheckUserId(String userId) Method in charge to check the existence of user en bbdd.private voiddeletePushNotification(String userId) Method in charge to delete data in database.es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationActivatedResponseDtogetPushActivated(String userId) Get if the user has push activated or deactivated.voidpushNotification(String userId, String deviceId, es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationRequestDto settings) Activated or deactivated push notification for user and device.private voidMethod in charge to save data in database.private voidsendMessagesForPushActivated(String userId, int companyId) private voidvalidateRequest(String deviceId, es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationRequestDto settings) Methods inherited from class es.kukenan.smartfi.microservice.communication.service.messaging.AbstractDomainEventService
createVirtualUserForCatDestination, eventTypeDescriptor, findMessages, findRealUser, findRealUserFromOnboarding, handleGenericNotificationEvent, handleGenericNotificationEvent, toMessageSpecialProperties
-
Field Details
-
EVENT_PUSH_ACTIVATED
Event asociated to send messsage for push activated.- See Also:
-
pushNotificationRepository
push notification repository. -
usersRepository
user repository. -
mobileOperationSystemRepository
mobile operation system repository. -
requestContextManager
@Autowired private es.kukenan.smartfi.common.context.RequestContextManager requestContextManagerRequestContextManager context manager. -
messagingController
MessagingController controller. -
kafkaController
Kafka Controller.
-
-
Constructor Details
-
NotificationSettingService
public NotificationSettingService()
-
-
Method Details
-
pushNotification
@Transactional public void pushNotification(String userId, String deviceId, es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationRequestDto settings) Activated or deactivated push notification for user and device.- Parameters:
userId- user identification.deviceId- devide identification.settings- request with paramas.
-
checkUserId
Method in charge to check the existence of user en bbdd.- Parameters:
userId- user identification.- Returns:
- the user
-
savePushNotification
private void savePushNotification(String userId, String deviceId, String token, String mobileOs, User user) Method in charge to save data in database.- Parameters:
userId- user identification.deviceId- device identification.token- device token.mobileOs- device OS.user- user data to refresh.
-
deletePushNotification
Method in charge to delete data in database.- Parameters:
userId- user identification.
-
validateRequest
private void validateRequest(String deviceId, es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationRequestDto settings) -
sendMessagesForPushActivated
-
getPushActivated
public es.kukenan.smartfi.microservice.communications.api.pushnotification.PushNotificationActivatedResponseDto getPushActivated(String userId) Get if the user has push activated or deactivated.- Parameters:
userId- user identification.- Returns:
- response
-