com.skype.connector.windows
Class WindowsConnector

java.lang.Object
  extended by com.skype.connector.Connector
      extended by com.skype.connector.windows.WindowsConnector

public final class WindowsConnector
extends Connector

A connector implementation for Windows based on the SWT libraries. Please, use Win32Connector if SWT is not an option for you.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.skype.connector.Connector
Connector.Status
 
Method Summary
protected  Connector.Status connect(int timeout)
          Implementation of the connect method for this connector.
protected  void disposeImpl()
          Clean up and disconnect.
 String getInstalledPath()
          Returns the location of Skype.exe file from the MS Windows registry (implicit it check if Skype is installed or not).
static WindowsConnector getInstance()
          Gets the singleton instance of the WindowsConnector class.
protected  void initializeImpl()
          Initialize the connector.
 boolean isRunning()
          Checks if the Skype client is running or not.
protected  void sendApplicationName(String applicationName)
          Send the application name to the Skype Client.
protected  void sendCommand(String command)
          Send a command to the Skype client.
 
Methods inherited from class com.skype.connector.Connector
addConnectorListener, addConnectorListener, addConnectorListener, connect, dispose, execute, execute, execute, execute, execute, executeWithId, executeWithoutTimeout, fireMessageReceived, getApplicationName, getCommandTimeout, getConnectTimeout, getDebugOut, getStatus, getStringProperty, initialize, removeConnectorListener, sendProtocol, setApplicationName, setCommandTimeout, setConnectTimeout, setDebug, setDebugOut, setDebugOut, setInstance, setStatus, setStringProperty, useJNIConnector, waitForEndWithId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WindowsConnector getInstance()
Gets the singleton instance of the WindowsConnector class.

Returns:
the singleton instance of the WindowsConnector class

getInstalledPath

public String getInstalledPath()
Returns the location of Skype.exe file from the MS Windows registry (implicit it check if Skype is installed or not). Checks in the registry if the key: {HKCU\Software\Skype\Phone, SkypePath} exists; if not, it checks again but now for {HKLM\Software\Skype\Phone, SkypePath}; if HKCU key does not exist but the HKLM key is present, Skype has been installed from an administrator account has but not been used from the current account; otherwise there is no Skype installed.

Overrides:
getInstalledPath in class Connector
Returns:
the path to the Skype.exe file if Skype is installed or null.

isRunning

public boolean isRunning()
                  throws ConnectorException
Checks if the Skype client is running or not.

Overrides:
isRunning in class Connector
Returns:
true if the Skype client is runnunig; false otherwise
Throws:
ConnectorException - if checking the Skype client status failed

initializeImpl

protected void initializeImpl()
                       throws ConnectorException
Initialize the connector.

Specified by:
initializeImpl in class Connector
Parameters:
timeout - Maximum amout of time in millieseconds to initialize.
Throws:
ConnectorException - when initialization cannot be completed.

connect

protected Connector.Status connect(int timeout)
                            throws ConnectorException
Implementation of the connect method for this connector.

Specified by:
connect in class Connector
Parameters:
timeout - maximum amout of time to connect.
Returns:
Status after connecting.
Throws:
ConnectorException - when connection could not be established.

sendApplicationName

protected void sendApplicationName(String applicationName)
                            throws ConnectorException
Send the application name to the Skype Client.

Overrides:
sendApplicationName in class Connector
Parameters:
applicationName - the new applicationname.
Throws:
ConnectorException - when connection to Skype client has gone bad.

disposeImpl

protected void disposeImpl()
Clean up and disconnect.

Specified by:
disposeImpl in class Connector

sendCommand

protected void sendCommand(String command)
Send a command to the Skype client.

Specified by:
sendCommand in class Connector
Parameters:
command - The command to send.


Copyright © 2004-2011. All Rights Reserved.