Menu

[r42]: / scriptbot / src / java / net / jawe / scriptbot / Config.java  Maximize  Restore  History

Download this file

470 lines (410 with data), 13.2 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
/*
* Created on 15.11.2005 by jawe
* $Id$
*/
/*
* This file is part of scriptbot.
*
* scriptbot is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* scriptbot is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with ScriptBot; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package net.jawe.scriptbot;
import java.net.InetAddress;
import java.util.Set;
/**
* Bot configuration.
*
* @author jawe
*/
public interface Config {
/**
* Unique name for this config. Recommended form is "network.nick".
* @return the id
*/
public String getId();
/**
* Unique name for this config. Recommended form is "network.nick".
* @param id the id.
*/
public void setId(String id);
/**
* Filename of the init script.
*
* @return Returns the initScriptName.
*/
public String getInitScriptName();
/**
* Filename of the init script.
*
* @param initScriptName
* The initScriptName to set.
*/
public void setInitScriptName(String initScriptName);
/**
* Data directory for the persistence manager.
*
* @return Returns the dataDir.
*/
public String getDataDir();
/**
* Data directory for the persistence manager.
*
* @param dataDir
* The dataDir to set.
*/
public void setDataDir(String dataDir);
/**
* The configured nicks.
*
* @return Returns the nicks.
*/
public Set<String> getNicks();
/**
* The nicks to use as an array. Convenience method for use by scripts.
*
* @return the nicks as array.
*/
public String[] getNicksArray();
/**
* The scripts to be executed after connecting.
*
* @return Returns the perform scripts.
*/
public Set<String> getPerformScripts();
/**
* The scripts to be executed after connecting as an array. Convenience
* method for use by scripts.
*
* @return the perform scripts as array.
*/
public String[] getPerformScriptsArray();
/**
* The configured modules.
*
* @return Returns the modules.
*/
public Set<String> getModules();
/**
* The configured modules as an array. Convenience method for use by
* scripts.
*
* @return the modules as array.
*/
public String[] getModulesArray();
/**
* The configured servers.
*
* @return Returns the servers.
*/
public Set<Server> getServers();
/**
* @see org.jibble.pircbot.PircBot#getDccInetAddress()
*/
public String getDccInetAddress();
/**
* @see org.jibble.pircbot.PircBot#setDccInetAddress(InetAddress)
*/
public void setDccInetAddress(String dccInetAddress);
/**
* Set of DCC listening ports to use for DCC chats and filetransfers.
* @see org.jibble.pircbot.PircBot#getDccPorts()
* @see org.jibble.pircbot.PircBot#setDccPorts(int[])
* @return the dcc ports
*/
public Set<Integer> getDccPorts();
/**
* Convenience method to add a range of ports to use for DCC chats and
* filetransfers.
* @param from the lowest port to use.
* @param to the highest port to use.
*/
public void addDccPortRange(int from, int to);
/**
* Convenience method to remove a range of ports to use for DCC chats and
* filetransfers.
* @param from the lowest port not to use anymore.
* @param to the highest port not to use anymore.
*/
public void removeDccPortRange(int from, int to);
/**
* The maximum number of attempts the bot will try to connect to a server.
*
* @return Returns the maxConnectionAttempts.
*/
public int getMaxConnectionAttempts();
/**
* The maximum number of attempts the bot will try to connect to a server.
*
* @param maxConnectionAttempts
* The maxConnectionAttempts to set.
*/
public void setMaxConnectionAttempts(int maxConnectionAttempts);
/**
* The time in milliseconds the bot will wait between connection attempts.
*
* @return Returns the connectionRetryDelay.
*/
public long getConnectionRetryDelay();
/**
* The time in milliseconds the bot will wait between connection attempts.
*
* @param connectionRetryDelay
* The connectionRetryDelay to set.
*/
public void setConnectionRetryDelay(long connectionRetryDelay);
/**
* Hide PING and PONG messages in verbose output?
*
* @return Returns the hidePingPong.
*/
public boolean isHidePingPong();
/**
* Hide PING and PONG messages in verbose output?
*
* @param hidePingPong
* The hidePingPong to set.
*/
public void setHidePingPong(boolean hidePingPong);
/**
* Add a nick.
*
* @param nick
* @return true if the nick was not already configured.
*/
public boolean addNick(String nick);
/**
* Add a server.
*
* @param hostname
* the server's hostname or IP.
* @return the newly created server object.
*/
public Server addServer(String hostname);
/**
* Add a server.
*
* @param hostname
* the server's hostname or IP.
* @param port
* the server port.
* @return the newly created server object.
*/
public Server addServer(String hostname, int port);
/**
* Add a server.
*
* @param hostname
* the server's hostname or IP.
* @param port
* the server port.
* @param password
* the server password.
* @return the newly created server object.
*/
public Server addServer(String hostname, int port, String password);
/**
* Add a module.
*
* @param name
* the module name.
* @return true if the module was not already added.
*/
public boolean addModule(String name);
/**
* Add a script to be executed after connecting.
*
* @param filename
* the script filename.
* @return true if the script was not already added.
*/
public boolean addPerformScript(String filename);
/**
* The bot's login (eg. username or ident).
*
* @return Returns the login.
*/
public String getLogin();
/**
* The bot's login (eg. username or ident).
*
* @param login
* The login to set.
*/
public void setLogin(String login);
/**
* Append random numbers to the nick if the nick is already in use? If this
* is set to <tt>true</tt> only the first configured nick will be used and
* modified, all other nicks will be ignored.
*
* @return Returns the autoNickChange.
*/
public boolean isAutoNickChange();
/**
* Append random numbers to the nick if the nick is already in use? If this
* is set to <tt>true</tt> only the first configured nick will be used and
* modified, all other nicks will be ignored.
*
* @param autoNickChange
* The autoNickChange to set.
*/
public void setAutoNickChange(boolean autoNickChange);
/**
* The CTCP finger reply.
*
* @return Returns the finger.
*/
public String getFinger();
/**
* The CTCP finger reply.
*
* @param finger
* The finger to set.
*/
public void setFinger(String finger);
/**
* Start an ident server on startup?
*
* @return Returns the startIdentServer.
*/
public boolean isStartIdentServer();
/**
* Start an ident server on startup?
*
* @param startIdentServer
* The startIdentServer to set.
*/
public void setStartIdentServer(boolean startIdentServer);
/**
* The encoding to use when communicating with the IRC server.
*
* @return the encoding;
*/
public String getEncoding();
/**
* The encoding to use when communicating with the IRC server.
*
* @param encoding
* the encoding to set.
*/
public void setEncoding(String encoding);
/**
* Prefix for all commands issued in a channel.
*
* @return Returns the channelCommandPrefix.
*/
public String getChannelCommandPrefix();
/**
* Prefix for all commands issued in a channel.
*
* @param channelCommandPrefix
* The channelCommandPrefix to set.
*/
public void setChannelCommandPrefix(String channelCommandPrefix);
/**
* Prefix for all commands issued as action.
*
* @return Returns the actionCommandPrefix.
*/
public String getActionCommandPrefix();
/**
* Prefix for all commands issued as action.
*
* @param actionCommandPrefix
* The actionCommandPrefix to set.
*/
public void setActionCommandPrefix(String actionCommandPrefix);
/**
* Prefix for all commands issued in a DCC chat.
*
* @return Returns the dccCommandPrefix.
*/
public String getDccCommandPrefix();
/**
* Prefix for all commands issued in a DCC chat.
*
* @param dccCommandPrefix
* The dccCommandPrefix to set.
*/
public void setDccCommandPrefix(String dccCommandPrefix);
/**
* Prefix for all commands issued in a notice.
*
* @return Returns the _noticeCommandPrefix.
*/
public String getNoticeCommandPrefix();
/**
* Prefix for all commands issued in a notice.
*
* @param noticeCommandPrefix
* The noticeCommandPrefix to set.
*/
public void setNoticeCommandPrefix(String noticeCommandPrefix);
/**
* Prefix for all commands issued in a private message (eg. msg or query).
*
* @return Returns the privateCommandPrefix.
*/
public String getPrivateCommandPrefix();
/**
* Prefix for all commands issued in a private message (eg. msg or query).
*
* @param privateCommandPrefix
* The privateCommandPrefix to set.
*/
public void setPrivateCommandPrefix(String privateCommandPrefix);
/**
* Get the configured prefix for the input type.
*
* @param inputType
* the input type.
* @return the configured prefix.
*/
public String getPrefix(MessageType inputType);
/**
* Should hostmasks be automatically added on auth?
* @return The configured auto adding of hostmasks setting
*/
public boolean isAutoAddHostmasks();
/**
* Set wether hostmasks should be automatically added on auth.
* @param autoAddHostmasks Enable or disable auto adding of hostmasks
*/
public void setAutoAddHostmasks(boolean autoAddHostmasks);
/**
* The hilite color, a constant from {@link org.jibble.pircbot.Colors}
* @return the hilite color
*/
public String getHiliteColor();
/**
* The hilite color, a constant from {@link org.jibble.pircbot.Colors}
* @param hiliteColor the hilite color
*/
public void setHiliteColor(String hiliteColor);
/**
* Issue a log message whenever a user executes a command.
* Commands invocations will be logged at the INFO level and will include
* the user's nick, login and hostname as well as the command and all parameters.
* Be careful as this could include sensitive information such as bot user passwords.
* @return audit commands.
*/
public boolean isAuditCommands();
/**
* Issue a log message whenever a user executes a command.
* Commands invocations will be logged at the INFO level and will include
* the user's nick, login and hostname as well as the command and all parameters.
* Be careful as this could include sensitive information such as bot user passwords.
* @param auditCommands audit commands
*/
public void setAuditCommands(boolean auditCommands);
}
MongoDB Logo MongoDB