1<?php
2/* Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
3
4namespace Icinga\Module\Monitoring\Command\Object;
5
6/**
7 * Send custom notifications for a host or service
8 */
9class SendCustomNotificationCommand extends WithCommentCommand
10{
11    /**
12     * {@inheritdoc}
13     */
14    protected $allowedObjects = array(
15        self::TYPE_HOST,
16        self::TYPE_SERVICE
17    );
18
19    /**
20     * Whether the notification is forced
21     *
22     * Forced notifications are sent out regardless of time restrictions and whether or not notifications are enabled.
23     *
24     * @var bool
25     */
26    protected $forced;
27
28    /**
29     * Whether to broadcast the notification
30     *
31     * Broadcast notifications are sent out to all normal and escalated contacts.
32     *
33     * @var bool
34     */
35    protected $broadcast;
36
37    /**
38     * Get whether to force the notification
39     *
40     * @return bool
41     */
42    public function getForced()
43    {
44        return $this->forced;
45    }
46
47    /**
48     * Set whether to force the notification
49     *
50     * @param   bool $forced
51     *
52     * @return  $this
53     */
54    public function setForced($forced = true)
55    {
56        $this->forced = $forced;
57        return $this;
58    }
59
60    /**
61     * Get whether to broadcast the notification
62     *
63     * @return bool
64     */
65    public function getBroadcast()
66    {
67        return $this->broadcast;
68    }
69
70    /**
71     * Set whether to broadcast the notification
72     *
73     * @param   bool $broadcast
74     *
75     * @return  $this
76     */
77    public function setBroadcast($broadcast = true)
78    {
79        $this->broadcast = $broadcast;
80        return $this;
81    }
82}
83