cvm.ncb.adapters
Class SkypeAdapter

java.lang.Object
  extended by cvm.ncb.adapters.NCBBridge
      extended by cvm.ncb.adapters.SkypeAdapter

public class SkypeAdapter
extends NCBBridge

This is an adapter to the Skype interface. This class wraps around the skype4java API calls. For starters it performs the basic operations that are required by the basic implementation of CVM but it can be extended to perform all the operations allowed by Skype with the uses of Skype call and chat objects and the connector object. Date: 01/13/2008

Author:
Frank Hernandez
See Also:
Connector

Field Summary
 boolean b_SendLock
           
 boolean m_bConnectorLocked
           
 
Fields inherited from class cvm.ncb.adapters.NCBBridge
password, username
 
Constructor Summary
SkypeAdapter()
           
 
Method Summary
 void addParticipant(java.lang.String sID, java.lang.String participantID)
          Adds a participant to the session.
 void addParticpantToApplication(java.lang.String participantID)
          This function adds a participant to the current application.
 void createSession(java.lang.String sID)
          This function creates a session in the Networks Bridge for the specified session ID.
 void disableMedium(java.lang.String connectionID, java.lang.String mediumName)
          This function is used to disable a communicaciot medium.
 void enableMedium(java.lang.String connectionID, java.lang.String mediumName)
          This function is used to enable a communicaciot medium.
 void enqueueSchemaForProcessing(java.lang.String arg0)
          Places the schemas in a container for processing.
 java.lang.String getCapability()
          Returns the device capabilities.
static com.skype.Call getMyCall()
           
 void handledReceviedSchemas()
          Private this method handles all the schemas that have been received and have yet to be sent to the upper layers.
 boolean isAppConnected()
           
 boolean isLoggedIn(java.lang.String userName)
          Check if user is logged in.
 boolean isSessionCreated(java.lang.String sID)
          Checks is the session is currntly created.
 UserObject login(java.lang.String userName, java.lang.String password)
          Returns a user object after login
 void logout(java.lang.String userName)
          Logs the user out.
 void removeParticipant(java.lang.String sID, java.lang.String participantID)
          Removes a participant to the session.
 void restartService()
          Restarts the adapter.
 void sendMedia(java.lang.String sID, java.lang.String medium, java.lang.String mediumURL)
           
 void sendSchema(java.lang.String schema, java.lang.String participantID)
          This function sends the schema file to the specified user.
 void setAppConnected(boolean conn)
           
static void setMyCall(com.skype.Call aCall)
           
 void signalSchemaReceived()
           
 void switchToVideo(java.lang.String sessionID)
          This function switches the call to video call.
 void transferFromChatToConference(java.lang.String sID)
          This function transfer all the members of a chat into a conference call.
 void transferFromConferenceToChat(java.lang.String sID)
          This function transfer all the members of a conference into a chat session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

b_SendLock

public boolean b_SendLock

m_bConnectorLocked

public boolean m_bConnectorLocked
Constructor Detail

SkypeAdapter

public SkypeAdapter()
Method Detail

getMyCall

public static com.skype.Call getMyCall()

setMyCall

public static void setMyCall(com.skype.Call aCall)

getCapability

public java.lang.String getCapability()
Returns the device capabilities.

Specified by:
getCapability in class NCBBridge
Returns:
list of capabilities as defined in the NCBBridgeCapability class.
See Also:
NCBBridgeCapability

login

public UserObject login(java.lang.String userName,
                        java.lang.String password)
                 throws LoginException
Returns a user object after login

Specified by:
login in class NCBBridge
Parameters:
userName - Username registered under the specific bridge.
password - Password registered under the specific bridge.
Returns:
UserObject with the user infromation.
Throws:
LoginException
See Also:
UserObject

logout

public void logout(java.lang.String userName)
Logs the user out.

Specified by:
logout in class NCBBridge

restartService

public void restartService()
Restarts the adapter.

Specified by:
restartService in class NCBBridge

createSession

public void createSession(java.lang.String sID)
This function creates a session in the Networks Bridge for the specified session ID.

Specified by:
createSession in class NCBBridge
Parameters:
sID - Id of the session to create.

addParticipant

public void addParticipant(java.lang.String sID,
                           java.lang.String participantID)
                    throws PartyNotAddedException,
                           NoSessionException
Adds a participant to the session.

Specified by:
addParticipant in class NCBBridge
Parameters:
sID - Id of the session to add.
participantID - Id of the participant to add. i.e useranem: crinsomkairos.
Throws:
PartyNotAddedException
NoSessionException
com.skype.connector.ConnectorException

enableMedium

public void enableMedium(java.lang.String connectionID,
                         java.lang.String mediumName)
                  throws PartyNotAddedException,
                         NoSessionException
This function is used to enable a communicaciot medium. This will activate the audio in the communication or chat...

Specified by:
enableMedium in class NCBBridge
Parameters:
connectionID -
mediumName -
Throws:
PartyNotAddedException
NoSessionException

disableMedium

public void disableMedium(java.lang.String connectionID,
                          java.lang.String mediumName)
                   throws com.skype.SkypeException,
                          PartyNotFoundException,
                          NoSessionException
This function is used to disable a communicaciot medium. This will deactivate the audio in the communication or chat...

Specified by:
disableMedium in class NCBBridge
Parameters:
connectionID -
mediumName -
Throws:
PartyNotAddedException
NoSessionException
com.skype.SkypeException
PartyNotFoundException

removeParticipant

public void removeParticipant(java.lang.String sID,
                              java.lang.String participantID)
                       throws PartyNotFoundException,
                              NoSessionException
Removes a participant to the session.

Specified by:
removeParticipant in class NCBBridge
Parameters:
sID - Id of the session to remove.
participantID - Id of the participant to remove. i.e useranem: crinsomkairos.
Throws:
PartyNotFoundException
NoSessionException

switchToVideo

public void switchToVideo(java.lang.String sessionID)
This function switches the call to video call. Skype does not allow for conference video at the moment so only one to one calls are switched to video.

Parameters:
sessionID - Id of the session to change.

transferFromChatToConference

public void transferFromChatToConference(java.lang.String sID)
This function transfer all the members of a chat into a conference call.

Parameters:
sID -

transferFromConferenceToChat

public void transferFromConferenceToChat(java.lang.String sID)
                                  throws PartyNotAddedException,
                                         NoSessionException
This function transfer all the members of a conference into a chat session.

Parameters:
sID -
Throws:
NoSessionException
PartyNotAddedException

isLoggedIn

public boolean isLoggedIn(java.lang.String userName)
                   throws LoginException
Check if user is logged in.

Specified by:
isLoggedIn in class NCBBridge
Parameters:
userName - user handle to check for ownership of the Bridge.
Returns:
true if the user is the owner of the bridge.
Throws:
LoginException

isSessionCreated

public boolean isSessionCreated(java.lang.String sID)
Checks is the session is currntly created.

Specified by:
isSessionCreated in class NCBBridge
Parameters:
sID - Session to check.
Returns:
true if the session exist.

addParticpantToApplication

public void addParticpantToApplication(java.lang.String participantID)
This function adds a participant to the current application. At the moment there is only one application running at any time. This application is used for dealing with the authorization of the communication that is done via schemas.

Parameters:
participantID - Id of the participant to Add.

handledReceviedSchemas

public void handledReceviedSchemas()
                            throws java.lang.InterruptedException
Private this method handles all the schemas that have been received and have yet to be sent to the upper layers.

Throws:
java.lang.InterruptedException

enqueueSchemaForProcessing

public void enqueueSchemaForProcessing(java.lang.String arg0)
Places the schemas in a container for processing.

Parameters:
arg0 -

signalSchemaReceived

public void signalSchemaReceived()

isAppConnected

public boolean isAppConnected()

setAppConnected

public void setAppConnected(boolean conn)

sendSchema

public void sendSchema(java.lang.String schema,
                       java.lang.String participantID)
This function sends the schema file to the specified user.

Specified by:
sendSchema in class NCBBridge
Parameters:
schema - Schema File.
participantID - Id of the user.

sendMedia

public void sendMedia(java.lang.String sID,
                      java.lang.String medium,
                      java.lang.String mediumURL)
Specified by:
sendMedia in class NCBBridge