1: <?php
2: /**
3: * @package Alarm
4: *
5: * Copyright 2010-2012 Horde LLC (http://www.horde.org/)
6: *
7: * See the enclosed file COPYING for license information (LGPL). If you
8: * did not receive this file, see http://www.horde.org/licenses/lgpl21.
9: */
10:
11: /**
12: * The Horde_Alarm_Handler class is an interface for all Horde_Alarm handlers
13: * that notifies of active alarms.
14: *
15: * @author Jan Schneider <jan@horde.org>
16: * @package Alarm
17: */
18: abstract class Horde_Alarm_Handler
19: {
20: /**
21: * The alarm object to that this handler is attached.
22: *
23: * Horde_Alarm
24: */
25: public $alarm;
26:
27: /**
28: * Notifies about an alarm.
29: *
30: * @param array $alarm An alarm hash.
31: *
32: * @throws Horde_Alarm_Exception
33: */
34: abstract public function notify(array $alarm);
35:
36: /**
37: * Resets the internal status of the handler, so that alarm notifications
38: * are sent again.
39: *
40: * @param array $alarm An alarm hash.
41: */
42: public function reset(array $alarm)
43: {
44: }
45:
46: /**
47: * Returns a human readable description of the handler.
48: *
49: * @return string
50: */
51: abstract public function getDescription();
52:
53: /**
54: * Returns a hash of user-configurable parameters for the handler.
55: *
56: * The parameters are hashes with parameter names as keys and parameter
57: * information as values. The parameter information is a hash with the
58: * following keys:
59: * - type: the parameter type as a preference type.
60: * - desc: a parameter description.
61: * - required: whether this parameter is required.
62: *
63: * @return array
64: */
65: public function getParameters()
66: {
67: return array();
68: }
69: }
70: