i3mclient.communication
Class Communication

java.lang.Object
  |
  +--i3mclient.communication.Communication
All Implemented Interfaces:
Runnable

public class Communication
extends Object
implements Runnable

Encapsulated interface to fit concept name. Communication is created as a Singleton Pattern.

Author:
Dirk Plate

Nested Class Summary
 class Communication.AsynchronCallItem
          One item of the asynchron call lists.
 
Field Summary
static int ADDBUDDY
           
static int CHANGEBUDDYGROUP
           
static int CREATEACCOUNT
           
static int CREATECONFERENCE
           
static int DELETEACCOUNT
           
static int FINDUSERS
           
static int GETBUDDYLIST
           
static int GETCHATLIST
           
static int GETDAILYCOMIC
           
static int GETDISCUSSIONMEMBERS
           
static int GETMESSAGES
           
static int GETOFFLINEMESSAGES
           
static int GETPUBLICKEY
           
static int GETUSERDATA
           
static int GETVERSION
           
static int INVITEUSER
           
static int JOINCHAT
           
static int LEAVEDISCUSSION
           
static int LOGINACCOUNT
           
static int LOGOUTACCOUNT
           
static int REMOVEBUDDY
           
static int SEARCHWEB
           
static int SENDFAX
           
static int SENDMESSAGE
           
static int SETSTATUS
           
static int SETUSERDATA
           
static int TRANSLATE
           
 
Constructor Summary
Communication()
          Constructor.
 
Method Summary
 void addBuddy(long userID, String group)
          Add a buddy to the buddy list of the current logged in user.
 void addBuddyAsynchron(long userID, String group, SMAddBuddyListener listener, boolean swtThreadRequired)
          Add a buddy to the buddy list of the current logged in user (asynchron).
 void addErrorListener(ErrorListener listener)
          Add a listener for all errors.
 void changeBuddyGroup(long userID, String group)
          Change the group of a buddy in the buddy list.
 void changeBuddyGroupAsynchron(long userID, String group, SMChangeBuddyGroupListener listener, boolean swtThreadRequired)
          Change the group of a buddy in the buddy list (asynchron).
 long createAccount(String nick, byte[] password)
          Create an account on I3M-server.
 void createAccountAsynchron(String nick, byte[] password, SMCreateAccountListener listener, boolean swtThreadRequired)
          Create an account on I3M-server (asynchron).
 long createConference(long userID)
          Create an new conference on I3M-server.
 void createConference(long userID, SMCreateConferenceListener listener, boolean swtThreadRequired)
          Create an new conference on I3M-server (asynchron).
 void deleteAccount()
          Delete the current logged in account from I3M-server.
 void deleteAccountAsynchron(SMDeleteAccountListener listener, boolean swtThreadRequired)
          Delete the current logged in account from I3M-server (asynchron).
 UserData[] findUsers(UserData userData, boolean fuzzy)
          Search for users in I3M-network.
 void findUsersAsynchron(UserData userData, boolean fuzzy, SMFindUsersListener listener, boolean swtThreadRequired)
          Search for users in I3M-network (asynchron).
 BuddyData[] getBuddyList()
          Returns the buddy list of the current logged in user.
 void getBuddyListAsynchron(SMGetBuddyListListener listener, boolean swtThreadRequired)
          Returns the buddy list of the current logged in user (asynchron).
 DiscussionData[] getChatList()
          Get a list with all available chats.
 void getChatListAsynchron(SMGetChatListListener listener, boolean swtThreadRequired)
          Get a list with all available chats (asynchron).
 byte[] getDailyComic()
          Get a daily comic for the current logged in user (only once one day).
 void getDailyComicAsynchron(SMGetDailyComicListener listener, boolean swtThreadRequired)
          Get a daily comic for the current logged in user (only once one day) (asynchron).
 BuddyData[] getDiscussionMembers(long discussionID)
          Retrieve all discussion members of a chat or conference.
 void getDiscussionMembersAsynchron(long discussionID, SMGetDiscussionMembersListener listener, boolean swtThreadRequired)
          Retrieve all discussion members of a chat or conference (asynchron).
static Communication getInstance()
          Returns an instance of this class (singleton construction)
 MessageData[] getMessages()
          Get all new messages of the current logged in user.
 void getMessagesAsynchron(SMGetMessagesListener listener, boolean swtThreadRequired)
          Get all new messages of the current logged in user (asynchron).
 MessageData[] getOfflineMessages()
          Get all offline message of the current logged in user.
 void getOfflineMessagesAsynchron(SMGetOfflineMessagesListener listener, boolean swtThreadRequired)
          Get all offline message of the current logged in user (asynchron).
 PublicKey getPublicKey()
          Get the current sessionID and public key from I3M-server.
 void getPublicKeyAsynchron(SMTranslateListener listener, boolean swtThreadRequired)
          Get the current sessionID and public key from I3M-server (asynchron).
 UserData getUserData(long userID)
          Retrieve the userData of an user.
 void getUserDataAsynchron(long userID, SMGetUserDataListener listener, boolean swtThreadRequired)
          Retrieve the userData of an user (asynchron).
 String getVersion(String version)
          Returns the latest version of I3M.
 void getVersionAsynchron(String version, SMGetVersionListener listener, boolean swtThreadRequired)
          Returns the latest version of I3M (asynchron).
 void informListener(Communication.AsynchronCallItem currentItem)
          Inform all listener of asynchron calls.
 void inviteUser(long discussionID, long userID)
          Invite a user to a chat or conference.
 void inviteUserAsynchron(long discussionID, long userID, SMInviteUserListener listener, boolean swtThreadRequired)
          Invite a user to a chat or conference (asynchron).
 void joinChat(long discussionID)
          Joins the current logged in user to a chat.
 void joinChatAsynchron(long discussionID, SMJoinChatListener listener, boolean swtThreadRequired)
          Joins the current logged in user to a chat (asynchron).
 void leaveDiscussion(long discussionID, int type)
          The current logged in user want to leave a chat or conference.
 void leaveDiscussionAsynchron(long discussionID, int type, SMLeaveDiscussionListener listener, boolean swtThreadRequired)
          The current logged in user want to leave a chat or conference (asynchron).
 void loginAccount(long userID, byte[] password)
          Login an account on I3M-server.
 void loginAccountAsynchron(long userID, byte[] password, SMLoginAccountListener listener, boolean swtThreadRequired)
          Login an account on I3M-server (asynchron).
 void logoutAccount()
          Logout an account on I3M-server (go offline).
 void logoutAccountAsynchron(SMLogoutAccountListener listener, boolean swtThreadRequired)
          Logout an account on I3M-server (go offline) (asynchron).
 void removeBuddy(long userID)
          Remove a buddy from the buddy list of the current logged in user.
 void removeBuddyAsynchron(long userID, SMRemoveBuddyListener listener, boolean swtThreadRequired)
          Remove a buddy from the buddy list of the current logged in user (asynchron).
 void removeErrorListener(ErrorListener listener)
          Remove a listener for all errors.
 void run()
           
 WebSearchResult[] searchWeb(String query)
          Search in the web by keywords.
 void searchWebAsynchron(String query, SMSearchWebListener listener, boolean swtThreadRequired)
          Search in the web by keywords (asynchron).
 void sendFax(String faxNo, String text)
          Send a fax to a fax number.
 void sendFaxAsynchron(String faxNo, String text, SMSendFaxListener listener, boolean swtThreadRequired)
          Send a fax to a fax number (asynchron).
 void sendMessage(MessageData messageData)
          Send a message to an other user.
 void sendMessageAsynchron(MessageData messageData, SMSendMessageListener listener, boolean swtThreadRequired)
          Send a message to an other user (asynchron).
 void setStatus(int status)
          Set the status of the current logged in user.
 void setStatusAsynchron(int status, SMSetStatusListener listener, boolean swtThreadRequired)
          Set the status of the current logged in user (asynchron).
 void setUserData(UserData userData)
          Set the userdata of the current logged in user.
 void setUserDataAsynchron(UserData userData, SMSetUserDataListener listener, boolean swtThreadRequired)
          Set the userdata of the current logged in user (asynchron).
 String translate(String fromLanguage, String toLanguage, String text)
          Translate a string via extern web service.
 void translateAsynchron(String fromLanguage, String toLanguage, String text, SMTranslateListener listener, boolean swtThreadRequired)
          Translate a string via extern web service (asychron).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADDBUDDY

public static final int ADDBUDDY
See Also:
Constant Field Values

CHANGEBUDDYGROUP

public static final int CHANGEBUDDYGROUP
See Also:
Constant Field Values

CREATEACCOUNT

public static final int CREATEACCOUNT
See Also:
Constant Field Values

CREATECONFERENCE

public static final int CREATECONFERENCE
See Also:
Constant Field Values

DELETEACCOUNT

public static final int DELETEACCOUNT
See Also:
Constant Field Values

FINDUSERS

public static final int FINDUSERS
See Also:
Constant Field Values

GETBUDDYLIST

public static final int GETBUDDYLIST
See Also:
Constant Field Values

GETCHATLIST

public static final int GETCHATLIST
See Also:
Constant Field Values

GETDAILYCOMIC

public static final int GETDAILYCOMIC
See Also:
Constant Field Values

GETDISCUSSIONMEMBERS

public static final int GETDISCUSSIONMEMBERS
See Also:
Constant Field Values

GETMESSAGES

public static final int GETMESSAGES
See Also:
Constant Field Values

GETOFFLINEMESSAGES

public static final int GETOFFLINEMESSAGES
See Also:
Constant Field Values

GETUSERDATA

public static final int GETUSERDATA
See Also:
Constant Field Values

GETVERSION

public static final int GETVERSION
See Also:
Constant Field Values

INVITEUSER

public static final int INVITEUSER
See Also:
Constant Field Values

JOINCHAT

public static final int JOINCHAT
See Also:
Constant Field Values

LEAVEDISCUSSION

public static final int LEAVEDISCUSSION
See Also:
Constant Field Values

LOGINACCOUNT

public static final int LOGINACCOUNT
See Also:
Constant Field Values

LOGOUTACCOUNT

public static final int LOGOUTACCOUNT
See Also:
Constant Field Values

REMOVEBUDDY

public static final int REMOVEBUDDY
See Also:
Constant Field Values

SEARCHWEB

public static final int SEARCHWEB
See Also:
Constant Field Values

SENDFAX

public static final int SENDFAX
See Also:
Constant Field Values

SENDMESSAGE

public static final int SENDMESSAGE
See Also:
Constant Field Values

SETSTATUS

public static final int SETSTATUS
See Also:
Constant Field Values

SETUSERDATA

public static final int SETUSERDATA
See Also:
Constant Field Values

TRANSLATE

public static final int TRANSLATE
See Also:
Constant Field Values

GETPUBLICKEY

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

Communication

public Communication()
Constructor.

Method Detail

getInstance

public static Communication getInstance()
Returns an instance of this class (singleton construction)

Returns:
The unique instance of this class

createAccount

public long createAccount(String nick,
                          byte[] password)
                   throws I3MServerException
Create an account on I3M-server.

Parameters:
nick - The nick of new user
password - The password of new user
Returns:
The new userID for this user
Throws:
I3MServerException - Error from webservice

createAccountAsynchron

public void createAccountAsynchron(String nick,
                                   byte[] password,
                                   SMCreateAccountListener listener,
                                   boolean swtThreadRequired)
Create an account on I3M-server (asynchron).

Parameters:
nick - The nick of new user
password - The password of new user
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

loginAccount

public void loginAccount(long userID,
                         byte[] password)
                  throws I3MServerException
Login an account on I3M-server.

Parameters:
userID - The userID of user
password - The password of user (encrypted with RSA)
Throws:
I3MServerException - Error from webservice

loginAccountAsynchron

public void loginAccountAsynchron(long userID,
                                  byte[] password,
                                  SMLoginAccountListener listener,
                                  boolean swtThreadRequired)
Login an account on I3M-server (asynchron).

Parameters:
userID - The userID of user
password - The password of user (encrypted with RSA)
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

logoutAccount

public void logoutAccount()
                   throws I3MServerException
Logout an account on I3M-server (go offline).

Throws:
I3MServerException - Error from webservice

logoutAccountAsynchron

public void logoutAccountAsynchron(SMLogoutAccountListener listener,
                                   boolean swtThreadRequired)
Logout an account on I3M-server (go offline) (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getUserData

public UserData getUserData(long userID)
                     throws I3MServerException
Retrieve the userData of an user.

Parameters:
userID - Get the UserData of a user with this userID
Returns:
The UserData of an user
Throws:
I3MServerException - Error from webservice

getUserDataAsynchron

public void getUserDataAsynchron(long userID,
                                 SMGetUserDataListener listener,
                                 boolean swtThreadRequired)
Retrieve the userData of an user (asynchron).

Parameters:
userID - Get the UserData of a user with this userID
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

setUserData

public void setUserData(UserData userData)
                 throws I3MServerException
Set the userdata of the current logged in user.

Parameters:
userData - The new UserData.
Throws:
I3MServerException - Error from webservice

setUserDataAsynchron

public void setUserDataAsynchron(UserData userData,
                                 SMSetUserDataListener listener,
                                 boolean swtThreadRequired)
Set the userdata of the current logged in user (asynchron).

Parameters:
userData - The new UserData.
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

deleteAccount

public void deleteAccount()
                   throws I3MServerException
Delete the current logged in account from I3M-server.

Throws:
I3MServerException - Error from webservice

deleteAccountAsynchron

public void deleteAccountAsynchron(SMDeleteAccountListener listener,
                                   boolean swtThreadRequired)
Delete the current logged in account from I3M-server (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getBuddyList

public BuddyData[] getBuddyList()
                         throws I3MServerException
Returns the buddy list of the current logged in user.

Returns:
The buddy list of the user
Throws:
I3MServerException - Error from webservice

getBuddyListAsynchron

public void getBuddyListAsynchron(SMGetBuddyListListener listener,
                                  boolean swtThreadRequired)
Returns the buddy list of the current logged in user (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

addBuddy

public void addBuddy(long userID,
                     String group)
              throws I3MServerException
Add a buddy to the buddy list of the current logged in user.

Parameters:
userID - The userID of the user which should be added to the buddy list
group - The new buddy should appear in this group
Throws:
I3MServerException - Error from webservice

addBuddyAsynchron

public void addBuddyAsynchron(long userID,
                              String group,
                              SMAddBuddyListener listener,
                              boolean swtThreadRequired)
Add a buddy to the buddy list of the current logged in user (asynchron).

Parameters:
userID - The userID of the user which should be added to the buddy list
group - The new buddy should appear in this group
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

changeBuddyGroup

public void changeBuddyGroup(long userID,
                             String group)
                      throws I3MServerException
Change the group of a buddy in the buddy list.

Parameters:
userID - The userID of the buddy which should be moved in an other group
group - The name of the new group
Throws:
I3MServerException - Error from webservice

changeBuddyGroupAsynchron

public void changeBuddyGroupAsynchron(long userID,
                                      String group,
                                      SMChangeBuddyGroupListener listener,
                                      boolean swtThreadRequired)
Change the group of a buddy in the buddy list (asynchron).

Parameters:
userID - The userID of the buddy which should be moved in an other group
group - The name of the new group
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

removeBuddy

public void removeBuddy(long userID)
                 throws I3MServerException
Remove a buddy from the buddy list of the current logged in user.

Parameters:
userID - The user with this userID will be removed
Throws:
I3MServerException - Error from webservice

removeBuddyAsynchron

public void removeBuddyAsynchron(long userID,
                                 SMRemoveBuddyListener listener,
                                 boolean swtThreadRequired)
Remove a buddy from the buddy list of the current logged in user (asynchron).

Parameters:
userID - The user with this userID will be removed
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

setStatus

public void setStatus(int status)
               throws I3MServerException
Set the status of the current logged in user.

Parameters:
status - The new status
Throws:
I3MServerException - Error from webservice

setStatusAsynchron

public void setStatusAsynchron(int status,
                               SMSetStatusListener listener,
                               boolean swtThreadRequired)
Set the status of the current logged in user (asynchron).

Parameters:
status - The new status
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getMessages

public MessageData[] getMessages()
                          throws I3MServerException
Get all new messages of the current logged in user.

Returns:
The new messages (since last getMessage-call)
Throws:
I3MServerException - Error from webservice

getMessagesAsynchron

public void getMessagesAsynchron(SMGetMessagesListener listener,
                                 boolean swtThreadRequired)
Get all new messages of the current logged in user (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getOfflineMessages

public MessageData[] getOfflineMessages()
                                 throws I3MServerException
Get all offline message of the current logged in user.

Returns:
All offline messages (since last logoff)
Throws:
I3MServerException - Error from webservice

getOfflineMessagesAsynchron

public void getOfflineMessagesAsynchron(SMGetOfflineMessagesListener listener,
                                        boolean swtThreadRequired)
Get all offline message of the current logged in user (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

sendMessage

public void sendMessage(MessageData messageData)
                 throws I3MServerException
Send a message to an other user.

Parameters:
messageData - The message
Throws:
I3MServerException - Error from webservice

sendMessageAsynchron

public void sendMessageAsynchron(MessageData messageData,
                                 SMSendMessageListener listener,
                                 boolean swtThreadRequired)
Send a message to an other user (asynchron).

Parameters:
messageData - The message
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getVersion

public String getVersion(String version)
                  throws I3MServerException
Returns the latest version of I3M.

Parameters:
version - The version of I3M-client
Returns:
The latest version of I3M-client
Throws:
I3MServerException - Error from webservice

getVersionAsynchron

public void getVersionAsynchron(String version,
                                SMGetVersionListener listener,
                                boolean swtThreadRequired)
Returns the latest version of I3M (asynchron).

Parameters:
version - The version of I3M-client
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getDailyComic

public byte[] getDailyComic()
                     throws I3MServerException
Get a daily comic for the current logged in user (only once one day).

Returns:
The daily comic in a byte array
Throws:
I3MServerException - Error from webservice

getDailyComicAsynchron

public void getDailyComicAsynchron(SMGetDailyComicListener listener,
                                   boolean swtThreadRequired)
Get a daily comic for the current logged in user (only once one day) (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getChatList

public DiscussionData[] getChatList()
                             throws I3MServerException
Get a list with all available chats.

Returns:
These chats are available at I3M-server
Throws:
I3MServerException - Error from webservice

getChatListAsynchron

public void getChatListAsynchron(SMGetChatListListener listener,
                                 boolean swtThreadRequired)
Get a list with all available chats (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

joinChat

public void joinChat(long discussionID)
              throws I3MServerException
Joins the current logged in user to a chat.

Parameters:
discussionID - The discussionID of the chat to join
Throws:
I3MServerException - Error from webservice

joinChatAsynchron

public void joinChatAsynchron(long discussionID,
                              SMJoinChatListener listener,
                              boolean swtThreadRequired)
Joins the current logged in user to a chat (asynchron).

Parameters:
discussionID - The discussionID of the chat to join
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

createConference

public long createConference(long userID)
                      throws I3MServerException
Create an new conference on I3M-server.

Parameters:
userID - The userID of the user which will be with the current logged in user in the conference
Returns:
The discussionID of the new conference
Throws:
I3MServerException - Error from webservice

createConference

public void createConference(long userID,
                             SMCreateConferenceListener listener,
                             boolean swtThreadRequired)
Create an new conference on I3M-server (asynchron).

Parameters:
userID - The userID of the user which will be with the current logged in user in the conference
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

inviteUser

public void inviteUser(long discussionID,
                       long userID)
                throws I3MServerException
Invite a user to a chat or conference.

Parameters:
discussionID - The discussionID of the chat or conference
userID - The userID of the user which is invited
Throws:
I3MServerException - Error from webservice

inviteUserAsynchron

public void inviteUserAsynchron(long discussionID,
                                long userID,
                                SMInviteUserListener listener,
                                boolean swtThreadRequired)
Invite a user to a chat or conference (asynchron).

Parameters:
discussionID - The discussionID of the chat or conference
userID - The userID of the user which is invited
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getDiscussionMembers

public BuddyData[] getDiscussionMembers(long discussionID)
                                 throws I3MServerException
Retrieve all discussion members of a chat or conference.

Parameters:
discussionID - The discussionID of the chat or conference
Returns:
All members of the chat or conference
Throws:
I3MServerException - Error from webservice

getDiscussionMembersAsynchron

public void getDiscussionMembersAsynchron(long discussionID,
                                          SMGetDiscussionMembersListener listener,
                                          boolean swtThreadRequired)
Retrieve all discussion members of a chat or conference (asynchron).

Parameters:
discussionID - The discussionID of the chat or conference
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

leaveDiscussion

public void leaveDiscussion(long discussionID,
                            int type)
                     throws I3MServerException
The current logged in user want to leave a chat or conference.

Parameters:
discussionID - The discussionID of the chat or conference
type - The type of leaving (hide or leave)
Throws:
I3MServerException - Error from webservice

leaveDiscussionAsynchron

public void leaveDiscussionAsynchron(long discussionID,
                                     int type,
                                     SMLeaveDiscussionListener listener,
                                     boolean swtThreadRequired)
The current logged in user want to leave a chat or conference (asynchron).

Parameters:
discussionID - The discussionID of the chat or conference
type - The type of leaving (hide or leave)
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

findUsers

public UserData[] findUsers(UserData userData,
                            boolean fuzzy)
                     throws I3MServerException
Search for users in I3M-network.

Parameters:
userData - UserData with the search query (empty fields means asterix)
fuzzy - Only exact matches will be found
Returns:
UserDatas of all found users
Throws:
I3MServerException - Error from webservice

findUsersAsynchron

public void findUsersAsynchron(UserData userData,
                               boolean fuzzy,
                               SMFindUsersListener listener,
                               boolean swtThreadRequired)
Search for users in I3M-network (asynchron).

Parameters:
userData - UserData with the search query (empty fields means asterix)
fuzzy - Only exact matches will be found
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

searchWeb

public WebSearchResult[] searchWeb(String query)
                            throws I3MServerException
Search in the web by keywords.

Parameters:
query - Search for this string
Returns:
All found websites
Throws:
I3MServerException - Error from webservice

searchWebAsynchron

public void searchWebAsynchron(String query,
                               SMSearchWebListener listener,
                               boolean swtThreadRequired)
Search in the web by keywords (asynchron).

Parameters:
query - Search for this string
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

sendFax

public void sendFax(String faxNo,
                    String text)
             throws I3MServerException
Send a fax to a fax number.

Parameters:
faxNo - The fax number
text - The text to fax
Throws:
I3MServerException - Error from webservice

sendFaxAsynchron

public void sendFaxAsynchron(String faxNo,
                             String text,
                             SMSendFaxListener listener,
                             boolean swtThreadRequired)
Send a fax to a fax number (asynchron).

Parameters:
faxNo - The fax number
text - The text to fax
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

translate

public String translate(String fromLanguage,
                        String toLanguage,
                        String text)
                 throws I3MServerException
Translate a string via extern web service.

Parameters:
fromLanguage - The language of the original text (short string)
toLanguage - Translate the original text in this language (short string)
text - The text to translate
Returns:
The translated text
Throws:
I3MServerException - Error from webservice

translateAsynchron

public void translateAsynchron(String fromLanguage,
                               String toLanguage,
                               String text,
                               SMTranslateListener listener,
                               boolean swtThreadRequired)
Translate a string via extern web service (asychron).

Parameters:
fromLanguage - The language of the original text (short string)
toLanguage - Translate the original text in this language (short string)
text - The text to translate
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

getPublicKey

public PublicKey getPublicKey()
                       throws I3MServerException
Get the current sessionID and public key from I3M-server.

Returns:
The current sessionID and public key
Throws:
I3MServerException - Error from webservice

getPublicKeyAsynchron

public void getPublicKeyAsynchron(SMTranslateListener listener,
                                  boolean swtThreadRequired)
Get the current sessionID and public key from I3M-server (asynchron).

Parameters:
listener - The listener which will be informed
swtThreadRequired - The listener will be informed in a SWT-thread

addErrorListener

public void addErrorListener(ErrorListener listener)
Add a listener for all errors.

Parameters:
listener - The listener which will be informed about all errors

removeErrorListener

public void removeErrorListener(ErrorListener listener)
Remove a listener for all errors.

Parameters:
listener - The listener which will no longer be informed about all errors

run

public void run()
Specified by:
run in interface Runnable

informListener

public void informListener(Communication.AsynchronCallItem currentItem)
Inform all listener of asynchron calls.

Parameters:
currentItem - The current asynchron call