Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.webchat.user
Class UserSession

java.lang.Object
  extended by com.jivesoftware.webchat.user.UserSession
All Implemented Interfaces:
org.jivesoftware.smack.PacketListener

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

Manages all Group and 1-to-1 Chat Sessions.


Constructor Summary
UserSession()
          Creates a new session manager.
 
Method Summary
 void addChatSession(java.lang.String participant, ChatSession chatSession)
          Adds a new ChatSession associated with a 1-to-1 converstation.
 void addGroupChatSession(java.lang.String roomName, GroupChatSession chatSession)
          Adds a new GroupChatSession identified by the room name.
 boolean checkForInvalidSession()
           
 void closeAndRemoveGroupChatSession(java.lang.String roomName)
          Closed and remove the GroupChatSession
 void closeConnection()
           
 void destroyAllSessions()
          Removes all Chat Sessions from map.
 java.util.Map getAllSessions()
          Returns all active rooms.
 java.util.List getAvailableRooms()
           
 ChatSession getChatSession(java.lang.String participant)
          Retrieves the ChatSession associated with a 1-to-1 chat.
 GroupChatSession getGroupChatSession(java.lang.String roomName)
          Retrieve's the GroupChatSession associated with the room.
 java.lang.String getNickname()
           
 java.lang.String getPassword()
           
 java.util.Map getPrivateMessageMap()
           
 RoomInfo getRoomInfo(java.lang.String roomJID)
           
 java.lang.String getUsername()
           
 org.jivesoftware.smack.XMPPConnection getXMPPConnection()
           
 boolean isActive()
           
 boolean isAnonymous()
           
 void loadRooms()
           
 void processPacket(org.jivesoftware.smack.packet.Packet packet)
           
 void removeChatSession(java.lang.String participant)
          Removes the ChatSession associated with the participant.
 GroupChatSession removeGroupChatSession(java.lang.String roomName)
          Removes the GroupChatSession associated with the room.
 void setActivityTime()
           
 void setNickname(java.lang.String nickname)
           
 void setPassword(java.lang.String password)
           
 void setUsername(java.lang.String username)
           
 void setXMPPConnection(org.jivesoftware.smack.XMPPConnection con)
          Set's the XMPPConnection for this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserSession

public UserSession()
Creates a new session manager.

Method Detail

addGroupChatSession

public void addGroupChatSession(java.lang.String roomName,
                                GroupChatSession chatSession)
Adds a new GroupChatSession identified by the room name.

Parameters:
roomName - the name of the room the GroupChatSession was created for.
chatSession - the GroupChatSession that should be added.

getGroupChatSession

public GroupChatSession getGroupChatSession(java.lang.String roomName)
Retrieve's the GroupChatSession associated with the room.

Parameters:
roomName - the name of the room.
Returns:
the GroupChatSession

getAllSessions

public java.util.Map getAllSessions()
Returns all active rooms.


removeGroupChatSession

public GroupChatSession removeGroupChatSession(java.lang.String roomName)
Removes the GroupChatSession associated with the room.

Parameters:
roomName - the name of the room the GroupChatSession was created for.
Returns:
the GroupChatSession that was removed.

closeAndRemoveGroupChatSession

public void closeAndRemoveGroupChatSession(java.lang.String roomName)
Closed and remove the GroupChatSession

Parameters:
roomName - the room to close and remove.

addChatSession

public void addChatSession(java.lang.String participant,
                           ChatSession chatSession)
Adds a new ChatSession associated with a 1-to-1 converstation.

Parameters:
participant - the participant the ChatSession was created for.
chatSession - the ChatSession created.

removeChatSession

public void removeChatSession(java.lang.String participant)
Removes the ChatSession associated with the participant.

Parameters:
participant - the participant the 1-to-1 session was created for.

getChatSession

public ChatSession getChatSession(java.lang.String participant)
Retrieves the ChatSession associated with a 1-to-1 chat.

Parameters:
participant - the participant the ChatSession was created for.
Returns:
the ChatSession associated with this participant.

destroyAllSessions

public void destroyAllSessions()
Removes all Chat Sessions from map.


setXMPPConnection

public void setXMPPConnection(org.jivesoftware.smack.XMPPConnection con)
Set's the XMPPConnection for this session.

Parameters:
con - the XMPPConnection to set.

getXMPPConnection

public org.jivesoftware.smack.XMPPConnection getXMPPConnection()

processPacket

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

checkForInvalidSession

public boolean checkForInvalidSession()

setActivityTime

public void setActivityTime()

isActive

public boolean isActive()

loadRooms

public void loadRooms()

getAvailableRooms

public java.util.List getAvailableRooms()

getRoomInfo

public RoomInfo getRoomInfo(java.lang.String roomJID)

closeConnection

public void closeConnection()

getPrivateMessageMap

public java.util.Map getPrivateMessageMap()

getPassword

public java.lang.String getPassword()

setPassword

public void setPassword(java.lang.String password)

getNickname

public java.lang.String getNickname()

setNickname

public void setNickname(java.lang.String nickname)

getUsername

public java.lang.String getUsername()

setUsername

public void setUsername(java.lang.String username)

isAnonymous

public boolean isAnonymous()

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.