Another Notification rewrite.
First, fix Bug #8870. Fixed by removing Nag specific event type
(nag.alarm). However, this was just a symptom of a larger problem.
The problem: using application specific Notification handlers to handle
application specific event types. The problem comes when switching
between applications. Since these application handlers don't have any
knowledge of each other, events created by one handler may not be able
to be displayed when notify() was eventually called, because another
status handler had replaced the original handler.
The solution: all notifications need to be handled by a single,
centralized source - namely, the horde-level handlers. Application
specific details are instead injected into the horde-level handler to
extend behavior.
While reworking the code, also provided opportunity to remove all
application-specific code from Notification. Horde-specific
instantiation (i.e. adding Horde logging and Alarm decorators) is now
done in Horde_Core rather than in the base Notification object.
Additionally, rework some of the complexity added to the package. I
believe the goal of the recent Notification changes was to make the
Notification package testable and/or usable outside of a base Horde
install. But these changes also made the code unreadable, redundant,
and overly complex.
e.g. using interfaces where simple class extensions
make much more sense (IMHO - there are very few cases where an interface
makes more sense than an abstract class. Using interfaces for the
Handler class was simply overkill. Out of the 10 methods defined, there
are only 2 methods useful for decorator purposes - push() and notify().
And any given decorator won't even use both of these. Having to contort
code to do things like chaining handlers to achieve this in an interface
pattern was almost impossible to follow. It is much simpler to simply
add decorators directly to the base handler object.