1 /*****************************************************/
2 /* This java file is a part of the */
4 /* - Plouf's Java IRC Client - */
6 /* Copyright (C) 2002 - 2004 Philippe Detournay */
8 /* All contacts : theplouf@yahoo.com */
10 /* PJIRC is free software; you can redistribute */
11 /* it and/or modify it under the terms of the GNU */
12 /* General Public License as published by the */
13 /* Free Software Foundation; version 2 or later of */
16 /* PJIRC is distributed in the hope that it will */
17 /* be useful, but WITHOUT ANY WARRANTY; without */
18 /* even the implied warranty of MERCHANTABILITY or */
19 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU */
20 /* General Public License for more details. */
22 /* You should have received a copy of the GNU */
23 /* General Public License along with PJIRC; if */
24 /* not, write to the Free Software Foundation, */
25 /* Inc., 59 Temple Place, Suite 330, Boston, */
26 /* MA 02111-1307 USA */
28 /*****************************************************/
32 import irc.IRCConfiguration;
34 import irc.ident.prv.IdentServer;
39 public class IdentWrapper extends IRCObject {
40 private IdentServer _ident;
41 private IdentListener _lis;
44 * Create a new IdentWrapper.
47 * the global configuration.
49 public IdentWrapper(IRCConfiguration config) {
54 * Start the execution of the ident server, using default configuration.
59 * the listener to use.
60 * @return any occured exception if failed, or null if everything went well.
62 public Exception start(String userName, IdentListener lis) {
64 _ident = new IdentServer(_ircConfiguration);
65 _ident.addIdentListener(lis);
66 String name = _ircConfiguration.getS("userid");
67 if (name.length() == 0)
69 _ident.setDefaultUser("JAVA", name);
74 } catch (Exception e) {
80 * Stop the execution of the ident server.
83 _ident.removeIdentListener(_lis);