com.skype
Class SkypeImpl

java.lang.Object
  extended by com.skype.SkypeImpl

public final class SkypeImpl
extends Object

Skype information model (not view) class of Skype4Java. Use this class staticly to do model actions (send messages, SMS messages or calls, etc).

Author:
Koji Hisano
See Also:
SkypeClient

Field Summary
static String LIBRARY_VERSION
          The library version.
 
Method Summary
static Application addApplication(String name)
          Add an AP2AP capable application.
static void addCallListener(CallListener listener)
          Add a listener for CALL events received from the Skype API.
static void addChatMessageListener(ChatMessageListener listener)
          Add a listener for CHATMESSAGE events received from the Skype API.
static void addVoiceMailListener(VoiceMailListener listener)
          Adds a listener for voice mail events received from the Skype API.
static Call call(String... skypeIds)
          Make a Skype CALL to multiple users.
static Call call(String skypeId)
          Make a Skype CALL to one single Skype user.
static Chat chat(String skypeId)
          Start a chat with a single Skype user.
static Chat chat(String[] skypeIds)
          Start a chat with multiple Skype users.
static void clearCallHistory()
          Clears all call history.
static void clearChatHistory()
          Clears all chat history.
static void clearVoiceMailHistory()
          Clears all voice mail history.
static Call[] getAllActiveCalls()
          Gets all the active calls visible on calltabs.
static Chat[] getAllActiveChats()
          Gets the all chats which are open in the windows.
static Chat[] getAllBookmarkedChats()
          Gets the all bookmarked chats.
static Chat[] getAllChats()
          Gets the all chats.
static Chat[] getAllMissedChats()
          Gets the all chats which include unread messages
 SMS[] getAllMissedSMSs()
          Find all missed SMS messages.
static Chat[] getAllRecentChats()
          Gets the all recent chats in the locally-cached history.
 SMS[] getAllSMSs()
          Find all SMS messages.
static VoiceMail[] getAllVoiceMails()
          Gets the all voice mails.
static String getAudioInputDevice()
          Gets the current audio input device of this Skype.
static String getAudioOutputDevice()
          Gets the current audio output device of this Skype.
static ContactList getContactList()
          Get the contactlist instance of this Skype session.
static String getInstalledPath()
          Find the install path of the Skype client.
static Profile getProfile()
          Get the singleton instance of the users profile.
static User getUser(String id)
          Return User based on ID.
static String getVersion()
          Return the version of the Skype client (not this API).
static String getVideoDevice()
          Get the current video input device used by the Skype Client.
static boolean isInstalled()
          Check if Skype client is installed on this computer.
static boolean isRunning()
          Check if Skype client is running.
static void removeCallListener(CallListener listener)
          Remove a listener for CALL events.
static void removeChatMessageListener(ChatMessageListener listener)
          Remove a listener for CHATMESSAGE events.
static void removeVoiceMailListener(VoiceMailListener listener)
          Remove a listener for VOICEMAIL events.
static User[] searchUsers(String keyword)
          Search users by a part of id or e-mail.
static SMS sendSMS(String[] numbers, String content)
          Send an SMS to one or more cell phone numbers.
static SMS sendSMS(String number, String content)
          Send an SMS to one cell phone number.
static void setAudioInputDevice(String deviceName)
          Sets the current audio input device of this Skype.
static void setAudioOutputDevice(String deviceName)
          Sets the current audio output device of this Skype.
static void setDaemon(boolean on)
          Sets the thread of Skype4Java to "daemon mode" or not.
static void setDeamon(boolean on)
          Deprecated. 
static void setDebug(boolean on)
          Enable debug logging.
static void setSkypeExceptionHandler(SkypeExceptionHandler handler)
          Use another exceptionhandler then the default one.
static void setVideoDevice(String deviceName)
          Set the video device used by the Skype client.
static SMS submitConfirmationCode(String number)
          Send a SMS confirmation code.
static SMS submitConfirmationCode(String[] numbers)
          Send a SMS confirmation code.
static SMS submitConfirmationCode(String[] numbers, String code)
          Send a SMS confirmation code.
static SMS submitConfirmationCode(String number, String code)
          Send a SMS confirmation code.
static VoiceMail voiceMail(String skypeId)
          Leave a voicemail in a other Skype users voicemailbox.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIBRARY_VERSION

public static final String LIBRARY_VERSION
The library version.

See Also:
Constant Field Values
Method Detail

setDeamon

@Deprecated
public static void setDeamon(boolean on)
Deprecated. 

Sets the thread of Skype4Java to "daemon mode" or not.

Parameters:
on - true to set the thread to "daemon mode"

setDaemon

public static void setDaemon(boolean on)
Sets the thread of Skype4Java to "daemon mode" or not.

Parameters:
on - true to set the thread to "daemon mode"

setDebug

public static void setDebug(boolean on)
                     throws SkypeException
Enable debug logging.

Parameters:
on - if true debug logging will be sent to the console.
Throws:
SkypeException - when the connection has gone bad.

getVersion

public static String getVersion()
                         throws SkypeException
Return the version of the Skype client (not this API).

Returns:
String with version.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

isInstalled

public static boolean isInstalled()
Check if Skype client is installed on this computer. WARNING, does not work for all platforms yet.

Returns:
true if Skype client is installed.

getInstalledPath

public static String getInstalledPath()
Find the install path of the Skype client. WARNING, does not work for all platforms yet.

Returns:
String with the full path to Skype client.

isRunning

public static boolean isRunning()
                         throws SkypeException
Check if Skype client is running. WARNING, does not work for all platforms.

Returns:
true if Skype client is running.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

searchUsers

public static User[] searchUsers(String keyword)
                          throws SkypeException
Search users by a part of id or e-mail.

Parameters:
keword - a part of id or e-mail
Returns:
users
Throws:
SkypeException - when connection has gone bad or ERROR reply.

getContactList

public static ContactList getContactList()
                                  throws SkypeException
Get the contactlist instance of this Skype session.

Returns:
contactlist singleton.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

call

public static Call call(String... skypeIds)
                 throws SkypeException
Make a Skype CALL to multiple users. Without using the Skype client dialogs.

Parameters:
skypeIds - The users to call.
Returns:
The started Call.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

call

public static Call call(String skypeId)
                 throws SkypeException
Make a Skype CALL to one single Skype user. Without using the Skype client dialogs.

Parameters:
skypeId - The user to call.
Returns:
The new call object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

chat

public static Chat chat(String[] skypeIds)
                 throws SkypeException
Start a chat with multiple Skype users. Without using the Skype client dialogs.

Parameters:
skypeIds - The users to start a chat with.
Returns:
The new chat object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

chat

public static Chat chat(String skypeId)
                 throws SkypeException
Start a chat with a single Skype user. Without using the Skype client dialogs.

Parameters:
skypeId - The user to start the with.
Returns:
The new chat.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

submitConfirmationCode

public static SMS submitConfirmationCode(String[] numbers)
                                  throws SkypeException
Send a SMS confirmation code. An outgoing SMS message from Skype lists the reply-to number as the user's Skype ID. It is possible to change the reply-to number to a mobile phone number by registering the number in the Skype client. Skype validates the number and this number then becomes the reply-to number for outgoing SMS messages.

Parameters:
numbers - the cell phone numbers to validate.
Returns:
A new SMS object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

submitConfirmationCode

public static SMS submitConfirmationCode(String number)
                                  throws SkypeException
Send a SMS confirmation code. An outgoing SMS message from Skype lists the reply-to number as the user's Skype ID. It is possible to change the reply-to number to a mobile phone number by registering the number in the Skype client. Skype validates the number and this number then becomes the reply-to number for outgoing SMS messages.

Parameters:
number - the cell phone numbers to validate.
Returns:
A new SMS object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

submitConfirmationCode

public static SMS submitConfirmationCode(String[] numbers,
                                         String code)
                                  throws SkypeException
Send a SMS confirmation code. An outgoing SMS message from Skype lists the reply-to number as the user's Skype ID. It is possible to change the reply-to number to a mobile phone number by registering the number in the Skype client. Skype validates the number and this number then becomes the reply-to number for outgoing SMS messages.

Parameters:
numbers - the cell phone numbers to validate.
code - the validation code to send.
Returns:
A new SMS object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

submitConfirmationCode

public static SMS submitConfirmationCode(String number,
                                         String code)
                                  throws SkypeException
Send a SMS confirmation code. An outgoing SMS message from Skype lists the reply-to number as the user's Skype ID. It is possible to change the reply-to number to a mobile phone number by registering the number in the Skype client. Skype validates the number and this number then becomes the reply-to number for outgoing SMS messages.

Parameters:
number - the cell phone numbers to validate.
code - the validation code to send.
Returns:
A new SMS object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

sendSMS

public static SMS sendSMS(String[] numbers,
                          String content)
                   throws SkypeException
Send an SMS to one or more cell phone numbers.

Parameters:
numbers - the cell phone numbers to send to.
content - the message to send.
Returns:
The new SMS object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

sendSMS

public static SMS sendSMS(String number,
                          String content)
                   throws SkypeException
Send an SMS to one cell phone number.

Parameters:
number - the cell phone numbers to send to.
content - the message to send.
Returns:
The new SMS object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

getAllSMSs

public SMS[] getAllSMSs()
                 throws SkypeException
Find all SMS messages.

Returns:
Array of SMS messages.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

getAllMissedSMSs

public SMS[] getAllMissedSMSs()
                       throws SkypeException
Find all missed SMS messages.

Returns:
Array of SMS messages.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

voiceMail

public static VoiceMail voiceMail(String skypeId)
                           throws SkypeException
Leave a voicemail in a other Skype users voicemailbox.

Parameters:
skypeId - The Skype user to leave a voicemail.
Returns:
The new Voicemail object.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

getAllVoiceMails

public static VoiceMail[] getAllVoiceMails()
                                    throws SkypeException
Gets the all voice mails.

Returns:
The all voice mails
Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

addApplication

public static Application addApplication(String name)
                                  throws SkypeException
Add an AP2AP capable application.

Parameters:
name - The name of the AP2AP application.
Returns:
Application object reference.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

getAudioInputDevice

public static String getAudioInputDevice()
                                  throws SkypeException
Gets the current audio input device of this Skype.

Returns:
the audio input device name of this Skype, or null if the device is the default.
Throws:
SkypeException - when connection has gone bad or ERROR reply.
See Also:
setAudioInputDevice(String)

getAudioOutputDevice

public static String getAudioOutputDevice()
                                   throws SkypeException
Gets the current audio output device of this Skype.

Returns:
the audio output device name of this Skype, or null if the device is the default.
Throws:
SkypeException - when connection has gone bad or ERROR reply.
See Also:
setAudioOutputDevice(String)

getVideoDevice

public static String getVideoDevice()
                             throws SkypeException
Get the current video input device used by the Skype Client.

Returns:
String with the device name or null if there isn't one.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

setAudioInputDevice

public static void setAudioInputDevice(String deviceName)
                                throws SkypeException
Sets the current audio input device of this Skype.

Parameters:
deviceName - the audio input device name. A null value means the default.
Throws:
SkypeException - when connection has gone bad or ERROR reply.
See Also:
getAudioInputDevice()

setAudioOutputDevice

public static void setAudioOutputDevice(String deviceName)
                                 throws SkypeException
Sets the current audio output device of this Skype.

Parameters:
deviceName - the audio output device name. A null value means the default.
Throws:
SkypeException - when connection has gone bad or ERROR reply.
See Also:
getAudioOutputDevice()

setVideoDevice

public static void setVideoDevice(String deviceName)
                           throws SkypeException
Set the video device used by the Skype client.

Parameters:
deviceName - name of the device to set.
Throws:
SkypeException - when connection has gone bad or ERROR reply.

getProfile

public static Profile getProfile()
Get the singleton instance of the users profile.

Returns:
Profile.

getAllActiveCalls

public static Call[] getAllActiveCalls()
                                throws SkypeException
Gets all the active calls visible on calltabs.

Returns:
all the active calls visible on calltabs
Throws:
SkypeException - thrown when Skype API is unavailable or getting an Skype API error.

getAllChats

public static Chat[] getAllChats()
                          throws SkypeException
Gets the all chats.

Returns:
The all chats
Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

getAllActiveChats

public static Chat[] getAllActiveChats()
                                throws SkypeException
Gets the all chats which are open in the windows.

Returns:
The all chats which are open in the windows
Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

getAllMissedChats

public static Chat[] getAllMissedChats()
                                throws SkypeException
Gets the all chats which include unread messages

Returns:
The all chats which include unread messages
Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

getAllRecentChats

public static Chat[] getAllRecentChats()
                                throws SkypeException
Gets the all recent chats in the locally-cached history.

Returns:
The all recent chats in the locally-cached history
Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

getAllBookmarkedChats

public static Chat[] getAllBookmarkedChats()
                                    throws SkypeException
Gets the all bookmarked chats.

Returns:
The all bookmarked chats
Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

clearCallHistory

public static void clearCallHistory()
                             throws SkypeException
Clears all call history.

Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

clearChatHistory

public static void clearChatHistory()
                             throws SkypeException
Clears all chat history.

Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

clearVoiceMailHistory

public static void clearVoiceMailHistory()
                                  throws SkypeException
Clears all voice mail history.

Throws:
SkypeException - If there is a problem with the connection or state at the Skype client.

getUser

public static User getUser(String id)
Return User based on ID.

Parameters:
id - ID of the User.
Returns:
The user found.

addChatMessageListener

public static void addChatMessageListener(ChatMessageListener listener)
                                   throws SkypeException
Add a listener for CHATMESSAGE events received from the Skype API.

Parameters:
listener - the Listener to add.
Throws:
SkypeException - when connection has gone bad or ERROR reply.
See Also:
removeChatMessageListener(ChatMessageListener)

removeChatMessageListener

public static void removeChatMessageListener(ChatMessageListener listener)
Remove a listener for CHATMESSAGE events. If the listener is already removed nothing happens.

Parameters:
listener - The listener to remove.
See Also:
addChatMessageListener(ChatMessageListener)

addCallListener

public static void addCallListener(CallListener listener)
                            throws SkypeException
Add a listener for CALL events received from the Skype API.

Parameters:
listener - the listener to add.
Throws:
SkypeException - when connection has gone bad or ERROR reply.
See Also:
CallListener

removeCallListener

public static void removeCallListener(CallListener listener)
Remove a listener for CALL events. If listener is already removed nothing happens.

Parameters:
listener - The listener to add.

addVoiceMailListener

public static void addVoiceMailListener(VoiceMailListener listener)
                                 throws SkypeException
Adds a listener for voice mail events received from the Skype API.

Parameters:
listener - the added listener
Throws:
SkypeException - if connection is bad or error is returned
See Also:
VoicemaListener

removeVoiceMailListener

public static void removeVoiceMailListener(VoiceMailListener listener)
Remove a listener for VOICEMAIL events. If listener is already removed nothing happens.

Parameters:
listener - The listener to add.

setSkypeExceptionHandler

public static void setSkypeExceptionHandler(SkypeExceptionHandler handler)
Use another exceptionhandler then the default one.

Parameters:
handler - the handler to use.
See Also:
SkypeExceptionHandler


Copyright © 2004-2011. All Rights Reserved.