Project

General

Profile

Actions

Task #348

closed

Sms notification sender

Added by Peter Štrunc about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Peter Štrunc
Category:
Notification
Target version:
Start date:
05/03/2017
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Owner:

Description

The aim of this task is to implement sms notification sender for IdM that is flexible enough to use with various sms gateways and providers


Subtasks 1 (0 open1 closed)

Defect #398: Sending notification from front end does not workClosedPeter Štrunc05/03/2017

Actions

Related issues

Related to IdStory Identity Manager - Defect #482: Emails history log - there is column "Sent" with no value.ClosedRadek Tomiška06/05/2017

Actions
Actions #1

Updated by Peter Štrunc about 7 years ago

  • Description updated (diff)

The main problem here in my opinion is how to achieve wanted flexibility so we can easily adapt for different APIs of different sms gateways. I have came up with two possible ways to implement this.

1. Use something like the Strategy pattern and make it configurable which strategy will be used to send sms. Each strategy will then have its own configuration properties which will provide necessary information for sending sms (endpoint url, username, etc.). This is easier way to do it, but it does not provide as high level of "openness" as the next approach since it will be part of core module, hence not extensible by other developers.

2. Make sms sender fire some event (SEND_SMS maybe?) and implement new module for each gateway that we want to use. This is in my opinion better approach since it provides better separation of handling vendor specific logic of each sms provider and it also allows other people to implement their adapters for various gateways. On the other hand it may be too much coding for such small task.

Actions #2

Updated by Peter Štrunc about 7 years ago

Another possible way of configuring access to different providers of sms gateways would be to let administrators implement sending of sms via groovy script. This however could bring more complications for example with providing of credentials which would probably have to be stored inside of said groovy script. Another drawback of this approach is that it requires a lot of coding in groovy just to be able to send sms.

Actions #3

Updated by Vít Švanda about 7 years ago

  • Category set to Notification

I recommand use simplest way as is possible. It's means create service (sender) for one SMS GW implementation. If we will need use next SMS GW implementation, then will be created next service (sender). Extraction to separate modules is possible, but I think core module will be good place for now.
Very good example how create sender (with camle integration) is websocket implementation WebsocketNotificationSender.class.
Configuration for SMS GW, can be saved in application.properties. Access for properties can be realized as in DefaultEmailerConfiguration.class.

Actions #4

Updated by Peter Štrunc about 7 years ago

To be honest I would rather prefer not to put logic that is specific only to certain sms gw provider inside of core module. It would be much better if there was some way to dynamically (to some extent) provide adapters for different providers that can be just dropped as jars inside of tomcat and which will register itself and be available for user to choose in UI.

Sadly I dont know about any other way to do it than by using some sort of pub-sub model which leads to developing of new module for each provider. If any of you has better idea please comment, because I cant think of something better.

The main issue with this (as I understand it) is having to repackage whole application just to add another api support for sms providers.

Actions #5

Updated by Radek Tomiška about 7 years ago

I think this ticket could be splited to two different tasks:
  1. in custom (or core) module: create custom / default sms notification sender implementation (type="sms")
  2. in core: add new configuration to notification types (new agenda or configuration service usage) - choose sender implementation for notification type and use this configuration in NotificationRouteBuilder.routes. FE agenda could work the same as AuthorizationPolicy detail - after notification type selection senders could be found, which support selected type. Agenda could be added under notification configuration (split configutarion to two horizontal tabs).

I could prepare the second point, if this design will be ok.

Actions #6

Updated by Peter Štrunc about 7 years ago

I am almost finished with dto refactoring. Last thing to do besides some cleanup is to show notification recipients when listing all notifications. Problem is, that the mapper only maps collections if trimmed is not set to true and method AbstractReadDtoService.toDtos sets trimmed for all dtos? So there are basically two options. First is to fetch all notifications one by one so that the recipients collection will be present in the result, or change mentioned method so that it wont trimm all collections, or at least make it configurable in some way, because fetching recipients for all notifications one by one would be horror in my opinion.

Actions #7

Updated by Peter Štrunc about 7 years ago

I have pushed dto refactoring code in psourek/smsNotification with resolved conflicts and rebased on current develop so it is prepared for merging. There is an issue to resolve which i consulted with Radek and it is space/tab indentation. It seems that my commit has lot of formatting changes which will be very tedious to check.

I think that it would be best to check the code differences ignoring whitespace changes (git diff -w psourek/smsNotification develop).

After we decide what codestyle we want tu use, then we will format the code so it will be consistent throughout whole project. I dont think that it would be wise to run it now on my branch because it could potentially lead to more conflicts.

Actions #10

Updated by Peter Štrunc almost 7 years ago

I have finished implementing sms notification support in branch psourek/smsNotification. Please review the changes and give me feedback. After consulting this with Radek we decided that FE agenda for selecting sender for each notification channel will be implemented later on in separate ticket, because it is not needed right now.

Actions #11

Updated by Marcel Poul almost 7 years ago

  • Status changed from New to Needs feedback
  • Target version set to Citrine (7.3.0)
Actions #13

Updated by Peter Štrunc almost 7 years ago

  • Assignee changed from Peter Štrunc to Radek Tomiška
Actions #15

Updated by Vít Švanda almost 7 years ago

  • Assignee changed from Radek Tomiška to Vít Švanda
Actions #16

Updated by Vít Švanda almost 7 years ago

  • Assignee changed from Vít Švanda to Peter Štrunc

I did review (only FE agenda and abstract sender ... implementation will be created later).
I found only trivial issues:

  • In some new sms FE classes @author missing.
  • serialVersionUID in IdmSmsLog is Long instead long (showed as warning) - this is probably only Eclipse issue
  • Linter warnings in SMS and in other notification (this warnings was showed after merged your "big" merge to develop):

/home/svandav/Work/GIT/CzechIdMng/Realization/frontend/czechidm-core/src/content/notification/email/EmailTable.js
167:15 warning Declare only one React component per file react/no-multi-comp

/home/svandav/Work/GIT/CzechIdMng/Realization/frontend/czechidm-core/src/content/notification/NotificationTable.js
188:15 warning Declare only one React component per file react/no-multi-comp

/home/svandav/Work/GIT/CzechIdMng/Realization/frontend/czechidm-core/src/content/notification/sms/SmsTable.js
167:15 warning Declare only one React component per file react/no-multi-comp

/home/svandav/Work/GIT/CzechIdMng/Realization/frontend/czechidm-core/src/content/notification/websocket/WebsocketTable.js
167:15 warning Declare only one React component per file react/no-multi-comp

Actions #17

Updated by Peter Štrunc almost 7 years ago

Actions #18

Updated by Peter Štrunc almost 7 years ago

  • Assignee changed from Peter Štrunc to Vít Švanda

I fixed mentioned issues in separate commit 94a8fa7. Please tell me, if I can merge this stuff in develop.

Actions #19

Updated by Vít Švanda almost 7 years ago

  • Assignee changed from Vít Švanda to Peter Štrunc

Looks nice, go to develop with this.

Actions #20

Updated by Peter Štrunc almost 7 years ago

  • Status changed from Needs feedback to Closed

merged in develop

Actions #21

Updated by Radek Tomiška almost 7 years ago

  • Related to Defect #482: Emails history log - there is column "Sent" with no value. added
Actions

Also available in: Atom PDF