public final class ChatRoom extends Chat implements Comparable<ChatRoom>
| Modifier and Type | Method and Description |
|---|---|
void |
addInvitationDeclineListener(InvitationDeclineListener invitationDeclineListener)
Adds a invitation decline listener, which allows to listen for invitation declines.
|
void |
addOccupantListener(OccupantListener occupantListener)
Adds an occupant listener, which allows to listen for presence changes of occupants, e.g.
|
void |
addSubjectChangeListener(SubjectChangeListener subjectChangeListener)
Adds a subject change listener, which allows to listen for subject changes.
|
void |
changeAffiliation(Affiliation affiliation,
Jid user,
String reason)
Changes the affiliation for an user.
|
void |
changeAffiliationsOrRoles(List<Item> items)
Changes multiple affiliations or roles.
|
void |
changeAvailabilityStatus(AbstractPresence.Show show,
String status)
Changes the availability status.
|
void |
changeNickname(String newNickname)
Changes the nickname.
|
void |
changeRole(Role role,
String nickname,
String reason)
Changes the role for an occupant.
|
void |
changeSubject(String subject)
Changes the room subject.
|
int |
compareTo(ChatRoom o)
Compares this chat service first by their name and then by their service address.
|
void |
configure(RoomConfiguration roomConfiguration)
Configures this room.
|
void |
createRoom()
Creates an instant room.
|
void |
destroy(String reason)
Destroys the room.
|
Set<Feature> |
discoverAllowableTraffic()
Discovers the allowable traffic, i.e. the allowed extensions.
|
List<String> |
discoverOccupants()
Gets the occupants in this room, i.e. their nicknames.
|
String |
discoverReservedNickname()
Gets your reserved room nickname.
|
void |
enter(String nick)
Enters the room.
|
void |
enter(String nick,
History history)
Enters the room and requests history messages.
|
void |
enter(String nick,
String password)
Enters the room with a password.
|
void |
enter(String nick,
String password,
History history)
Enters the room with a password and requests history messages.
|
void |
exit()
Exits the room.
|
void |
exit(String message)
Exits the room with a custom message.
|
Jid |
getAddress()
Gets the room address.
|
List<? extends Item> |
getBanList()
Gets the ban list.
|
DataForm |
getConfigurationForm()
Gets the configuration form for the room.
|
List<? extends Item> |
getMembers()
Gets the members of the room.
|
List<? extends Item> |
getModerators()
Gets the moderators.
|
String |
getName()
Gets the name for this room.
|
Occupant |
getOccupant(String nickname)
Gets an occupant by nickname.
|
Collection<Occupant> |
getOccupants()
Gets the occupants, while being in the room.
|
DataForm |
getRegistrationForm()
Gets the data form necessary to register with the room.
|
RoomInformation |
getRoomInformation()
Gets the room information for this chat room.
|
List<? extends Item> |
getVoiceList()
Gets the voice list.
|
void |
invite(Jid invitee,
String reason)
Invites another user to the room.
|
void |
invite(Jid invitee,
String reason,
boolean direct)
Invites another user to the room.
|
void |
register(Registration registration)
Registers with the room.
|
void |
removeInvitationDeclineListener(InvitationDeclineListener invitationDeclineListener)
Removes a previously added invitation decline listener.
|
void |
removeOccupantListener(OccupantListener occupantListener)
Removes a previously added occupant listener.
|
void |
removeSubjectChangeListener(SubjectChangeListener subjectChangeListener)
Removes a previously added subject change listener.
|
void |
requestVoice()
Requests voice in a moderated room.
|
Message |
sendMessage(Message message)
Sends a message to the room.
|
Message |
sendMessage(String message)
Sends a message to the room.
|
void |
submitConfigurationForm(DataForm dataForm)
Deprecated.
|
void |
submitRegistrationForm(DataForm dataForm)
Deprecated.
|
String |
toString() |
addInboundMessageListener, removeInboundMessageListenerpublic void addInvitationDeclineListener(InvitationDeclineListener invitationDeclineListener)
invitationDeclineListener - The listener.removeInvitationDeclineListener(InvitationDeclineListener)public void removeInvitationDeclineListener(InvitationDeclineListener invitationDeclineListener)
invitationDeclineListener - The listener.addInvitationDeclineListener(InvitationDeclineListener)public void addSubjectChangeListener(SubjectChangeListener subjectChangeListener)
subjectChangeListener - The listener.removeSubjectChangeListener(SubjectChangeListener)public void removeSubjectChangeListener(SubjectChangeListener subjectChangeListener)
subjectChangeListener - The listener.addSubjectChangeListener(SubjectChangeListener)public void addOccupantListener(OccupantListener occupantListener)
occupantListener - The listener.removeOccupantListener(OccupantListener)public void removeOccupantListener(OccupantListener occupantListener)
occupantListener - The listener.addOccupantListener(OccupantListener)public void enter(String nick) throws XmppException
nick - The nickname.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void enter(String nick, String password) throws XmppException
nick - The nickname.password - The password.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void enter(String nick, History history) throws XmppException
nick - The nickname.history - The history.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void enter(String nick, String password, History history) throws XmppException
nick - The nickname.password - The password.history - The history.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void changeSubject(String subject) throws XmppException
subject - The subject.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic Message sendMessage(String message)
sendMessage in class Chatmessage - The message text.public Message sendMessage(Message message)
sendMessage in class Chatmessage - The message.public void changeNickname(String newNickname) throws XmppException
newNickname - The new nickname.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void changeAvailabilityStatus(AbstractPresence.Show show, String status)
show - The 'show' value.status - The status.public void invite(Jid invitee, String reason)
invitee - The invitee.reason - The reason.public void invite(Jid invitee, String reason, boolean direct)
invitee - The invitee.reason - The reason.direct - True, if the message is sent directly to the invitee; false if it is mediated by the room.public DataForm getRegistrationForm() throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionRoomRegistration@Deprecated public void submitRegistrationForm(DataForm dataForm) throws XmppException
register(rocks.xmpp.extensions.register.model.Registration)dataForm - The data form.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionRoomRegistrationpublic void register(Registration registration) throws XmppException
registration - The registration.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionRoomRegistrationpublic String discoverReservedNickname() throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void requestVoice()
public void exit()
throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void exit(String message) throws XmppException
message - The exit message.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic List<? extends Item> getVoiceList() throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic void changeAffiliationsOrRoles(List<Item> items) throws XmppException
items - The items.StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic List<? extends Item> getBanList() throws XmppException
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic void changeAffiliation(Affiliation affiliation, Jid user, String reason) throws XmppException
Use this method for one of the following use cases:
Affiliation.OUTCAST)Affiliation.MEMBER)Affiliation.NONE)Affiliation.ADMIN)Affiliation.MEMBER)Affiliation.OWNER)Affiliation.ADMIN)affiliation - The new affiliation for the user.user - The user.reason - The reason.StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic void changeRole(Role role, String nickname, String reason) throws XmppException
Use this method for one of the following use cases:
Role.NONE)Role.PARTICIPANT)Role.VISITOR)Role.MODERATOR)Role.PARTICIPANT)role - The new role for the user.nickname - The occupant's nickname.reason - The reason.StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic List<? extends Item> getMembers() throws XmppException
In the context of a members-only room, the member list is essentially a "whitelist" of people who are allowed to enter the room.
In the context of an open room, the member list is simply a list of users (bare JID and reserved nick) who are registered with the room.
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic List<? extends Item> getModerators() throws XmppException
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic void createRoom()
throws XmppException
StanzaException - If the entity returned a stanza error.NoResponseException - If the entity did not respond.XmppExceptionpublic RoomInformation getRoomInformation() throws XmppException
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic List<String> discoverOccupants() throws XmppException
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptiongetOccupants()public Collection<Occupant> getOccupants()
public Occupant getOccupant(String nickname)
nickname - The occupant's nickname.public DataForm getConfigurationForm() throws XmppException
RoomConfiguration for easier processing.
Use this method if you want to create a reserved room or configure an existing room.
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionRoomConfiguration,
10.1.3 Creating a Reserved Room,
configure(rocks.xmpp.extensions.muc.model.RoomConfiguration)@Deprecated public void submitConfigurationForm(DataForm dataForm) throws XmppException
configure(rocks.xmpp.extensions.muc.model.RoomConfiguration)dataForm - The data form.StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptiongetConfigurationForm()public void configure(RoomConfiguration roomConfiguration) throws XmppException
roomConfiguration - The room configuration form.StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptiongetConfigurationForm()public String getName()
public void destroy(String reason) throws XmppException
reason - The reason for the room destruction.StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic Jid getAddress()
public Set<Feature> discoverAllowableTraffic() throws XmppException
StanzaException - If the chat service returned a stanza error.NoResponseException - If the chat service did not respond.XmppExceptionpublic int compareTo(ChatRoom o)
compareTo in interface Comparable<ChatRoom>o - The other chat service.Copyright © 2014–2015 XMPP.rocks. All rights reserved.