|
@@ -0,0 +1,90 @@
|
|
1
|
+/*
|
|
2
|
+ * Copyright (c) 2006-2015 DMDirc Developers
|
|
3
|
+ *
|
|
4
|
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+ * of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+ * in the Software without restriction, including without limitation the rights
|
|
7
|
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+ * copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+ * furnished to do so, subject to the following conditions:
|
|
10
|
+ *
|
|
11
|
+ * The above copyright notice and this permission notice shall be included in
|
|
12
|
+ * all copies or substantial portions of the Software.
|
|
13
|
+ *
|
|
14
|
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+ * SOFTWARE.
|
|
21
|
+ */
|
|
22
|
+
|
|
23
|
+package com.dmdirc.interfaces;
|
|
24
|
+
|
|
25
|
+import com.dmdirc.parser.common.ChannelJoinRequest;
|
|
26
|
+
|
|
27
|
+import java.util.Collection;
|
|
28
|
+import java.util.Optional;
|
|
29
|
+
|
|
30
|
+/**
|
|
31
|
+ * Handles all {@link GroupChat}s on a {@link Connection}
|
|
32
|
+ */
|
|
33
|
+public interface GroupChatManager {
|
|
34
|
+
|
|
35
|
+ /**
|
|
36
|
+ * Retrieves the specified channel belonging to this server.
|
|
37
|
+ *
|
|
38
|
+ * @param channel The channel to be retrieved
|
|
39
|
+ *
|
|
40
|
+ * @return The appropriate channel object
|
|
41
|
+ */
|
|
42
|
+ Optional<GroupChat> getChannel(final String channel);
|
|
43
|
+
|
|
44
|
+ /**
|
|
45
|
+ * Retrieves the possible channel prefixes in use on this server.
|
|
46
|
+ *
|
|
47
|
+ * @return This server's possible channel prefixes
|
|
48
|
+ */
|
|
49
|
+ String getChannelPrefixes();
|
|
50
|
+
|
|
51
|
+ /**
|
|
52
|
+ * Gets a collection of all channels on this connection.
|
|
53
|
+ *
|
|
54
|
+ * @return collection of channels belonging to this connection
|
|
55
|
+ */
|
|
56
|
+ Collection<GroupChat> getChannels();
|
|
57
|
+
|
|
58
|
+ /**
|
|
59
|
+ * Determines if the specified channel name is valid. A channel name is valid if we already have
|
|
60
|
+ * an existing Channel with the same name, or we have a valid parser instance and the parser
|
|
61
|
+ * says it's valid.
|
|
62
|
+ *
|
|
63
|
+ * @param channelName The name of the channel to test
|
|
64
|
+ *
|
|
65
|
+ * @return True if the channel name is valid, false otherwise
|
|
66
|
+ */
|
|
67
|
+ boolean isValidChannelName(final String channelName);
|
|
68
|
+
|
|
69
|
+ /**
|
|
70
|
+ * Attempts to join the specified channels. If channels with the same name already exist, they
|
|
71
|
+ * are (re)joined and their windows activated.
|
|
72
|
+ *
|
|
73
|
+ * @param requests The channel join requests to process
|
|
74
|
+ *
|
|
75
|
+ * @since 0.6.4
|
|
76
|
+ */
|
|
77
|
+ void join(final ChannelJoinRequest... requests);
|
|
78
|
+
|
|
79
|
+ /**
|
|
80
|
+ * Attempts to join the specified channels. If channels with the same name already exist, they
|
|
81
|
+ * are (re)joined.
|
|
82
|
+ *
|
|
83
|
+ * @param focus Whether or not to focus any new channels
|
|
84
|
+ * @param requests The channel join requests to process
|
|
85
|
+ *
|
|
86
|
+ * @since 0.6.4
|
|
87
|
+ */
|
|
88
|
+ void join(final boolean focus, final ChannelJoinRequest... requests);
|
|
89
|
+
|
|
90
|
+}
|