1 11 12 package org.jivesoftware.messenger.muc; 13 14 import java.util.List ; 15 import java.util.Date ; 16 import java.util.Collection ; 17 18 import org.dom4j.Element; 19 import org.jivesoftware.messenger.muc.spi.IQAdminHandler; 20 import org.jivesoftware.messenger.muc.spi.IQOwnerHandler; 21 import org.jivesoftware.util.NotFoundException; 22 import org.jivesoftware.util.JiveConstants; 23 import org.jivesoftware.messenger.auth.UnauthorizedException; 24 import org.jivesoftware.messenger.user.UserAlreadyExistsException; 25 import org.jivesoftware.messenger.user.UserNotFoundException; 26 import org.jivesoftware.database.JiveID; 27 import org.xmpp.packet.Presence; 28 import org.xmpp.packet.Message; 29 import org.xmpp.packet.JID; 30 import org.xmpp.packet.Packet; 31 32 33 39 @JiveID(JiveConstants.MUC_ROOM) 40 public interface MUCRoom { 41 42 47 String getName(); 48 49 56 long getID(); 57 58 65 void setID(long roomID); 66 67 72 Date getCreationDate(); 73 74 79 void setCreationDate(Date creationDate); 80 81 87 Date getModificationDate(); 88 89 95 void setModificationDate(Date modificationDate); 96 97 104 void setEmptyDate(Date emptyDate); 105 106 113 Date getEmptyDate(); 114 115 120 MUCRole getRole(); 121 122 129 MUCRole getOccupant(String nickname) throws UserNotFoundException; 130 131 139 List <MUCRole> getOccupantsByBareJID(String jid) throws UserNotFoundException; 140 141 148 MUCRole getOccupantByFullJID(String jid) throws UserNotFoundException; 149 150 155 Collection <MUCRole> getOccupants(); 156 157 162 int getOccupantsCount(); 163 164 170 boolean hasOccupant(String nickname); 171 172 178 String getReservedNickname(String bareJID); 179 180 189 MUCRole.Affiliation getAffiliation(String bareJID); 190 191 212 MUCRole joinRoom(String nickname, String password, HistoryRequest historyRequest, MUCUser user, 213 Presence presence) throws UnauthorizedException, UserAlreadyExistsException, 214 RoomLockedException, ForbiddenException, RegistrationRequiredException, 215 ConflictException, ServiceUnavailableException, NotAcceptableException; 216 217 223 void leaveRoom(String nickname) throws UserNotFoundException; 224 225 233 void destroyRoom(String alternateJID, String reason); 234 235 241 Presence createPresence(Presence.Type type) throws UnauthorizedException; 242 243 249 void serverBroadcast(String msg); 250 251 256 public long getChatLength(); 257 258 265 public void addFirstOwner(String bareJID); 266 267 276 public List <Presence> addOwner(String bareJID, MUCRole senderRole) throws ForbiddenException; 277 278 287 public List <Presence> addOwners(List <String > newOwners, MUCRole senderRole) 288 throws ForbiddenException; 289 290 300 public List <Presence> addAdmins(List <String > newAdmins, MUCRole senderRole) 301 throws ForbiddenException, ConflictException; 302 303 313 public List <Presence> addAdmin(String bareJID, MUCRole senderRole) throws ForbiddenException, 314 ConflictException; 315 316 328 public List <Presence> addMember(String bareJID, String nickname, MUCRole senderRole) 329 throws ForbiddenException, ConflictException; 330 331 343 public List <Presence> addOutcast(String bareJID, String reason, MUCRole senderRole) 344 throws NotAllowedException, ForbiddenException, ConflictException; 345 346 356 public List <Presence> addNone(String bareJID, MUCRole senderRole) throws ForbiddenException, 357 ConflictException; 358 359 369 public Presence addModerator(JID fullJID, MUCRole senderRole) throws ForbiddenException; 370 371 384 public Presence addParticipant(JID fullJID, String reason, MUCRole senderRole) 385 throws NotAllowedException, ForbiddenException; 386 387 399 public Presence addVisitor(JID jid, MUCRole senderRole) throws NotAllowedException, 400 ForbiddenException; 401 402 409 public boolean isLocked(); 410 411 418 public boolean isManuallyLocked(); 419 420 426 public void nicknameChanged(String oldNick, String newNick); 427 428 439 public void changeSubject(Message packet, MUCRole role) throws ForbiddenException; 440 441 446 public String getSubject(); 447 448 454 public void setSubject(String subject); 455 456 466 public void sendPublicMessage(Message message, MUCRole senderRole) throws ForbiddenException; 467 468 475 public void sendPrivateMessage(Message message, MUCRole senderRole) throws NotFoundException; 476 477 487 public Presence kickOccupant(JID fullJID, JID actorJID, String reason) 488 throws NotAllowedException; 489 490 public IQOwnerHandler getIQOwnerHandler(); 491 492 public IQAdminHandler getIQAdminHandler(); 493 494 499 public MUCRoomHistory getRoomHistory(); 500 501 507 public Collection <String > getOwners(); 508 509 515 public Collection <String > getAdmins(); 516 517 525 public Collection <String > getMembers(); 526 527 534 public Collection <String > getOutcasts(); 535 536 542 public Collection <MUCRole> getModerators(); 543 544 550 public Collection <MUCRole> getParticipants(); 551 552 558 public boolean canAnyoneDiscoverJID(); 559 560 567 public void setCanAnyoneDiscoverJID(boolean canAnyoneDiscoverJID); 568 569 574 public boolean canOccupantsChangeSubject(); 575 576 582 public void setCanOccupantsChangeSubject(boolean canOccupantsChangeSubject); 583 584 592 public boolean canOccupantsInvite(); 593 594 603 public void setCanOccupantsInvite(boolean canOccupantsInvite); 604 605 611 public String getNaturalLanguageName(); 612 613 619 public void setNaturalLanguageName(String naturalLanguageName); 620 621 627 public String getDescription(); 628 629 635 public void setDescription(String description); 636 637 643 public boolean isMembersOnly(); 644 645 652 public List <Presence> setMembersOnly(boolean membersOnly); 653 654 662 public boolean isLogEnabled(); 663 664 672 public void setLogEnabled(boolean logEnabled); 673 674 682 public boolean isLoginRestrictedToNickname(); 683 684 691 public void setLoginRestrictedToNickname(boolean restricted); 692 693 703 public boolean canChangeNickname(); 704 705 715 public void setChangeNickname(boolean canChange); 716 717 724 public boolean isRegistrationEnabled(); 725 726 733 public void setRegistrationEnabled(boolean registrationEnabled); 734 735 742 public int getMaxUsers(); 743 744 751 public void setMaxUsers(int maxUsers); 752 753 758 public boolean isModerated(); 759 760 766 public void setModerated(boolean moderated); 767 768 773 public boolean isPasswordProtected(); 774 775 780 public String getPassword(); 781 782 787 public void setPassword(String password); 788 789 796 public boolean isPersistent(); 797 798 805 public void setPersistent(boolean persistent); 806 807 813 public boolean wasSavedToDB(); 814 815 820 public void setSavedToDB(boolean saved); 821 822 826 public void saveToDB(); 827 828 833 public boolean isPublicRoom(); 834 835 840 public void setPublicRoom(boolean publicRoom); 841 842 848 public List <String > getRolesToBroadcastPresence(); 849 850 857 public void setRolesToBroadcastPresence(List <String > rolesToBroadcastPresence); 858 859 865 public boolean canBroadcastPresence(String roleToBroadcast); 866 867 874 public void lock(MUCRole senderRole) throws ForbiddenException; 875 876 884 public void unlock(MUCRole senderRole) throws ForbiddenException; 885 886 900 public void sendInvitation(JID to, String reason, MUCRole role, List <Element> extensions) 901 throws ForbiddenException; 902 903 914 public void sendInvitationRejection(JID to, String reason, JID from); 915 916 921 public void send(Packet packet); 922 } | Popular Tags |