SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.chat.conference
Class AdHocConferenceChatTransport

java.lang.Object
  extended by net.java.sip.communicator.impl.gui.main.chat.conference.AdHocConferenceChatTransport
All Implemented Interfaces:
ChatTransport

public class AdHocConferenceChatTransport
extends Object
implements ChatTransport

The conference implementation of the ChatTransport interface that provides abstraction to access to protocol providers.

Author:
Valentin Martinet

Constructor Summary
AdHocConferenceChatTransport(ChatSession chatSession, AdHocChatRoom chatRoom)
          Creates an instance of ConferenceChatTransport by specifying the parent chat session and the ad-hoc chat room associated with this transport.
 
Method Summary
 void addInstantMessageListener(MessageListener l)
          Adds an instant message listener to this chat transport.
 void addSmsMessageListener(MessageListener l)
          Adds an sms message listener to this chat transport.
 boolean allowsInstantMessage()
          Returns true if this chat transport supports instant messaging, otherwise returns false.
 boolean allowsSmsMessage()
          Returns true if this chat transport supports sms messaging, otherwise returns false.
 boolean allowsTypingNotifications()
          Returns true if this chat transport supports typing notifications, otherwise returns false.
 void dispose()
          Disposes this chat transport.
 Object getDescriptor()
          Returns the descriptor of this chat transport.
 String getDisplayName()
          Returns the display name corresponding to this chat transport.
 long getMaximumFileLength()
          Returns the maximum file length supported by the protocol in bytes.
 String getName()
          Returns the contact address corresponding to this chat transport.
 ChatSession getParentChatSession()
          Returns the parent session of this chat transport.
 ProtocolProviderService getProtocolProvider()
          Returns the ProtocolProviderService, corresponding to this chat transport.
 PresenceStatus getStatus()
          Returns the presence status of this transport.
 void inviteChatContact(String contactAddress, String reason)
          Invites the given contact in this chat conference.
 void removeInstantMessageListener(MessageListener l)
          Removes the instant message listener from this chat transport.
 void removeSmsMessageListener(MessageListener l)
          Removes the given sms message listener from this chat transport.
 FileTransfer sendFile(File file)
          Sending files through a chat room is not yet supported by this chat transport implementation.
 void sendInstantMessage(String messageText, String mimeType)
          Sends the given instant message trough this chat transport, by specifying the mime type (html or plain text).
 void sendSmsMessage(String phoneNumber, String message)
          Sending sms messages is not supported by this chat transport implementation.
 int sendTypingNotification(int typingState)
          Sending typing notifications is not supported by this chat transport implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdHocConferenceChatTransport

public AdHocConferenceChatTransport(ChatSession chatSession,
                                    AdHocChatRoom chatRoom)
Creates an instance of ConferenceChatTransport by specifying the parent chat session and the ad-hoc chat room associated with this transport.

Parameters:
chatSession - the parent chat session.
chatRoom - the ad-hoc chat room associated with this conference transport.
Method Detail

getName

public String getName()
Returns the contact address corresponding to this chat transport.

Specified by:
getName in interface ChatTransport
Returns:
The contact address corresponding to this chat transport.

getDisplayName

public String getDisplayName()
Returns the display name corresponding to this chat transport.

Specified by:
getDisplayName in interface ChatTransport
Returns:
The display name corresponding to this chat transport.

getStatus

public PresenceStatus getStatus()
Returns the presence status of this transport.

Specified by:
getStatus in interface ChatTransport
Returns:
the presence status of this transport.

getProtocolProvider

public ProtocolProviderService getProtocolProvider()
Returns the ProtocolProviderService, corresponding to this chat transport.

Specified by:
getProtocolProvider in interface ChatTransport
Returns:
the ProtocolProviderService, corresponding to this chat transport.

allowsInstantMessage

public boolean allowsInstantMessage()
Returns true if this chat transport supports instant messaging, otherwise returns false.

Specified by:
allowsInstantMessage in interface ChatTransport
Returns:
true if this chat transport supports instant messaging, otherwise returns false.

allowsSmsMessage

public boolean allowsSmsMessage()
Returns true if this chat transport supports sms messaging, otherwise returns false.

Specified by:
allowsSmsMessage in interface ChatTransport
Returns:
true if this chat transport supports sms messaging, otherwise returns false.

allowsTypingNotifications

public boolean allowsTypingNotifications()
Returns true if this chat transport supports typing notifications, otherwise returns false.

Specified by:
allowsTypingNotifications in interface ChatTransport
Returns:
true if this chat transport supports typing notifications, otherwise returns false.

sendInstantMessage

public void sendInstantMessage(String messageText,
                               String mimeType)
                        throws Exception
Sends the given instant message trough this chat transport, by specifying the mime type (html or plain text).

Specified by:
sendInstantMessage in interface ChatTransport
Parameters:
messageText - The message to send.
mimeType - The mime type of the message to send: text/html or text/plain.
Throws:
Exception - if the send doesn't succeed

sendSmsMessage

public void sendSmsMessage(String phoneNumber,
                           String message)
                    throws Exception
Sending sms messages is not supported by this chat transport implementation.

Specified by:
sendSmsMessage in interface ChatTransport
Parameters:
phoneNumber - the phone number to which to send the message
message - The message to send.
Throws:
Exception - if the send doesn't succeed

sendTypingNotification

public int sendTypingNotification(int typingState)
Sending typing notifications is not supported by this chat transport implementation.

Specified by:
sendTypingNotification in interface ChatTransport
Parameters:
typingState - the typing notification state to send
Returns:
the result of this operation. One of the TYPING_NOTIFICATION_XXX constants defined in this class

sendFile

public FileTransfer sendFile(File file)
                      throws Exception
Sending files through a chat room is not yet supported by this chat transport implementation.

Specified by:
sendFile in interface ChatTransport
Parameters:
file - the file to send
Returns:
the FileTransfer charged to transfer the given file.
Throws:
Exception - if the send doesn't succeed

inviteChatContact

public void inviteChatContact(String contactAddress,
                              String reason)
Invites the given contact in this chat conference.

Specified by:
inviteChatContact in interface ChatTransport
Parameters:
contactAddress - the address of the contact to invite
reason - the reason for the invitation

getParentChatSession

public ChatSession getParentChatSession()
Returns the parent session of this chat transport. A ChatSession could contain more than one transports.

Specified by:
getParentChatSession in interface ChatTransport
Returns:
the parent session of this chat transport

addSmsMessageListener

public void addSmsMessageListener(MessageListener l)
Adds an sms message listener to this chat transport.

Specified by:
addSmsMessageListener in interface ChatTransport
Parameters:
l - The message listener to add.

addInstantMessageListener

public void addInstantMessageListener(MessageListener l)
Adds an instant message listener to this chat transport.

Specified by:
addInstantMessageListener in interface ChatTransport
Parameters:
l - The message listener to add.

removeSmsMessageListener

public void removeSmsMessageListener(MessageListener l)
Removes the given sms message listener from this chat transport.

Specified by:
removeSmsMessageListener in interface ChatTransport
Parameters:
l - The message listener to remove.

removeInstantMessageListener

public void removeInstantMessageListener(MessageListener l)
Removes the instant message listener from this chat transport.

Specified by:
removeInstantMessageListener in interface ChatTransport
Parameters:
l - The message listener to remove.

dispose

public void dispose()
Description copied from interface: ChatTransport
Disposes this chat transport.

Specified by:
dispose in interface ChatTransport

getDescriptor

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

Specified by:
getDescriptor in interface ChatTransport
Returns:
the descriptor of this chat transport

getMaximumFileLength

public long getMaximumFileLength()
Description copied from interface: ChatTransport
Returns the maximum file length supported by the protocol in bytes.

Specified by:
getMaximumFileLength in interface ChatTransport
Returns:
the file length that is supported.

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

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