KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > freecs > interfaces > IGroupPlugin


1 /**
2  * Copyright (C) 2004 Manfred Andres
3  * Created: 23.05.2004 (22:53:20)
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */

19 package freecs.interfaces;
20
21 import java.util.Properties JavaDoc;
22
23 import freecs.core.Group;
24 import freecs.core.MessageParser;
25 import freecs.core.User;
26
27
28 /**
29  * @author Manfred Andres
30  *
31  * This interface describes the functions, which will be triggerd at the
32  * apropriate event taking place inside the group a plugin is attached to.
33  */

34 public interface IGroupPlugin {
35     /**
36      * retrieves an instance of this GroupPlugin for the given group.
37      * @param namespace the namespace deffined within the group.properties for this plugin
38      * @param g the group, this instance will be attached to
39      * @param props the properties given for this extension
40      * @return the GroupPlugin initiated for this group
41      * @throws Exception If the implementation is unable to initialize an instance for the given group
42      */

43     public abstract IGroupPlugin instanceForGroup(String JavaDoc namespace, Group g, Properties JavaDoc props) throws Exception JavaDoc;
44     public abstract void remove();
45     public abstract void remove(String JavaDoc namespace);
46
47     /**
48      * Called if a user joins the group this GroupPlugin is attached to.
49      * @param u the user joining
50      */

51     public abstract void usrJoin(User u);
52     
53     /**
54      * Called if a user leaves the group this GroupPlugin is attached to.
55      * @param u
56      */

57     public abstract void usrLeaving(User u);
58     
59     /**
60      * Called for every action of any user, which any user may receive within the group this GroupPlugin is attached to.
61      * @param mpr the messageparser-object containing all informations of this action
62      */

63     public abstract void usrAction(MessageParser mpr);
64 }
65
Popular Tags