Home | History | Annotate | Download | only in muc
      1 /**
      2  * $RCSfile$
      3  * $Revision$
      4  * $Date$
      5  *
      6  * Copyright 2003-2007 Jive Software.
      7  *
      8  * All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");
      9  * you may not use this file except in compliance with the License.
     10  * You may obtain a copy of the License at
     11  *
     12  *     http://www.apache.org/licenses/LICENSE-2.0
     13  *
     14  * Unless required by applicable law or agreed to in writing, software
     15  * distributed under the License is distributed on an "AS IS" BASIS,
     16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     17  * See the License for the specific language governing permissions and
     18  * limitations under the License.
     19  */
     20 
     21 package org.jivesoftware.smackx.muc;
     22 
     23 /**
     24  * A listener that is fired anytime a participant's status in a room is changed, such as the
     25  * user being kicked, banned, or granted admin permissions.
     26  *
     27  * @author Gaston Dombiak
     28  */
     29 public interface ParticipantStatusListener {
     30 
     31     /**
     32      * Called when a new room occupant has joined the room. Note: Take in consideration that when
     33      * you join a room you will receive the list of current occupants in the room. This message will
     34      * be sent for each occupant.
     35      *
     36      * @param participant the participant that has just joined the room
     37      * (e.g. room (at) conference.jabber.org/nick).
     38      */
     39     public abstract void joined(String participant);
     40 
     41     /**
     42      * Called when a room occupant has left the room on its own. This means that the occupant was
     43      * neither kicked nor banned from the room.
     44      *
     45      * @param participant the participant that has left the room on its own.
     46      * (e.g. room (at) conference.jabber.org/nick).
     47      */
     48     public abstract void left(String participant);
     49 
     50     /**
     51      * Called when a room participant has been kicked from the room. This means that the kicked
     52      * participant is no longer participating in the room.
     53      *
     54      * @param participant the participant that was kicked from the room
     55      * (e.g. room (at) conference.jabber.org/nick).
     56      * @param actor the moderator that kicked the occupant from the room (e.g. user (at) host.org).
     57      * @param reason the reason provided by the actor to kick the occupant from the room.
     58      */
     59     public abstract void kicked(String participant, String actor, String reason);
     60 
     61     /**
     62      * Called when a moderator grants voice to a visitor. This means that the visitor
     63      * can now participate in the moderated room sending messages to all occupants.
     64      *
     65      * @param participant the participant that was granted voice in the room
     66      * (e.g. room (at) conference.jabber.org/nick).
     67      */
     68     public abstract void voiceGranted(String participant);
     69 
     70     /**
     71      * Called when a moderator revokes voice from a participant. This means that the participant
     72      * in the room was able to speak and now is a visitor that can't send messages to the room
     73      * occupants.
     74      *
     75      * @param participant the participant that was revoked voice from the room
     76      * (e.g. room (at) conference.jabber.org/nick).
     77      */
     78     public abstract void voiceRevoked(String participant);
     79 
     80     /**
     81      * Called when an administrator or owner banned a participant from the room. This means that
     82      * banned participant will no longer be able to join the room unless the ban has been removed.
     83      *
     84      * @param participant the participant that was banned from the room
     85      * (e.g. room (at) conference.jabber.org/nick).
     86      * @param actor the administrator that banned the occupant (e.g. user (at) host.org).
     87      * @param reason the reason provided by the administrator to ban the occupant.
     88      */
     89     public abstract void banned(String participant, String actor, String reason);
     90 
     91     /**
     92      * Called when an administrator grants a user membership to the room. This means that the user
     93      * will be able to join the members-only room.
     94      *
     95      * @param participant the participant that was granted membership in the room
     96      * (e.g. room (at) conference.jabber.org/nick).
     97      */
     98     public abstract void membershipGranted(String participant);
     99 
    100     /**
    101      * Called when an administrator revokes a user membership to the room. This means that the
    102      * user will not be able to join the members-only room.
    103      *
    104      * @param participant the participant that was revoked membership from the room
    105      * (e.g. room (at) conference.jabber.org/nick).
    106      */
    107     public abstract void membershipRevoked(String participant);
    108 
    109     /**
    110      * Called when an administrator grants moderator privileges to a user. This means that the user
    111      * will be able to kick users, grant and revoke voice, invite other users, modify room's
    112      * subject plus all the partcipants privileges.
    113      *
    114      * @param participant the participant that was granted moderator privileges in the room
    115      * (e.g. room (at) conference.jabber.org/nick).
    116      */
    117     public abstract void moderatorGranted(String participant);
    118 
    119     /**
    120      * Called when an administrator revokes moderator privileges from a user. This means that the
    121      * user will no longer be able to kick users, grant and revoke voice, invite other users,
    122      * modify room's subject plus all the partcipants privileges.
    123      *
    124      * @param participant the participant that was revoked moderator privileges in the room
    125      * (e.g. room (at) conference.jabber.org/nick).
    126      */
    127     public abstract void moderatorRevoked(String participant);
    128 
    129     /**
    130      * Called when an owner grants a user ownership on the room. This means that the user
    131      * will be able to change defining room features as well as perform all administrative
    132      * functions.
    133      *
    134      * @param participant the participant that was granted ownership on the room
    135      * (e.g. room (at) conference.jabber.org/nick).
    136      */
    137     public abstract void ownershipGranted(String participant);
    138 
    139     /**
    140      * Called when an owner revokes a user ownership on the room. This means that the user
    141      * will no longer be able to change defining room features as well as perform all
    142      * administrative functions.
    143      *
    144      * @param participant the participant that was revoked ownership on the room
    145      * (e.g. room (at) conference.jabber.org/nick).
    146      */
    147     public abstract void ownershipRevoked(String participant);
    148 
    149     /**
    150      * Called when an owner grants administrator privileges to a user. This means that the user
    151      * will be able to perform administrative functions such as banning users and edit moderator
    152      * list.
    153      *
    154      * @param participant the participant that was granted administrator privileges
    155      * (e.g. room (at) conference.jabber.org/nick).
    156      */
    157     public abstract void adminGranted(String participant);
    158 
    159     /**
    160      * Called when an owner revokes administrator privileges from a user. This means that the user
    161      * will no longer be able to perform administrative functions such as banning users and edit
    162      * moderator list.
    163      *
    164      * @param participant the participant that was revoked administrator privileges
    165      * (e.g. room (at) conference.jabber.org/nick).
    166      */
    167     public abstract void adminRevoked(String participant);
    168 
    169     /**
    170      * Called when a participant changed his/her nickname in the room. The new participant's
    171      * nickname will be informed with the next available presence.
    172      *
    173      * @param participant the participant that was revoked administrator privileges
    174      * (e.g. room (at) conference.jabber.org/nick).
    175      * @param newNickname the new nickname that the participant decided to use.
    176      */
    177     public abstract void nicknameChanged(String participant, String newNickname);
    178 
    179 }
    180