mirror of https://github.com/sipwise/jitsi.git
parent
05056be7f8
commit
fefef7f04d
@ -0,0 +1,369 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol;
|
||||
|
||||
/**
|
||||
* The <tt>ChatRoomConfigParam</tt> class defines some parameters which allow to
|
||||
* add additional configurations to the chat room, like for example define that
|
||||
* the chat room requires a password or an invitation, or that the number of
|
||||
* users that join the chat is limitted, etc. A <tt>ChatRoomConfigParam</tt>
|
||||
* could be set to the chat room using the <tt>addConfigParam</tt> method in the
|
||||
* <tt>ChatRoom</tt> interface.
|
||||
*
|
||||
* @author Stephane Remy
|
||||
* @author Yana Stamcheva
|
||||
*/
|
||||
public class ChatRoomConfigParam
|
||||
{
|
||||
/**
|
||||
* This constant contains the String representation of the CHAT_ROOM_VISIBLE
|
||||
* configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Visible".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_VISIBLE = "Visible";
|
||||
|
||||
/**
|
||||
* The visible configuration parameter. Indicates that the associated chat
|
||||
* room is visible.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_VISIBLE
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_VISIBLE);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_NOT_VISIBLE configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Not Visible".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_NOT_VISIBLE = "Not Visible";
|
||||
|
||||
/**
|
||||
* The not visible configuration parameter. Indicates that the associated
|
||||
* chat room isn't visible.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_NOT_VISIBLE
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_NOT_VISIBLE);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_PASSWORD_REQUIRED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Password Required".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_PASSWORD_REQUIRED
|
||||
= "Password Required";
|
||||
|
||||
/**
|
||||
* The password required configuration parameter. Indicates that the
|
||||
* associated chat room requires password.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_PASSWORD_REQUIRED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_PASSWORD_REQUIRED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_INVITATION_REQUIRED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Invitation Required".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_INVITATION_REQUIRED
|
||||
= "Invitation Required";
|
||||
|
||||
/**
|
||||
* The invitation required parameter. Indicates that the associated chat
|
||||
* room requires an invitation.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_INVITATION_REQUIRED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_INVITATION_REQUIRED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_USER_NUMBER_LIMITED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "User Number Limited".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_USER_NUMBER_LIMITED
|
||||
= "User Number Limited";
|
||||
|
||||
/**
|
||||
* The limitted user number parameter. Indicates that the associated chat
|
||||
* room have a limit on number of users.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_USER_NUMBER_LIMITED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_USER_NUMBER_LIMITED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the CHAT_ROOM_MUTE
|
||||
* configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Mute".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_MUTE = "Mute";
|
||||
|
||||
/**
|
||||
* Indicates that the associated chat room is currently
|
||||
* in a mute mode and no messages could be obtained from it.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_MUTE
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_MUTE);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_EXTERNAL_MESSAGES_ALLOWED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "External Messages Allowed".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_EXTERNAL_MESSAGE_ALLOWED
|
||||
= "External Messages Allowed";
|
||||
|
||||
/**
|
||||
* Indicates that it's possible for someone to send messages to this chat
|
||||
* room even if they are not present inside the chat room.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_EXTERNAL_MESSAGE_ALLOWED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_EXTERNAL_MESSAGE_ALLOWED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_REGISTERED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Registered".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_REGISTERED = "Registered";
|
||||
|
||||
/**
|
||||
* Indicates that the associated chat room is registered.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_REGISTERED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_REGISTERED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_SUBJECT_LOCKED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Subject Locked".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_SUBJECT_LOCKED = "Subject Locked";
|
||||
|
||||
/**
|
||||
* Indicates that only admin users can change the subject of this chat room.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_SUBJECT_LOCKED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_SUBJECT_LOCKED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_MESSAGE_FORMAT_ALLOWED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Message Format Allowed".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_MESSAGE_FORMAT_ALLOWED
|
||||
= "Message Format Allowed";
|
||||
|
||||
/**
|
||||
* Indicates that the message format in this chat room could be modified.
|
||||
* Colored, underlined, etc. messages are allowed.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_MESSAGE_FORMAT_ALLOWED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_MESSAGE_FORMAT_ALLOWED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_MESSAGE_FORMAT_FILTERED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Message Format Filtered".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_MESSAGE_FORMAT_FILTERED
|
||||
= "Message Format Filtered";
|
||||
|
||||
/**
|
||||
* Indicates that the associated chat room is currently in a message format
|
||||
* filtered mode. All formatted messages (colored, underlined, etc.)are seen
|
||||
* in standard format by other users.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_MESSAGE_FORMAT_FILTERED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_MESSAGE_FORMAT_FILTERED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_JOIN_TIME_LIMITED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Join Time Limited".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_JOIN_TIME_LIMITED
|
||||
= "Join Time Limited";
|
||||
|
||||
/**
|
||||
* Indicates that users can only join this chat room in an interval of X
|
||||
* seconds.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_JOIN_TIME_LIMITED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_JOIN_TIME_LIMITED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_INVITATION_REQUEST_ALLOWED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Invitation Request Allowed".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_INVITATION_REQUEST_ALLOWED
|
||||
= "Invitation Request Allowed";
|
||||
|
||||
/**
|
||||
* Indicates that all invitation requests are allowed.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_INVITATION_REQUEST_ALLOWED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_INVITATION_REQUEST_ALLOWED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_USER_REDIRECTED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "User Redirected".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_USER_REDIRECTED = "User Redirected";
|
||||
|
||||
/**
|
||||
* Indicates that all users which join this chat room are redirected to
|
||||
* another one.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_USER_REDIRECTED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_USER_REDIRECTED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_NICKNAMES_LOCKED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Nicknames Locked".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_NICKNAMES_LOCKED
|
||||
= "Nicknames Locked";
|
||||
|
||||
/**
|
||||
* Indicates that users in this chat room can not change their nickname.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_NICKNAMES_LOCKED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_NICKNAMES_LOCKED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_KICK_LOCKED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Kick Locked".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_KICK_LOCKED = "Kick Locked";
|
||||
|
||||
/**
|
||||
* Indicates that kicks are locked on this chat room. A kick tells the server
|
||||
* to force a user leave the chat room.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_KICK_LOCKED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_KICK_LOCKED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_USERS_REGISTERED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Only Registered User".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_ONLY_REGISTERED_USER
|
||||
= "Only Registered User";
|
||||
|
||||
/**
|
||||
* Indicates that only registered users can join this chat room.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_ONLY_REGISTERED_USER
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_ONLY_REGISTERED_USER);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_SPECIAL_MESSAGE_ALLOWED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Special Message Allowed".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_SPECIAL_MESSAGE_ALLOWED
|
||||
= "Special Messages Allowed";
|
||||
|
||||
/**
|
||||
* Indicates that the associated chat room allows special messages.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_SPECIAL_MESSAGES_ALLOWED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_SPECIAL_MESSAGE_ALLOWED);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_NICKNAME_LIST_VISIBLE configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Nickname List Visible".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_NICKNAME_LIST_VISIBLE
|
||||
= "Nickname List Visible";
|
||||
|
||||
/**
|
||||
* Indicates that the list of nicknames in this chat room is currently
|
||||
* visible.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_NICKNAME_LIST_VISIBLE
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_NICKNAME_LIST_VISIBLE);
|
||||
|
||||
/**
|
||||
* This constant contains the String representation of the
|
||||
* CHAT_ROOM_INVITATION_ALLOWED configuration parameter.
|
||||
* <p>
|
||||
* This constant has the String value "Invitation Allowed".
|
||||
*/
|
||||
protected static final String _CHAT_ROOM_INVITATION_ALLOWED
|
||||
= "Invitation Allowed";
|
||||
|
||||
/**
|
||||
* Indicates that users can invite other users in this chat room.
|
||||
*/
|
||||
public static final ChatRoomConfigParam CHAT_ROOM_INVITATION_ALLOWED
|
||||
= new ChatRoomConfigParam(_CHAT_ROOM_INVITATION_ALLOWED);
|
||||
|
||||
/**
|
||||
* A string representation of this Chat Room State.
|
||||
*/
|
||||
private String configParamString;
|
||||
|
||||
/**
|
||||
* Creates a chat room configuration parameter object with a value
|
||||
* corresponding to the specified string.
|
||||
*
|
||||
* @param configParamString a string representation of the configuration
|
||||
* parameter
|
||||
*/
|
||||
protected ChatRoomConfigParam(String configParamString)
|
||||
{
|
||||
this.configParamString = configParamString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a String representation of that chat room configuration parameter.
|
||||
*
|
||||
* @return a string value (one of the _CHAT_ROOM_XXX constants) representing
|
||||
* this chat room config parameter).
|
||||
*/
|
||||
public String getConfigParamString()
|
||||
{
|
||||
return configParamString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string represenation of this chat room configuration parameter.
|
||||
* Strings returned by this method have the following format:
|
||||
* "ChatRoomConfigParam:<CONFIG_PARAM_STRING>" and are meant to be used for
|
||||
* loggin/debugging purposes.
|
||||
*
|
||||
* @return a string representation of this object.
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return getClass().getName() + ":" + getConfigParamString();
|
||||
}
|
||||
}
|
||||
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol;
|
||||
|
||||
/**
|
||||
* Delivered when we receive an invitation for joining an existing chat room.
|
||||
* If the corresponding chat room requires a password, then it could be
|
||||
* retreived by the getPassword() method. The method would return null if no
|
||||
* password is necessary to join the specified chat room.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class InvitationReceivedEvent
|
||||
extends java.util.EventObject
|
||||
{
|
||||
|
||||
public InvitationReceivedEvent(ProtocolProviderService srcProvider,
|
||||
ChatRoom chatRoom)
|
||||
{
|
||||
super(srcProvider);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
/**
|
||||
* A listener that dispatches events notifying that an invitation to join a MUC
|
||||
* room is received.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface ChatRoomInvitationListener
|
||||
{
|
||||
/**
|
||||
* Called when we receive an invitation to join an existing <tt>ChatRoom</tt>.
|
||||
* <p>
|
||||
* @param evt the <tt>ChatRoomInvitationReceivedEvent</tt> that contains the
|
||||
* newly received invitation and its source provider.
|
||||
*/
|
||||
public abstract void invitationReceived(ChatRoomInvitationReceivedEvent evt);
|
||||
|
||||
}
|
||||
@ -0,0 +1,102 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* <tt>ChatRoomInvitationReceivedEvent</tt>s indicate reception of an
|
||||
* invitation to join a chat room.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public class ChatRoomInvitationReceivedEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* The chat room member that has sent this invitation.
|
||||
*/
|
||||
private ChatRoomMember from = null;
|
||||
|
||||
/**
|
||||
* The chat room member that is the target of this invitation.
|
||||
*/
|
||||
private ChatRoomMember to = null;
|
||||
|
||||
/**
|
||||
* A timestamp indicating the exact date when the event occurred.
|
||||
*/
|
||||
private Date timestamp = null;
|
||||
|
||||
/**
|
||||
* Creates an <tt>InvitationReceivedEvent</tt> representing reception of
|
||||
* the <tt>source</tt> invitation received from the specified
|
||||
* <tt>from</tt> chat room member.
|
||||
*
|
||||
* @param source the <tt>ChatRoomInvitation</tt> whose reception this event
|
||||
* represents.
|
||||
* @param from the <tt>ChatRoomMember</tt> that has sent this invitation.
|
||||
* @param to the <tt>ChatRoomMember</tt> that is the target of this
|
||||
* invitation.
|
||||
* @param timestamp the exact date when the event ocurred.
|
||||
*/
|
||||
public ChatRoomInvitationReceivedEvent(ChatRoomInvitation source,
|
||||
ChatRoomMember from, ChatRoomMember to, Date timestamp)
|
||||
{
|
||||
super(source);
|
||||
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the <tt>ChatRoomMember</tt> that has sent the
|
||||
* <tt>ChatRoomInvitation</tt> whose reception this event represents.
|
||||
*
|
||||
* @return a reference to the <tt>ChatRoomMember</tt> that has sent the
|
||||
* <tt>ChatRoomInvitation</tt> whose reception this event represents.
|
||||
*/
|
||||
public ChatRoomMember getFrom()
|
||||
{
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the <tt>ChatRoomMember</tt> that is the target
|
||||
* of the <tt>ChatRoomInvitation</tt> whose reception this event represents.
|
||||
*
|
||||
* @return a reference to the <tt>ChatRoomMember</tt> that is the target
|
||||
* of the <tt>ChatRoomInvitation</tt> whose reception this event represents.
|
||||
*/
|
||||
public ChatRoomMember getTo()
|
||||
{
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>ChatRoomInvitation</tt> that triggered this event
|
||||
*
|
||||
* @return the <tt>ChatRoomInvitation</tt> that triggered this event.
|
||||
*/
|
||||
public ChatRoomInvitation getSourceInvitation()
|
||||
{
|
||||
return (ChatRoomInvitation) getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* A timestamp indicating the exact date when the event ocurred.
|
||||
*
|
||||
* @return a Date indicating when the event ocurred.
|
||||
*/
|
||||
public Date getTimestamp()
|
||||
{
|
||||
return timestamp;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* <tt>ChatRoomInvitationRejectedEvent</tt>s indicates the reception of a
|
||||
* rejection of an invitation.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public class ChatRoomInvitationRejectedEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* The chat room member that has sent this rejection.
|
||||
*/
|
||||
private ChatRoomMember from = null;
|
||||
|
||||
/**
|
||||
* The chat room member that is the target of this rejection.
|
||||
*/
|
||||
private ChatRoomMember to = null;
|
||||
|
||||
/**
|
||||
* The reason why this invitation is rejected or null if there is no reason
|
||||
* specified.
|
||||
*/
|
||||
private String reason = null;
|
||||
|
||||
/**
|
||||
* A timestamp indicating the exact date when the event occurred.
|
||||
*/
|
||||
private Date timestamp = null;
|
||||
|
||||
/**
|
||||
* Creates a <tt>ChatRoomInvitationRejectedEvent</tt> representing the
|
||||
* rejection of the <tt>source</tt> invitation, rejected from the specified
|
||||
* <tt>from</tt> chat room member.
|
||||
*
|
||||
* @param source the <tt>ChatRoomInvitation</tt> whose rejection this event
|
||||
* represents
|
||||
* @param from the <tt>ChatRoomMember</tt> that has sent this invitation
|
||||
* rejection
|
||||
* @param to the <tt>ChatRoomMember</tt> that is the target of this
|
||||
* invitation rejection
|
||||
* @param timestamp the exact date when the event ocurred.
|
||||
*/
|
||||
public ChatRoomInvitationRejectedEvent(ChatRoomInvitation source,
|
||||
ChatRoomMember from, ChatRoomMember to, String reason, Date timestamp)
|
||||
{
|
||||
super(source);
|
||||
|
||||
this.from = from;
|
||||
this.to = to;
|
||||
this.reason = reason;
|
||||
this.timestamp = timestamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the <tt>ChatRoomMember</tt> that has sent the
|
||||
* rejection.
|
||||
*
|
||||
* @return a reference to the <tt>ChatRoomMember</tt> that has sent the
|
||||
* rejection
|
||||
*/
|
||||
public ChatRoomMember getFrom()
|
||||
{
|
||||
return from;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a reference to the <tt>ChatRoomMember</tt> that is the target of
|
||||
* this rejection.
|
||||
*
|
||||
* @return a reference to the <tt>ChatRoomMember</tt> that is the target of
|
||||
* this rejection
|
||||
*/
|
||||
public ChatRoomMember getTo()
|
||||
{
|
||||
return to;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the reason for which the <tt>ChatRoomInvitation</tt> is rejected.
|
||||
*
|
||||
* @return the reason for which the <tt>ChatRoomInvitation</tt> is rejected.
|
||||
*/
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>ChatRoomInvitation</tt> that was rejected.
|
||||
*
|
||||
* @return the <tt>ChatRoomInvitation</tt> that was rejected.
|
||||
*/
|
||||
public ChatRoomInvitation getSourceInvitation()
|
||||
{
|
||||
return (ChatRoomInvitation)getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* A timestamp indicating the exact date when the event ocurred.
|
||||
* @return a Date indicating when the event ocurred.
|
||||
*/
|
||||
public Date getTimestamp()
|
||||
{
|
||||
return timestamp;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
/**
|
||||
* A listener that dispatches events notifying that an invitation which was
|
||||
* sent earlier has been rejected by the invitee.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface ChatRoomInvitationRejectionListener
|
||||
{
|
||||
/**
|
||||
* Called when an invitee rejects an invitation previously sent by us.
|
||||
*
|
||||
* @param evt the instance of the <tt>ChatRoomInvitationRejectedEvent</tt>
|
||||
* containing the rejected chat room invitation as well as the source
|
||||
* provider where this happened.
|
||||
*/
|
||||
public void invitationRejected(ChatRoomInvitationRejectedEvent evt);
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.EventObject;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* Dispatched to notify interested parties that a change in our presence in
|
||||
* the source chat room has occured. Changes may include us being kicked, join,
|
||||
* left, etc.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public class ChatRoomLocalUserPresenceChangeEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the local
|
||||
* participant joining the source chat room.
|
||||
*/
|
||||
public static final String LOCAL_USER_JOINED = "LocalUserJoined";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the local
|
||||
* participant leaving the chat room.
|
||||
*/
|
||||
public static final String LOCAL_USER_LEFT = "LocalUserLeft";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the local
|
||||
* participant being kicked from the source chat room.
|
||||
*/
|
||||
public static final String LOCAL_USER_KICKED = "LocalUserKicked";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the local
|
||||
* participant beeing disconnected from the server brutally, or ping timeout.
|
||||
*/
|
||||
public static final String LOCAL_USER_QUIT = "LocalUserQuit";
|
||||
|
||||
/**
|
||||
* The type of this event. Values can be any of the LOCAL_USER_XXX fields.
|
||||
*/
|
||||
private String eventType = null;
|
||||
|
||||
/**
|
||||
* An optional String indicating a possible reason as to why the event
|
||||
* might have occurred.
|
||||
*/
|
||||
private String reason = null;
|
||||
|
||||
|
||||
/**
|
||||
* Creates a <tt>ChatRoomLocalUserPresenceChangeEvent</tt> representing that
|
||||
* a change in local participant presence in the source chat room has
|
||||
* occured.
|
||||
*
|
||||
* @param sourceRoom the <tt>ChatRoom</tt> that produced this event
|
||||
* @param eventType the type of this event. One of the LOCAL_USER_XXX
|
||||
* constants
|
||||
* @param reason the reason explaining why this event might have occurred
|
||||
*/
|
||||
public ChatRoomLocalUserPresenceChangeEvent(ChatRoom sourceRoom,
|
||||
String eventType,
|
||||
String reason)
|
||||
{
|
||||
super(sourceRoom);
|
||||
|
||||
this.eventType = eventType;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>ChatRoom</tt>, where this event has occurred.
|
||||
*
|
||||
* @return the <tt>ChatRoom</tt>, where this event has occurred
|
||||
*/
|
||||
public ChatRoom getChatRoom()
|
||||
{
|
||||
return (ChatRoom) getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* A reason string indicating a human readable reason for this event.
|
||||
*
|
||||
* @return a human readable String containing the reason for this event,
|
||||
* or null if no particular reason was specified
|
||||
*/
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of this event which could be one of the LOCAL_USER_XXX
|
||||
* member fields.
|
||||
*
|
||||
* @return one of the LOCAL_USER_XXX fields indicating the type of this event.
|
||||
*/
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a String representation of this event.
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return "ChatRoomLocalUserPresenceChangeEvent[type="
|
||||
+ getEventType()
|
||||
+ " sourceRoom="
|
||||
+ getChatRoom()
|
||||
+ "]";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A listener that will be notified of changes in our presence in the chat
|
||||
* room such as us being kicked, join, left.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface ChatRoomLocalUserPresenceListener
|
||||
extends EventListener
|
||||
{
|
||||
/**
|
||||
* Called to notify interested parties that a change in our presence in the
|
||||
* source chat room has occured. Changes may include us being kicked, join,
|
||||
* left.
|
||||
* @param evt the <tt>ChatRoomLocalUserPresenceChangeEvent</tt> instance
|
||||
* containing the source chat room and the type, and reason of the change
|
||||
*/
|
||||
public void localUserPresenceChanged(ChatRoomLocalUserPresenceChangeEvent evt);
|
||||
}
|
||||
@ -0,0 +1,82 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* Dispatched to notify interested parties that a change in our role in the
|
||||
* source chat room has occurred. Changes may include us being granted admin
|
||||
* permissions, or other permissions.
|
||||
*
|
||||
* @see ChatRoomMemberRole
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public class ChatRoomLocalUserRoleChangeEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* The previous role that local participant had.
|
||||
*/
|
||||
private ChatRoomMemberRole previousRole = null;
|
||||
|
||||
/**
|
||||
* The new role that local participant get.
|
||||
*/
|
||||
private ChatRoomMemberRole newRole = null;
|
||||
|
||||
/**
|
||||
* Creates a <tt>ChatRoomLocalUserRoleChangeEvent</tt> representing that
|
||||
* a change in local participant role in the source chat room has
|
||||
* occured.
|
||||
*
|
||||
* @param sourceRoom the <tt>ChatRoom</tt> that produced the event
|
||||
* @param previousRole the previous role that local participant had
|
||||
* @param newRole the new role that local participant get
|
||||
*/
|
||||
public ChatRoomLocalUserRoleChangeEvent(ChatRoom sourceRoom,
|
||||
ChatRoomMemberRole previousRole,
|
||||
ChatRoomMemberRole newRole)
|
||||
{
|
||||
super(sourceRoom);
|
||||
this.previousRole = previousRole;
|
||||
this.newRole = newRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the new role the local participant get.
|
||||
*
|
||||
* @return newRole the new role the local participant get
|
||||
*/
|
||||
public ChatRoomMemberRole getNewRole()
|
||||
{
|
||||
return newRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the previous role that local participant had.
|
||||
*
|
||||
* @return previousRole the previous role that local participant had
|
||||
*/
|
||||
public ChatRoomMemberRole getPreviousRole()
|
||||
{
|
||||
return previousRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the <tt>ChatRoom</tt>, where this event occured.
|
||||
*
|
||||
* @return the <tt>ChatRoom</tt>, where this event occured
|
||||
*/
|
||||
public ChatRoom getSourceChatRoom()
|
||||
{
|
||||
return (ChatRoom)getSource();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A listener that will be notified of changes in the role of the local
|
||||
* user participant in a particular chat room. Changes could be us being granted
|
||||
* any of the roles defined in <tt>ChatRoomMemberRole</tt>.
|
||||
*
|
||||
* @see ChatRoomMemberRole
|
||||
*
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public interface ChatRoomLocalUserRoleListener
|
||||
extends EventListener
|
||||
{
|
||||
/**
|
||||
* Called to notify interested parties that a change in the role of the
|
||||
* local user participant in a particular chat room has occurred.
|
||||
* @param evt the <tt>ChatRoomLocalUserRoleChangeEvent</tt> instance
|
||||
* containing the source chat room and role old and new state.
|
||||
*/
|
||||
public void localUserRoleChanged(ChatRoomLocalUserRoleChangeEvent evt);
|
||||
}
|
||||
@ -1,23 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
/**
|
||||
* Dispatched to notify interested parties that a change in our status in the
|
||||
* source room has changed. Changes may include us being kicked, banned, or
|
||||
* granted admin permissions.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class ChatRoomLocalUserStatusChangeEvent
|
||||
{
|
||||
public ChatRoomLocalUserStatusChangeEvent()
|
||||
{
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Adds a listener that will be notified of changes in our status in the room
|
||||
* such as us being kicked, banned, or granted admin permissions.
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface ChatRoomLocalUserStatusListener
|
||||
extends EventListener
|
||||
{
|
||||
/**
|
||||
* Called to notify interested parties that a change in our status in the
|
||||
* source soom has changed. Changes may include us being kicked, banned, or
|
||||
* granted admin permissions.
|
||||
*/
|
||||
public void localUserStatusChanged(ChatRoomLocalUserStatusChangeEvent evt);
|
||||
}
|
||||
@ -1,124 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* Dispatched to notify interested parties that a change in the status of the
|
||||
* source room participant has changed. Changes may include the participant
|
||||
* being kicked, banned, or granted admin permissions.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class ChatRoomMemberEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the source
|
||||
* participant joining the source chat room.
|
||||
*/
|
||||
public static final String MEMBER_JOINED = "MemberJoined";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the source
|
||||
* participant being "kicked" out of the chat room.
|
||||
*/
|
||||
public static final String MEMBER_LEFT = "MemberJoined";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the source
|
||||
* participant leaving the source chat room.
|
||||
*/
|
||||
public static final String MEMBER_KICKED = "MemberKicked";
|
||||
|
||||
/**
|
||||
* The member that the event relates to.
|
||||
*/
|
||||
private ChatRoomMember sourceMember = null;
|
||||
|
||||
/**
|
||||
* The type of this event. Values can be any of the MEMBER_XXX-ED fields.
|
||||
*/
|
||||
private String eventType = null;
|
||||
|
||||
/**
|
||||
* An optional String indicating a possible reason as to why the event
|
||||
* might have occurred.
|
||||
*/
|
||||
private String reason = null;
|
||||
|
||||
|
||||
public ChatRoomMemberEvent(ChatRoom sourceRoom,
|
||||
ChatRoomMember sourceMember,
|
||||
String eventType,
|
||||
String reason )
|
||||
{
|
||||
super(sourceRoom);
|
||||
this.sourceMember = sourceMember;
|
||||
this.eventType = eventType;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the source chat room for this event.
|
||||
*
|
||||
* @return the <tt>ChatRoom</tt> associated with that is the source of this
|
||||
* event and that the corresponding ChatRoomMemberBelongs to.
|
||||
*/
|
||||
public ChatRoom getChatRoom()
|
||||
{
|
||||
return (ChatRoom)getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the member that this event is pertaining to.
|
||||
* @return the <tt>ChatRoomMember</tt> that this event is pertaining to.
|
||||
*/
|
||||
public ChatRoomMember getChatRoomMember()
|
||||
{
|
||||
return sourceMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* A reason string indicating a human readable reason for this event.
|
||||
*
|
||||
* @return a human readable String containing the reason for this event,
|
||||
* or null if no particular reason was specified.
|
||||
*/
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of this event which could be one of the MEMBER_XXX-ed
|
||||
* member field values.
|
||||
*
|
||||
* @return one of the MEMBER_XXXed member field values indicating the type
|
||||
* of this event.
|
||||
*/
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a String representation of this event.
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return "ChatRoomMemberEvent[type="
|
||||
+ getEventType()
|
||||
+ " sourceRoom="
|
||||
+ getChatRoom()
|
||||
+ " member="
|
||||
+ getChatRoomMember()
|
||||
+ "]";
|
||||
}
|
||||
}
|
||||
@ -1,27 +0,0 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Adds a listener that will be notified of changes in the status of the chat
|
||||
* participants in a particular chat room, such as us being kicked, banned, or
|
||||
* granted admin permissions.
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface ChatRoomMemberListener
|
||||
extends EventListener
|
||||
{
|
||||
/**
|
||||
* Called to notify interested parties that a change in the status of the
|
||||
* source room participant has changed. Changes may include the participant
|
||||
* being kicked, banned, or granted admin permissions.
|
||||
*/
|
||||
public void memberStatusChanged( ChatRoomMemberEvent evt );
|
||||
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* Dispatched to notify interested parties that a change in the presence of a
|
||||
* chat room member has occurred. Changes may include the participant
|
||||
* being kicked, join, left...
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public class ChatRoomMemberPresenceChangeEvent
|
||||
extends EventObject
|
||||
{
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the participant
|
||||
* joining the source chat room.
|
||||
*/
|
||||
public static final String MEMBER_JOINED = "MemberJoined";
|
||||
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the participant
|
||||
* leaving the source chat room.
|
||||
*/
|
||||
public static final String MEMBER_LEFT = "MemberLeft";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the participant
|
||||
* being "kicked" out of the chat room.
|
||||
*/
|
||||
public static final String MEMBER_KICKED = "MemberKicked";
|
||||
|
||||
/**
|
||||
* Indicates that this event was triggered as a result of the participant
|
||||
* being disconnected from the server brutally, or due to a ping timeout.
|
||||
*/
|
||||
public static final String MEMBER_QUIT = "MemberQuit";
|
||||
|
||||
/**
|
||||
* The chat room member that the event relates to.
|
||||
*/
|
||||
private ChatRoomMember sourceMember = null;
|
||||
|
||||
/**
|
||||
* The type of this event. Values can be any of the MEMBER_XXX fields.
|
||||
*/
|
||||
private String eventType = null;
|
||||
|
||||
/**
|
||||
* An optional String indicating a possible reason as to why the event
|
||||
* might have occurred.
|
||||
*/
|
||||
private String reason = null;
|
||||
|
||||
/**
|
||||
* Creates a <tt>ChatRoomMemberPresenceChangeEvent</tt> representing that
|
||||
* a change in the presence of a <tt>ChatRoomMember</tt> has occurred.
|
||||
* Changes may include the participant being kicked, join, left, etc.
|
||||
*
|
||||
* @param sourceRoom the <tt>ChatRoom</tt> that produced this event
|
||||
* @param sourceMember the <tt>ChatRoomMember</tt> that this event is about
|
||||
* @param eventType the event type; one of the MEMBER_XXX constants
|
||||
* @param reason the reason explaining why this event might have occurred
|
||||
*/
|
||||
public ChatRoomMemberPresenceChangeEvent( ChatRoom sourceRoom,
|
||||
ChatRoomMember sourceMember,
|
||||
String eventType,
|
||||
String reason )
|
||||
{
|
||||
super(sourceRoom);
|
||||
this.sourceMember = sourceMember;
|
||||
this.eventType = eventType;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chat room that produced this event.
|
||||
*
|
||||
* @return the <tt>ChatRoom</tt> that produced this event
|
||||
*/
|
||||
public ChatRoom getChatRoom()
|
||||
{
|
||||
return (ChatRoom)getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chat room member that this event is about.
|
||||
*
|
||||
* @return the <tt>ChatRoomMember</tt> that this event is about.
|
||||
*/
|
||||
public ChatRoomMember getChatRoomMember()
|
||||
{
|
||||
return sourceMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* A reason String indicating a human readable reason for this event.
|
||||
*
|
||||
* @return a human readable String containing the reason for this event,
|
||||
* or null if no particular reason was specified.
|
||||
*/
|
||||
public String getReason()
|
||||
{
|
||||
return reason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the type of this event which could be one of the MEMBER_XXX
|
||||
* member field values.
|
||||
*
|
||||
* @return one of the MEMBER_XXX member field values indicating the type
|
||||
* of this event.
|
||||
*/
|
||||
public String getEventType()
|
||||
{
|
||||
return eventType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a String representation of this event.
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return "ChatRoomMemberPresenceChangeEvent[type="
|
||||
+ getEventType()
|
||||
+ " sourceRoom="
|
||||
+ getChatRoom().toString()
|
||||
+ " member="
|
||||
+ getChatRoomMember().toString()
|
||||
+ "]";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A listener that will be notified of changes in the presence of a member in a
|
||||
* particular chat room. Changes may include member being kicked, join, left.
|
||||
*
|
||||
* @author Emil Ivov
|
||||
*/
|
||||
public interface ChatRoomMemberPresenceListener
|
||||
extends EventListener
|
||||
{
|
||||
/**
|
||||
* Called to notify interested parties that a change in the presence of a
|
||||
* member in a particular chat room has occurred. Changes may include member
|
||||
* being kicked, join, left.
|
||||
*
|
||||
* @param evt the <tt>ChatRoomMemberPresenceChangeEvent</tt> instance
|
||||
* containing the source chat room and type, and reason of the presence
|
||||
* change
|
||||
*/
|
||||
public void memberPresenceChanged(ChatRoomMemberPresenceChangeEvent evt );
|
||||
|
||||
}
|
||||
@ -1,23 +1,99 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import net.java.sip.communicator.service.protocol.*;
|
||||
|
||||
/**
|
||||
* <p> </p>
|
||||
*
|
||||
* <p> </p>
|
||||
*
|
||||
* <p> </p>
|
||||
*
|
||||
* <p> </p>
|
||||
* Dispatched to notify interested parties that a change in a member role in the
|
||||
* source room has occurred. Changes may include member being granted admin
|
||||
* permissions, or other permissions.
|
||||
*
|
||||
* @see ChatRoomMemberRole
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public class ChatRoomMemberRoleChangeEvent
|
||||
extends EventObject
|
||||
{
|
||||
public ChatRoomMemberRoleChangeEvent(Object source)
|
||||
/**
|
||||
* The member that the event relates to.
|
||||
*/
|
||||
private ChatRoomMember sourceMember = null;
|
||||
|
||||
/**
|
||||
* The previous role that this member had.
|
||||
*/
|
||||
private ChatRoomMemberRole previousRole = null;
|
||||
|
||||
/**
|
||||
* The new role that this member get.
|
||||
*/
|
||||
private ChatRoomMemberRole newRole = null;
|
||||
|
||||
/**
|
||||
* Creates a <tt>ChatRoomMemberRoleChangeEvent</tt> representing that
|
||||
* a change in member role in the source chat room has occured.
|
||||
*
|
||||
* @param sourceRoom the <tt>ChatRoom</tt> that produced this event
|
||||
* @param sourceMember the <tt>ChatRoomMember</tt> that this event is about
|
||||
* @param previousRole the previous role that member had
|
||||
* @param newRole the new role that member get
|
||||
*/
|
||||
public ChatRoomMemberRoleChangeEvent(ChatRoom sourceRoom,
|
||||
ChatRoomMember sourceMember,
|
||||
ChatRoomMemberRole previousRole,
|
||||
ChatRoomMemberRole newRole)
|
||||
{
|
||||
super(sourceRoom);
|
||||
this.sourceMember = sourceMember;
|
||||
this.previousRole = previousRole;
|
||||
this.newRole = newRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the new role given to the member that this event is about.
|
||||
*
|
||||
* @return the new role given to the member that this event is about
|
||||
*/
|
||||
public ChatRoomMemberRole getNewRole()
|
||||
{
|
||||
return newRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the previous role the member that this event is about had.
|
||||
*
|
||||
* @return the previous role the member that this event is about had
|
||||
*/
|
||||
public ChatRoomMemberRole getPreviousRole()
|
||||
{
|
||||
return previousRole;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the chat room that produced this event.
|
||||
*
|
||||
* @return the <tt>ChatRoom</tt> that produced this event
|
||||
*/
|
||||
public ChatRoom getSourceChatRoom()
|
||||
{
|
||||
return (ChatRoom)getSource();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the member that this event is about.
|
||||
* @return the <tt>ChatRoomMember</tt> that this event is about
|
||||
*/
|
||||
public ChatRoomMember getSourceMember()
|
||||
{
|
||||
super(source);
|
||||
return sourceMember;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
package net.java.sip.communicator.service.protocol.event;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* A listener that will be notified of changes in the role of a chat
|
||||
* participant in a particular chat room. Changes may include participant being
|
||||
* granted any of the roles defined in <tt>ChatRoomMemberRole</tt>.
|
||||
*
|
||||
* @see ChatRoomMemberRole
|
||||
*
|
||||
* @author Emil Ivov
|
||||
* @author Stephane Remy
|
||||
*/
|
||||
public interface ChatRoomMemberRoleListener
|
||||
extends EventListener
|
||||
{
|
||||
/**
|
||||
* Called to notify interested parties that a change in the role of a
|
||||
* chat room member has occurred.
|
||||
*
|
||||
* @param evt the <tt>ChatRoomMemberRoleChangeEvent</tt> instance
|
||||
* containing the source chat room and role old and new state.
|
||||
*/
|
||||
public void memberRoleChanged(ChatRoomMemberRoleChangeEvent evt);
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue