Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.chat
Class ChatSession

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.chat.ChatSession
Direct Known Subclasses:
AdHocConferenceChatSession, ConferenceChatSession, MetaContactChatSession

public abstract class ChatSession
extends Object

Author:
Yana Stamcheva, Lubomir Marinov

Field Summary
protected  String[] chatHistoryFilter
          The chat history filter.
protected  List<ChatContact<?>> chatParticipants
          The list of ChatContacts contained in this chat session.
protected  List<ChatTransport> chatTransports
          The list of ChatTransports available in this session.
 
Constructor Summary
ChatSession()
           
 
Method Summary
abstract  void addChatTransportChangeListener(ChatSessionChangeListener l)
          Adds the given ChatSessionChangeListener to this ChatSession.
abstract  void dispose()
          Disposes this chat session.
 ChatTransport findChatTransportForDescriptor(Object descriptor)
          Returns the ChatTransport corresponding to the given descriptor.
abstract  byte[] getChatAvatar()
          Returns the avatar icon of this chat session.
abstract  String getChatName()
          Returns the name of the chat.
abstract  ChatSessionRenderer getChatSessionRenderer()
          Returns the ChatSessionRenderer that provides the connection between this chat session and its UI.
abstract  ImageIcon getChatStatusIcon()
          Returns the status icon of this chat session.
 Iterator<ChatTransport> getChatTransports()
          Returns all available chat transports for this chat session.
abstract  ChatTransport getCurrentChatTransport()
          Returns the currently used transport for all operation within this chat session.
abstract  String getDefaultSmsNumber()
          Returns the default mobile number used to send sms-es in this session.
abstract  Object getDescriptor()
          Returns the descriptor of this chat session.
abstract  Collection<Object> getHistory(int count)
          Returns a collection of the last N number of history messages given by count.
abstract  Collection<Object> getHistoryAfterDate(Date date, int count)
          Returns a collection of the last N number of history messages given by count.
abstract  Collection<Object> getHistoryBeforeDate(Date date, int count)
          Returns a collection of the last N number of history messages given by count.
abstract  long getHistoryEndDate()
          Returns the end date of the history of this chat session.
abstract  long getHistoryStartDate()
          Returns the start date of the history of this chat session.
 Iterator<ChatContact<?>> getParticipants()
          Returns an iterator to the list of all participants contained in this chat session.
 List<ChatTransport> getTransportsForOperationSet(Class<? extends OperationSet> opSetClass)
          Returns a list of all ChatTransports contained in this session supporting the given opSetClass.
abstract  boolean isContactListSupported()
          Gets the indicator which determines whether a contact list of (multiple) participants is supported by this ChatSession.
abstract  boolean isDescriptorPersistent()
          Returns true if this chat session descriptor is persistent, otherwise returns false.
abstract  void removeChatTransportChangeListener(ChatSessionChangeListener l)
          Removes the given ChatSessionChangeListener to this ChatSession.
abstract  void setCurrentChatTransport(ChatTransport chatTransport)
          Sets the transport that will be used for all operations within this chat session.
abstract  void setDefaultSmsNumber(String smsPhoneNumber)
          Sets the default mobile number used to send sms-es in this session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chatHistoryFilter

protected final String[] chatHistoryFilter
The chat history filter.


chatParticipants

protected final List<ChatContact<?>> chatParticipants
The list of ChatContacts contained in this chat session.


chatTransports

protected final List<ChatTransport> chatTransports
The list of ChatTransports available in this session.

Constructor Detail

ChatSession

public ChatSession()
Method Detail

getDescriptor

public abstract Object getDescriptor()
Returns the descriptor of this chat session.

Returns:
the descriptor of this chat session.

isDescriptorPersistent

public abstract boolean isDescriptorPersistent()
Returns true if this chat session descriptor is persistent, otherwise returns false.

Returns:
true if this chat session descriptor is persistent, otherwise returns false.

getParticipants

public Iterator<ChatContact<?>> getParticipants()
Returns an iterator to the list of all participants contained in this chat session.

Returns:
an iterator to the list of all participants contained in this chat session.

getChatTransports

public Iterator<ChatTransport> getChatTransports()
Returns all available chat transports for this chat session. Each chat transport is corresponding to a protocol provider.

Returns:
all available chat transports for this chat session.

getCurrentChatTransport

public abstract ChatTransport getCurrentChatTransport()
Returns the currently used transport for all operation within this chat session.

Returns:
the currently used transport for all operation within this chat session.

getTransportsForOperationSet

public List<ChatTransport> getTransportsForOperationSet(Class<? extends OperationSet> opSetClass)
Returns a list of all ChatTransports contained in this session supporting the given opSetClass.

Parameters:
opSetClass - the OperationSet class we're looking for
Returns:
a list of all ChatTransports contained in this session supporting the given opSetClass

getChatSessionRenderer

public abstract ChatSessionRenderer getChatSessionRenderer()
Returns the ChatSessionRenderer that provides the connection between this chat session and its UI.

Returns:
The ChatSessionRenderer.

setCurrentChatTransport

public abstract void setCurrentChatTransport(ChatTransport chatTransport)
Sets the transport that will be used for all operations within this chat session.

Parameters:
chatTransport - The transport to set as a default transport for this session.

getChatName

public abstract String getChatName()
Returns the name of the chat. If this chat panel corresponds to a single chat it will return the name of the MetaContact, otherwise it will return the name of the chat room.

Returns:
the name of the chat

getHistory

public abstract Collection<Object> getHistory(int count)
Returns a collection of the last N number of history messages given by count.

Parameters:
count - The number of messages from history to return.
Returns:
a collection of the last N number of messages given by count.

getHistoryBeforeDate

public abstract Collection<Object> getHistoryBeforeDate(Date date,
                                                        int count)
Returns a collection of the last N number of history messages given by count.

Parameters:
date - The date up to which we're looking for messages.
count - The number of messages from history to return.
Returns:
a collection of the last N number of messages given by count.

getHistoryAfterDate

public abstract Collection<Object> getHistoryAfterDate(Date date,
                                                       int count)
Returns a collection of the last N number of history messages given by count.

Parameters:
date - The date from which we're looking for messages.
count - The number of messages from history to return.
Returns:
a collection of the last N number of messages given by count.

getHistoryStartDate

public abstract long getHistoryStartDate()
Returns the start date of the history of this chat session.

Returns:
the start date of the history of this chat session.

getHistoryEndDate

public abstract long getHistoryEndDate()
Returns the end date of the history of this chat session.

Returns:
the end date of the history of this chat session.

getDefaultSmsNumber

public abstract String getDefaultSmsNumber()
Returns the default mobile number used to send sms-es in this session.

Returns:
the default mobile number used to send sms-es in this session.

setDefaultSmsNumber

public abstract void setDefaultSmsNumber(String smsPhoneNumber)
Sets the default mobile number used to send sms-es in this session.

Parameters:
smsPhoneNumber - The default mobile number used to send sms-es in this session.

dispose

public abstract void dispose()
Disposes this chat session.


findChatTransportForDescriptor

public ChatTransport findChatTransportForDescriptor(Object descriptor)
Returns the ChatTransport corresponding to the given descriptor.

Parameters:
descriptor - The descriptor of the chat transport we're looking for.
Returns:
The ChatTransport corresponding to the given descriptor.

getChatStatusIcon

public abstract ImageIcon getChatStatusIcon()
Returns the status icon of this chat session.

Returns:
the status icon of this chat session.

getChatAvatar

public abstract byte[] getChatAvatar()
Returns the avatar icon of this chat session.

Returns:
the avatar icon of this chat session.

isContactListSupported

public abstract boolean isContactListSupported()
Gets the indicator which determines whether a contact list of (multiple) participants is supported by this ChatSession. For example, UI implementations may use the indicator to determine whether UI elements should be created for the user to represent the contact list of the participants in this ChatSession.

Returns:
true if this ChatSession supports a contact list of (multiple) participants; otherwise, false

addChatTransportChangeListener

public abstract void addChatTransportChangeListener(ChatSessionChangeListener l)
Adds the given ChatSessionChangeListener to this ChatSession.

Parameters:
l - the ChatSessionChangeListener to add

removeChatTransportChangeListener

public abstract void removeChatTransportChangeListener(ChatSessionChangeListener l)
Removes the given ChatSessionChangeListener to this ChatSession.

Parameters:
l - the ChatSessionChangeListener to add

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.