1 11 12 package org.jivesoftware.messenger.muc; 13 14 import org.xmpp.packet.JID; 15 import org.xmpp.packet.Presence; 16 import org.xmpp.packet.Packet; 17 import org.dom4j.Element; 18 19 28 public interface MUCRole { 29 30 public enum Role { 31 32 35 moderator(0), 36 37 41 participant(1), 42 43 46 visitor(2), 47 48 51 none(3); 52 53 private int value; 54 55 Role(int value) { 56 this.value = value; 57 } 58 59 64 public int getValue() { 65 return value; 66 } 67 68 74 public static Role valueOf(int value) { 75 switch (value) { 76 case 0: return moderator; 77 case 1: return participant; 78 case 2: return visitor; 79 default: return none; 80 } 81 } 82 } 83 84 public enum Affiliation { 85 86 89 owner(10), 90 91 94 admin(20), 95 96 100 member(30), 101 102 105 outcast(40), 106 107 111 none(50); 112 113 private int value; 114 115 Affiliation(int value) { 116 this.value = value; 117 } 118 119 124 public int getValue() { 125 return value; 126 } 127 128 134 public static Affiliation valueOf(int value) { 135 switch (value) { 136 case 10: return owner; 137 case 20: return admin; 138 case 30: return member; 139 case 40: return outcast; 140 default: return none; 141 } 142 } 143 } 144 145 150 public Presence getPresence(); 151 152 159 public Element getExtendedPresenceInformation(); 160 161 166 public void setPresence(Presence presence); 167 168 180 public void setRole(Role newRole) throws NotAllowedException; 181 182 187 public Role getRole(); 188 189 195 public void setAffiliation(Affiliation newAffiliation) throws NotAllowedException; 196 197 202 public Affiliation getAffiliation(); 203 204 209 public String getNickname(); 210 211 216 public void changeNickname(String nickname); 217 218 223 public MUCUser getChatUser(); 224 225 230 public MUCRoom getChatRoom(); 231 232 237 public JID getRoleAddress(); 238 239 244 public void send(Packet packet); 245 } | Popular Tags |