|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.spark.UserManager
public class UserManager
Handles all users in the agent application. Each user or chatting user can be referenced from the User Manager. You would use the UserManager to get visitors in a chat room or secondary agents.
Constructor Summary | |
---|---|
UserManager()
|
Method Summary | |
---|---|
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 |
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 |
getJIDFromNickname(java.lang.String nickname)
Returns the full jid w/ resource of a user by their nickname in the ContactList. |
java.lang.String |
getNickname()
|
org.jivesoftware.smackx.muc.Occupant |
getOccupant(GroupChatRoom groupChatRoom,
java.lang.String nickname)
Returns the occupant of the room identified by their nickname. |
javax.swing.Icon |
getTabIconForPresence(org.jivesoftware.smack.packet.Presence presence)
Returns the Icon associated with the presence. |
java.util.Collection |
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserManager()
Method Detail |
---|
public java.lang.String getNickname()
public java.util.Collection 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 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 hasVoice(GroupChatRoom groupChatRoom, java.lang.String nickname)
public java.util.Collection 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 JID
public static java.lang.String unescapeJID(java.lang.String jid)
jid
- the users jid.
public java.lang.String getJIDFromNickname(java.lang.String nickname)
nickname
- the nickname of the user.
public java.lang.String getFullJID(java.lang.String jid)
jid
- the users bare jid.
public javax.swing.Icon getTabIconForPresence(org.jivesoftware.smack.packet.Presence presence)
presence
- the presence.
public void searchContacts(java.lang.String contact, javax.swing.JFrame parent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |