public class UserManager
extends java.lang.Object
Constructor and Description |
---|
UserManager() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeJID(java.lang.String jid)
Escapes a complete JID by examing the Node itself and escaping
when neccessary.
|
java.util.Collection<java.lang.String> |
getAllParticipantsInRoom(ChatRoom chatRoom)
Returns a Collection of all
ChatUsers in a ChatRoom. |
java.lang.String |
getFullJID(java.lang.String jid)
Returns the full jid (with resource) based on the user's jid.
|
java.lang.String |
getJIDFromDisplayName(java.lang.String displayName)
Returns the full jid w/ resource of a user by their display name
in the ContactList.
|
java.lang.String |
getNickname() |
java.lang.String |
getNickname(java.lang.String fullJID) |
org.jivesoftware.smackx.muc.Occupant |
getOccupant(GroupChatRoom groupChatRoom,
java.lang.String nickname)
Returns the occupant of the room identified by their nickname.
|
java.util.Collection<java.lang.String> |
getUserJidsInRoom(java.lang.String room,
boolean fullJID)
Return a Collection of all user jids found in the specified room.
|
java.lang.String |
getUserNicknameFromJID(java.lang.String jid) |
boolean |
hasVoice(GroupChatRoom groupChatRoom,
java.lang.String nickname) |
boolean |
isAdmin(GroupChatRoom groupChatRoom,
java.lang.String nickname)
Checks the nickname of a user in a room and determines if they are an
administrator of the room.
|
boolean |
isAdmin(org.jivesoftware.smackx.muc.Occupant occupant)
Checks to see if the Occupant is an admin.
|
boolean |
isMember(org.jivesoftware.smackx.muc.Occupant occupant)
Checks if the Occupant is a Member in this Room
admins and owners are also members!!! |
boolean |
isModerator(GroupChatRoom groupChatRoom,
java.lang.String nickname)
Checks to see if the Occupant is a moderator.
|
boolean |
isModerator(org.jivesoftware.smackx.muc.Occupant occupant)
Checks to see if the Occupant is a moderator.
|
boolean |
isOwner(GroupChatRoom groupChatRoom,
java.lang.String nickname)
Checks to see if the user is an owner of the specified room.
|
boolean |
isOwner(org.jivesoftware.smackx.muc.Occupant occupant)
Checks to see if the Occupant is the owner of the room.
|
boolean |
isOwnerOrAdmin(GroupChatRoom groupChatRoom,
java.lang.String nickname)
Checks to see if the user is either an owner or admin of a room.
|
boolean |
isOwnerOrAdmin(org.jivesoftware.smackx.muc.Occupant occupant)
Checks to see if the user is either an owner or admin of the given room.
|
void |
searchContacts(java.lang.String contact,
javax.swing.JFrame parent) |
static java.lang.String |
unescapeJID(java.lang.String jid)
Unescapes a complete JID by examing the node itself and unescaping when necessary.
|
public java.lang.String getNickname()
public java.lang.String getNickname(java.lang.String fullJID)
public java.util.Collection<java.lang.String> getUserJidsInRoom(java.lang.String room, boolean fullJID)
room
- the name of the chatroomfullJID
- set to true if you wish to have the full jid with resource, otherwise false
for the bare jid.public boolean isOwner(GroupChatRoom groupChatRoom, java.lang.String nickname)
groupChatRoom
- the group chat room.nickname
- the user's nickname.public boolean isOwner(org.jivesoftware.smackx.muc.Occupant occupant)
occupant
- the occupant of a room.public boolean isMember(org.jivesoftware.smackx.muc.Occupant occupant)
occupant
- public boolean isModerator(GroupChatRoom groupChatRoom, java.lang.String nickname)
groupChatRoom
- the group chat room.nickname
- the nickname of the user.public boolean isModerator(org.jivesoftware.smackx.muc.Occupant occupant)
occupant
- the Occupant of a room.public boolean isOwnerOrAdmin(GroupChatRoom groupChatRoom, java.lang.String nickname)
groupChatRoom
- the group chat room.nickname
- the user's nickname.public boolean isOwnerOrAdmin(org.jivesoftware.smackx.muc.Occupant occupant)
occupant
- the Occupant
to check.public org.jivesoftware.smackx.muc.Occupant getOccupant(GroupChatRoom groupChatRoom, java.lang.String nickname)
groupChatRoom
- the GroupChatRoom.nickname
- the users nickname.public boolean isAdmin(GroupChatRoom groupChatRoom, java.lang.String nickname)
groupChatRoom
- the GroupChatRoom.nickname
- the nickname of the user. Note: In MultiUserChats, users nicknames
are defined by the resource(ex.theroom@conference.jivesoftware.com/derek) would have
derek as a nickname.public boolean isAdmin(org.jivesoftware.smackx.muc.Occupant occupant)
occupant
- the occupant of a room.public boolean hasVoice(GroupChatRoom groupChatRoom, java.lang.String nickname)
public java.util.Collection<java.lang.String> getAllParticipantsInRoom(ChatRoom chatRoom)
ChatUsers
in a ChatRoom.chatRoom
- the ChatRoom to inspect.ChatUser
public java.lang.String getUserNicknameFromJID(java.lang.String jid)
public static java.lang.String escapeJID(java.lang.String jid)
jid
- the users JIDpublic static java.lang.String unescapeJID(java.lang.String jid)
jid
- the users jid.public java.lang.String getJIDFromDisplayName(java.lang.String displayName)
displayName
- the displayed name of the user.public java.lang.String getFullJID(java.lang.String jid)
jid
- the users bare jid.public void searchContacts(java.lang.String contact, javax.swing.JFrame parent)