Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.webchat.chat.group
Class GroupChatSession

java.lang.Object
  extended by com.jivesoftware.webchat.chat.group.GroupChatSession
All Implemented Interfaces:
org.jivesoftware.smack.PacketListener

public class GroupChatSession
extends java.lang.Object
implements org.jivesoftware.smack.PacketListener

GroupChatSession is used to track all information pertainting to a specified Group Chat Room, including participants presences, messages, and connnections.


Field Summary
static int ADMIN_PAGE
           
static int BANNED_PAGE
           
static int IM_PAGE
           
static int MODERATOR_PAGE
           
 
Constructor Summary
GroupChatSession(org.jivesoftware.smack.XMPPConnection con, java.lang.String sessionID)
          Create a new Group Chat Session from the specified Connection.
 
Method Summary
 void addBlockedUser(java.lang.String nickname)
          Adds a user to the blocked user list.
 void addPrivateMessage(org.jivesoftware.smack.packet.Message message)
          Adds a private message to be polled.
 void close()
          Explicitly close the Group Chat.
 java.util.Collection getBannedMembers()
          Returns all banned members in this room.
 org.jivesoftware.smackx.muc.MultiUserChat getGroupChat()
          Returns the MultiUserChat associated with this session.
 long getLastCheck()
           
 ChatMessage[] getMessageList()
          Returns a list of all new Messages waiting to be retrieved.
 java.util.Collection getModerators()
          Returns all moderators in this room.
 java.lang.String[] getModifiedUsers()
          Returns all users that have been modified in this room.
 java.util.Collection getNewUsers()
          Returns a collection of all users who have joined the session since last being polled.
 java.lang.String getNickname()
           
 int getPage()
          Returns the active page id.
 ChatPresence[] getPresenceList()
          Returns a list of all new presences waiting to be retrieved.
 ChatMessage[] getPrivateMessages()
          Returns a collection of private messages.
 java.lang.String getRoomName()
          Returns the name of the room this GroupChatSession is for.
 java.lang.String getSessionID()
           
 java.lang.String getSubject()
           
 org.jivesoftware.smackx.packet.MUCUser getUser(java.lang.String nickname)
          Returns a MUCUser by their nickname.
 java.util.Collection getUsersWhoLeft()
          Returns a collection of all users who have left the session since last being polled.
 boolean hasSubjectChanged()
          Returns true if the subject has been changed.
 boolean hasVoice()
          Checks whether this user has voice privileges.
 boolean hasVoice(java.lang.String nickname)
          Check to see if the user has voice.
 boolean isActiveSession()
          Returns true if this session is still active.
 boolean isAdministrator()
          Checks to see if this user is a room admin.
 boolean isAdministrator(java.lang.String nickname)
          Checks to see if the user is a room admin.
 boolean isAuthenticated()
          Returns true if the user has logged in anonymous or with a username and password.
 boolean isBlocked(java.lang.String nickname)
          Checks to see if a user is blocked.
 boolean isClosed()
          Returns true if the connection is closed.
 boolean isInGroupChat()
          Returns true if the Group Chat is active.
 boolean isModerator()
          Returns true if this user is a moderator.
 boolean isModerator(java.lang.String nickname)
          Check to see if the nickname is a moderator.
 void joinRoom(java.lang.String roomname, java.lang.String nickname)
          Join a MultiUserChat Room.
 void listenForMessages(org.jivesoftware.smack.XMPPConnection con, org.jivesoftware.smackx.muc.MultiUserChat chat)
          Listen for new messages.
 void login(java.lang.String username, java.lang.String password)
          Login the user using the specified username and password.
 void loginAnonymously()
          Login the user as anonoymus
 boolean moderatorPermissionChanged()
          Need to handle simple state changes without always checking.
 boolean pageStateHasChanged()
          Check to see if the page state has been changed since last checking.
 void processPacket(org.jivesoftware.smack.packet.Packet packet)
           
 void removeBlockedUser(java.lang.String nickname)
          Removes a user from the blocked user list.
 void removeMessages(int size)
          Removes certain size from message list.
 void removePresences(int size)
          Removes certain size from presence list.
 void sentMessage()
           
 void setPage(int pageID)
          Sets the current active page id.
 boolean voicePermissionChanged()
          Voice privilieges have been changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IM_PAGE

public static final int IM_PAGE
See Also:
Constant Field Values

MODERATOR_PAGE

public static final int MODERATOR_PAGE
See Also:
Constant Field Values

BANNED_PAGE

public static final int BANNED_PAGE
See Also:
Constant Field Values

ADMIN_PAGE

public static final int ADMIN_PAGE
See Also:
Constant Field Values
Constructor Detail

GroupChatSession

public GroupChatSession(org.jivesoftware.smack.XMPPConnection con,
                        java.lang.String sessionID)
Create a new Group Chat Session from the specified Connection.

Parameters:
con - the XMPPConnection of this session.
Method Detail

isAuthenticated

public boolean isAuthenticated()
Returns true if the user has logged in anonymous or with a username and password.

Returns:
true if the user has logged in.

loginAnonymously

public void loginAnonymously()
                      throws org.jivesoftware.smack.XMPPException
Login the user as anonoymus

Throws:
org.jivesoftware.smack.XMPPException

login

public void login(java.lang.String username,
                  java.lang.String password)
           throws org.jivesoftware.smack.XMPPException
Login the user using the specified username and password.

Parameters:
username - the username
password - the password
Throws:
org.jivesoftware.smack.XMPPException

isInGroupChat

public boolean isInGroupChat()
Returns true if the Group Chat is active.

Returns:
true if the Group Chat is active.

getGroupChat

public org.jivesoftware.smackx.muc.MultiUserChat getGroupChat()
Returns the MultiUserChat associated with this session.

Returns:
the MultiUserChat associated with this session.

isClosed

public boolean isClosed()
Returns true if the connection is closed.

Returns:
true if the connection is closed.

close

public void close()
Explicitly close the Group Chat.


joinRoom

public void joinRoom(java.lang.String roomname,
                     java.lang.String nickname)
Join a MultiUserChat Room.

Parameters:
roomname - the name of the room to join(ex.my_room@conference.localhost).
nickname - the nickname to join the room as.

listenForMessages

public void listenForMessages(org.jivesoftware.smack.XMPPConnection con,
                              org.jivesoftware.smackx.muc.MultiUserChat chat)
Listen for new messages.

Parameters:
con -
chat -

getMessageList

public ChatMessage[] getMessageList()
Returns a list of all new Messages waiting to be retrieved.

Returns:
the list of all new messages.

isActiveSession

public boolean isActiveSession()
Returns true if this session is still active.

Returns:
true if session is still active.

getPresenceList

public ChatPresence[] getPresenceList()
Returns a list of all new presences waiting to be retrieved.

Returns:
the list of all new presences.

removeMessages

public void removeMessages(int size)
Removes certain size from message list.

Parameters:
size - the size to remove.

removePresences

public void removePresences(int size)
Removes certain size from presence list.

Parameters:
size - the size to remove.

sentMessage

public void sentMessage()

processPacket

public void processPacket(org.jivesoftware.smack.packet.Packet packet)
Specified by:
processPacket in interface org.jivesoftware.smack.PacketListener

getUsersWhoLeft

public java.util.Collection getUsersWhoLeft()
Returns a collection of all users who have left the session since last being polled.

Returns:
a Collection of users who have left the session.

getNewUsers

public java.util.Collection getNewUsers()
Returns a collection of all users who have joined the session since last being polled.

Returns:
a Collection of users who have joined the session.

addBlockedUser

public void addBlockedUser(java.lang.String nickname)
Adds a user to the blocked user list.

Parameters:
nickname - the nickname of the user who is being blocked.

removeBlockedUser

public void removeBlockedUser(java.lang.String nickname)
Removes a user from the blocked user list.

Parameters:
nickname - the nickname of the user who is being unblocked.

isBlocked

public boolean isBlocked(java.lang.String nickname)
Checks to see if a user is blocked.

Parameters:
nickname - the nickname of the use to check.
Returns:
true if the user is blocked, false otherwise.

addPrivateMessage

public void addPrivateMessage(org.jivesoftware.smack.packet.Message message)
Adds a private message to be polled.

Parameters:
message - the message to add.

getPrivateMessages

public ChatMessage[] getPrivateMessages()
Returns a collection of private messages.

Returns:
a collection of private messages.

getUser

public org.jivesoftware.smackx.packet.MUCUser getUser(java.lang.String nickname)
Returns a MUCUser by their nickname.

Parameters:
nickname - the nickname of the MUCUser to return.
Returns:
the MUCUser

isModerator

public boolean isModerator()
Returns true if this user is a moderator.

Returns:
true if this user is a moderator, otherwise false.

isAdministrator

public boolean isAdministrator()
Checks to see if this user is a room admin.

Returns:
true if this user is a room administrator.

isAdministrator

public boolean isAdministrator(java.lang.String nickname)
Checks to see if the user is a room admin.

Parameters:
nickname - the nickname of the user to check.
Returns:
true if the user is an admin.

hasVoice

public boolean hasVoice()
Checks whether this user has voice privileges.

Returns:
true if this user has voice priviliges, otherwise false.

moderatorPermissionChanged

public boolean moderatorPermissionChanged()
Need to handle simple state changes without always checking.


voicePermissionChanged

public boolean voicePermissionChanged()
Voice privilieges have been changed.

Returns:
true if the voice privileges have been changed.

getModerators

public java.util.Collection getModerators()
Returns all moderators in this room. These are moderators that have been granted moderator priviliges by this user and therefore can be revoked.

Returns:
the collection of all moderators in this room.

getModifiedUsers

public java.lang.String[] getModifiedUsers()
Returns all users that have been modified in this room.

Returns:
a collection of all moderators that have modified in this room.

setPage

public void setPage(int pageID)
Sets the current active page id.

Parameters:
pageID - the active page id.

getPage

public int getPage()
Returns the active page id.

Returns:
the active page id.

pageStateHasChanged

public boolean pageStateHasChanged()
Check to see if the page state has been changed since last checking.

Returns:
true if the page state has been changed since last checking.

isModerator

public boolean isModerator(java.lang.String nickname)
Check to see if the nickname is a moderator.

Parameters:
nickname - the nickname of the user to check.
Returns:
true if the user is a moderator.

hasVoice

public boolean hasVoice(java.lang.String nickname)
Check to see if the user has voice.

Parameters:
nickname - the nickname of the user.
Returns:
true if the user has voice.

hasSubjectChanged

public boolean hasSubjectChanged()
Returns true if the subject has been changed.

Returns:
true if the subject has been changed.

getBannedMembers

public java.util.Collection getBannedMembers()
Returns all banned members in this room.

Returns:
all banned members in this room.

getLastCheck

public long getLastCheck()

getSessionID

public java.lang.String getSessionID()

getRoomName

public java.lang.String getRoomName()
Returns the name of the room this GroupChatSession is for.

Returns:
the name of the room the GroupChatSession is in.

getSubject

public java.lang.String getSubject()

getNickname

public java.lang.String getNickname()

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.