b973679ae384ca9109a76fb438a04d1ca225f4dd
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / WatchGlobal.java
1 /*
2  * jFCPlib - WatchGlobal.java - Copyright © 2008 David Roden
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  */
18
19 package net.pterodactylus.fcp;
20
21 /**
22  * The “WatchGlobal” messages enables clients to watch the global queue in
23  * addition to the client-local queue.
24  *
25  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
26  */
27 public class WatchGlobal extends FcpMessage {
28
29         /**
30          * Enables or disables watching the global queue.
31          *
32          * @param enabled
33          *            <code>true</code> to watch the global queue and the
34          *            client-local queue, <code>false</code> to watch only the
35          *            client-local queue
36          */
37         public WatchGlobal(boolean enabled) {
38                 this(enabled, Verbosity.ALL);
39         }
40
41         /**
42          * Enables or disables watching the global queue, optionally masking out
43          * certain events.
44          *
45          * @param enabled
46          *            <code>true</code> to watch the global queue and the
47          *            client-local queue, <code>false</code> to watch only the
48          *            client-local queue
49          * @param verbosityMask
50          *            A verbosity mask that determines which events are received
51          */
52         public WatchGlobal(boolean enabled, Verbosity verbosityMask) {
53                 super("WatchGlobal");
54                 setField("Enabled", String.valueOf(enabled));
55                 setField("VerbosityMask", String.valueOf(verbosityMask));
56         }
57
58 }