Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.gui.main.chat
Interface ChatTransport

All Known Implementing Classes:
AdHocConferenceChatTransport, ConferenceChatTransport, MetaContactChatTransport

public interface ChatTransport

The ChatTransport is an abstraction of the transport method used when sending messages, making calls, etc. through the chat window.

Author:
Yana Stamcheva

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 object of this ChatTransport.
 String getDisplayName()
          Returns the display name of this chat transport.
 long getMaximumFileLength()
          Returns the maximum file length supported by the protocol in bytes.
 String getName()
          Returns the name of 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 a contact to join this chat.
 boolean isContentTypeSupported(String contentType)
          Determines whether this chat transport supports the supplied content type
 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)
          Sends the given file trough this chat transport.
 void sendInstantMessage(String message, String mimeType)
          Sends the given instant message trough this chat transport, by specifying the mime type (html or plain text).
 void sendSmsMessage(Contact contact, String message)
          Sends the given SMS message trough this chat transport.
 void sendSmsMessage(String phoneNumber, String message)
          Sends the given SMS message trough this chat transport.
 int sendTypingNotification(int typingState)
          Sends a typing notification state.
 

Method Detail

getDescriptor

Object getDescriptor()
Returns the descriptor object of this ChatTransport.

Returns:
the descriptor object of this ChatTransport

allowsInstantMessage

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

Returns:
true if this chat transport supports instant messaging, otherwise returns false

allowsSmsMessage

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

Returns:
true if this chat transport supports sms messaging, otherwise returns false

allowsTypingNotifications

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

Returns:
true if this chat transport supports typing notifications, otherwise returns false

getName

String getName()
Returns the name of this chat transport. This is for example the name of the contact in a single chat mode and the name of the chat room in the multi-chat mode.

Returns:
The name of this chat transport.

getDisplayName

String getDisplayName()
Returns the display name of this chat transport. This is for example the name of the contact in a single chat mode and the name of the chat room in the multi-chat mode.

Returns:
The display name of this chat transport.

getStatus

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

Returns:
the presence status of this transport.

getProtocolProvider

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

Returns:
the ProtocolProviderService, corresponding to this chat transport.

sendInstantMessage

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

Parameters:
message - 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

isContentTypeSupported

boolean isContentTypeSupported(String contentType)
Determines whether this chat transport supports the supplied content type

Parameters:
contentType - the type we want to check
Returns:
true if the chat transport supports it and false otherwise.

sendSmsMessage

void sendSmsMessage(String phoneNumber,
                    String message)
                    throws Exception
Sends the given SMS message trough this chat transport.

Parameters:
phoneNumber - the phone number to which to send the message
message - The message to send.
Throws:
Exception - if the send doesn't succeed

sendSmsMessage

void sendSmsMessage(Contact contact,
                    String message)
                    throws Exception
Sends the given SMS message trough this chat transport.

Parameters:
contact - the phone number to which to send the message
message - The message to send.
Throws:
Exception - if the send doesn't succeed

sendTypingNotification

int sendTypingNotification(int typingState)
Sends a typing notification state.

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

FileTransfer sendFile(File file)
                      throws Exception
Sends the given file trough this chat transport.

Parameters:
file - the file to send
Returns:
the FileTransfer charged to transfer the given file.
Throws:
Exception - if the send doesn't succeed

getMaximumFileLength

long getMaximumFileLength()
Returns the maximum file length supported by the protocol in bytes.

Returns:
the file length that is supported.

inviteChatContact

void inviteChatContact(String contactAddress,
                       String reason)
Invites a contact to join this chat.

Parameters:
contactAddress - the address of the contact we invite
reason - the reason for the invite

getParentChatSession

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

Returns:
the parent session of this chat transport

addSmsMessageListener

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

Parameters:
l - The message listener to add.

addInstantMessageListener

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

Parameters:
l - The message listener to add.

removeSmsMessageListener

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

Parameters:
l - The message listener to remove.

removeInstantMessageListener

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

Parameters:
l - The message listener to remove.

dispose

void dispose()
Disposes this chat transport.


Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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