/** * Make the room password protected. * * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager makePasswordProtected() throws MucConfigurationNotSupportedException { return setIsPasswordProtected(true); }
/** * Build a new {@link MucEnterConfiguration} with the current builder. * * @return a new {@code MucEnterConfiguration}. */ public MucEnterConfiguration build() { return new MucEnterConfiguration(this); }
/** * Returns a list of <code>Occupant</code> with the room moderators. * * @return a list of <code>Occupant</code> with the room moderators. * @throws XMPPErrorException if you don't have enough privileges to get this information. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public List<Occupant> getModerators() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getOccupants(MUCRole.moderator); }
public MucNotJoinedException(MultiUserChat multiUserChat) { super("Client not currently joined " + multiUserChat.getRoom()); } }
/** * Returns a list of <code>Affiliate</code> with the room owners. * * @return a list of <code>Affiliate</code> with the room owners. * @throws XMPPErrorException if you don't have enough privileges to get this information. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public List<Affiliate> getOwners() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getAffiliatesByAdmin(MUCAffiliation.owner); }
/** * Grants membership to a user. Only administrators are able to grant membership. A user * that becomes a room member will be able to enter a room of type Members-Only (i.e. a room * that a user cannot enter without being on the member list). * * @param jid the XMPP user ID of the user to grant membership (e.g. "user@host.org"). * @throws XMPPErrorException if an error occurs granting membership to a user. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void grantMembership(Jid jid) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeAffiliationByAdmin(jid, MUCAffiliation.member, null); }
/** * Returns the Occupant information for a particular occupant, or <tt>null</tt> if the * user is not in the room. The Occupant object may include information such as full * JID of the user as well as the role and affiliation of the user in the room.<p> * * @param user the room occupant to search for his presence. The format of user must * be: roomName@service/nickname (e.g. darkcave@macbeth.shakespeare.lit/thirdwitch). * @return the Occupant or <tt>null</tt> if the user is unavailable (i.e. not in the room). */ public Occupant getOccupant(EntityFullJid user) { Presence presence = getOccupantPresence(user); if (presence != null) { return new Occupant(presence); } return null; }
/** * Create or join the MUC room with the given nickname. * * @param nickname the nickname to use in the MUC room. * @return A {@link MucCreateConfigFormHandle} if the room was created while joining, or {@code null} if the room was just joined. * @throws NoResponseException * @throws XMPPErrorException * @throws InterruptedException * @throws NotConnectedException * @throws MucAlreadyJoinedException * @throws NotAMucServiceException */ public synchronized MucCreateConfigFormHandle createOrJoin(Resourcepart nickname) throws NoResponseException, XMPPErrorException, InterruptedException, MucAlreadyJoinedException, NotConnectedException, NotAMucServiceException { MucEnterConfiguration mucEnterConfiguration = getEnterConfigurationBuilder(nickname).build(); return createOrJoin(mucEnterConfiguration); }
/** * Grants moderator privileges to participants or visitors. Room administrators may grant * moderator privileges. A moderator is allowed to kick users, grant and revoke voice, invite * other users, modify room's subject plus all the partcipants privileges. * * @param nicknames the nicknames of the occupants to grant moderator privileges. * @throws XMPPErrorException if an error occurs granting moderator privileges to a user. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void grantModerator(Collection<Resourcepart> nicknames) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeRole(nicknames, MUCRole.moderator); }
/** * Set a password and make the room password protected. Users will need to supply the password * to join the room. * * @param password the password to set. * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager setAndEnablePassword(String password) throws MucConfigurationNotSupportedException { return setIsPasswordProtected(true).setRoomSecret(password); }
/** * Remove all callbacks and resources necessary when the user has left the room for some reason. */ private synchronized void userHasLeft() { // We do not reset nickname here, in case this method has been called erroneously, it should still be possible // to call leave() in order to resync the state. And leave() requires the nickname to send the unsubscribe // presence. occupantsMap.clear(); joined = false; // Update the list of joined rooms multiUserChatManager.removeJoinedRoom(room); removeConnectionCallbacks(); }
/** * Make the room for members only. * * @return a reference to this object. * @throws MucConfigurationNotSupportedException */ public MucConfigFormManager makeMembersOnly() throws MucConfigurationNotSupportedException { return setMembersOnly(true); }
/** * Set a callback invoked by this manager when automatic join on reconnect failed. If failedCallback is not * <code>null</code>,then automatic rejoin get also enabled. * * @param failedCallback the callback. */ public void setAutoJoinFailedCallback(AutoJoinFailedCallback failedCallback) { autoJoinFailedCallback = failedCallback; if (failedCallback != null) { setAutoJoinOnReconnect(true); } }
/** * Returns a list of <code>Occupant</code> with the room participants. * * @return a list of <code>Occupant</code> with the room participants. * @throws XMPPErrorException if you don't have enough privileges to get this information. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public List<Occupant> getParticipants() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getOccupants(MUCRole.participant); }
/** * Returns a list of <code>Affiliate</code> with the room outcasts. * * @return a list of <code>Affiliate</code> with the room outcasts. * @throws XMPPErrorException if you don't have enough privileges to get this information. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public List<Affiliate> getOutcasts() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getAffiliatesByAdmin(MUCAffiliation.outcast); }
/** * Revokes ownership privileges from other users. The occupant that loses ownership * privileges will become an administrator. Room owners may revoke ownership privileges. * Some room implementations will not allow to grant ownership privileges to other users. * * @param jids the bare XMPP user IDs of the users to revoke ownership. * @throws XMPPErrorException if an error occurs revoking ownership privileges from a user. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void revokeOwnership(Collection<? extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeAffiliationByAdmin(jids, MUCAffiliation.admin); }
/** * Returns a list of <code>Affiliate</code> with the room members. * * @return a list of <code>Affiliate</code> with the room members. * @throws XMPPErrorException if you don't have enough privileges to get this information. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public List<Affiliate> getMembers() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getAffiliatesByAdmin(MUCAffiliation.member); }
/** * Grants administrator privileges to other users. Room owners may grant administrator * privileges to a member or unaffiliated user. An administrator is allowed to perform * administrative functions such as banning users and edit moderator list. * * @param jids the bare XMPP user IDs of the users to grant administrator privileges. * @throws XMPPErrorException if an error occurs granting administrator privileges to a user. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void grantAdmin(Collection<? extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeAffiliationByAdmin(jids, MUCAffiliation.admin); }
/** * Returns a list of <code>Affiliate</code> with the room administrators. * * @return a list of <code>Affiliate</code> with the room administrators. * @throws XMPPErrorException if you don't have enough privileges to get this information. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public List<Affiliate> getAdmins() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { return getAffiliatesByAdmin(MUCAffiliation.admin); }
/** * Revokes administrator privileges from users. The occupant that loses administrator * privileges will become a member. Room owners may revoke administrator privileges from * a member or unaffiliated user. * * @param jids the bare XMPP user IDs of the user to revoke administrator privileges. * @throws XMPPErrorException if an error occurs revoking administrator privileges from a user. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void revokeAdmin(Collection<? extends Jid> jids) throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException { changeAffiliationByAdmin(jids, MUCAffiliation.admin); }