CESNET/perun — pull request #264 by jirmauritz (2014-05-05 12:18:48+00:00)
Title: Notification+RPC: new version of nofication module

The notification module is prepared for using. Bugs were fixed and
some features were added, since these are needed for smooth working of
the notification manager. The interface is prepared as command line
tools written in perl in the RPC module. You can find detailed description of
the changes below.

Features in notification module
- renamed saving methods to creating methods
- edited saving and updating methods in NotificationManagerMethod, so as they take an object, not only id
- added methods for saving relations:
- saveRegexRelation
- saveObjectRegexRelation
- added listing methods
- added toString methods to entities.
- formating commit
- Added new attribute of Receiver - locale
- the locale of messages is extracted from receiver's locale instead of template's locale
- the locale from template and pool message entities has been deleted

Fix of bugs in notifications module
- fixed parsing of Class from NotifObject - using getName() instead of toString()
- fixed bug in NotificationsListener: now the processing of perun audit messages is active.
- Debug fixes:
- NotificationListener - eddited logger message
- PerunNotifPoolMessageManagerImpl - fixed possible NullPointerException
- PerunNotifPoolMessageManagerImpl - add log message in parsing method
- PerunNotifTemplateManagerImpl - method getTemplateById give most updated template instead the one from cache
- PerunNotifRegexManagerImpl - method saveTemplateRegexRelation now updates relation in template
- PerunNotifTemplateManagerImpl - method compileTemplate, fixed name of the template
- fix of updateTemplateMessage - removed return statement, edited sql statement (BUG_03)
- enhanced working with locale (BUG_05)
- update of template-regex relation - the relation between template and regex is now updating template globaly (BUG_10)
- TemplateRegexRelation managing (BUG_11)
- repaired cyclic call of saveTemplateRegexRelation and updatePerunNotifTemplate by adding new method assignTemplateToRegex, which is now called from both methods
- repaired wrong removing TemplateRegexRelation by creating new method removeTemplateFromRegex
- edited parseMapWithList, so as it doesn't throw unneccessary exceptions
- removing of AuditMessages - the PerunNotifAuditMessages is now being removed from db, when not recognized (BUG_02)
- resolved deleting of receiver and template-regex relation - the receiver and template-regex relation has been deleted everytime updatePerunNotifTemplate was called - now this method do not process regexes nor receivers anymore (BUG 04, 06)
- formatting commit for notification module
- fixed bug in updateTemplate - now the updatePerunNotifObject updates the notif_trigger too
- fix of STREAM mode (BUG_13):
- fix bug of Pool Message row mapper, which was getting the time of creation of the message in a wrong format
- added log messages connected to STREAM mode
- fix getting emails from EMAIL_GROUP type of receiver - the email is extracted from attribute of user instead of member
- repaired updatePerunNotifTemplateMessage - the changes was not propagated to the FreeMaker cache (BUG_15)

Perl - added Command Line Tools for managing Notification Module
- created NotificationsAgent
- perun notification objects:
- NotifReceiver
- NotifRegex
- NotifTemplateMessage
- NotifTemplate
- for each is created following tools:
- create
- update
- remove
- get
- list
- for Template-Regex relation is created saving, removing and listing tool