Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.communication.SkypeManager Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.communication.SkypeManager:
de.fu_berlin.inf.dpp.net.xmpp.IConnectionListener

List of all members.

Public Member Functions

 SkypeManager (XMPPConnectionService connectionService, IPreferenceStore preferenceStore)
String getSkypeURLNonBlock (String jid)
String getSkypeURLNonBlock (final JID rqJID)
String getSkypeURL (String jid)
String getSkypeURL (JID rqJID)
void publishSkypeIQ (String newSkypeName)
void connectionStateChanged (final Connection connection, ConnectionState newState)

Protected Member Functions

void refreshCache (final Connection connection)
String getLocalSkypeName ()
String requestSkypeName (Connection connection, JID rqJID)

Protected Attributes

XStreamExtensionProvider< String > skypeProvider
final Map< JID, String > skypeNames = new HashMap<JID, String>()

Detailed Description

A manager class that allows to discover if a given XMPP entity supports Skype and that allows to initiate Skype VOIP sessions with that entity.

TODO CO: Verify that IQ Packets are the best way of doing this. It seems kind of hackisch. Could we also use ServiceDiscovery?

Author:
rdjemili
oezbek

Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.communication.SkypeManager.SkypeManager ( XMPPConnectionService  connectionService,
IPreferenceStore  preferenceStore 
)

Register for our preference store, so we can be notified if the Skype Username changes.


Member Function Documentation

void de.fu_berlin.inf.dpp.communication.SkypeManager.connectionStateChanged ( final Connection  connection,
ConnectionState  newState 
)

Register a new PacketListener for intercepting SkypeIQ packets.

String de.fu_berlin.inf.dpp.communication.SkypeManager.getLocalSkypeName ( ) [protected]
Returns:
the local Skype name or null if none is set.
String de.fu_berlin.inf.dpp.communication.SkypeManager.getSkypeURL ( JID  rqJID)

Returns the Skype-URL for user identified by the given RQ-JID.

Returns:
the skype url for given JID or null if the user has no skype name set for this client.

This method will return previously cached results.

This method is potentially long-running

String de.fu_berlin.inf.dpp.communication.SkypeManager.getSkypeURL ( String  jid)

Returns the Skype-URL for given JID. This method will query all presences associated with the given JID and return the first valid Skype url (if any).

The order in which the presences are queried is undefined. If you need more control use getSkypeURL(JID).

Returns:
the skype url for given roster entry or null if roster entry has no skype name.

This method will return previously cached results.

This method is potentially long-running

String de.fu_berlin.inf.dpp.communication.SkypeManager.getSkypeURLNonBlock ( final JID  rqJID)

Non-blocking variant of getSkypeURL(JID).

Returns:
the skype url for given JID or null if roster entry has no skype name or the entry's skype name is not cached

This method will return previously cached results.

String de.fu_berlin.inf.dpp.communication.SkypeManager.getSkypeURLNonBlock ( String  jid)

Non-blocking variant of getSkypeURL(String).

Returns:
the skype url for given roster entry or null if roster entry has no skype name or the entry's skype name is not cached

This method will return previously cached results.

void de.fu_berlin.inf.dpp.communication.SkypeManager.publishSkypeIQ ( String  newSkypeName)

Send the given Skype user name to all our contacts that are currently available.

TODO SS only send to those, that we know use Saros.

void de.fu_berlin.inf.dpp.communication.SkypeManager.refreshCache ( final Connection  connection) [protected]

Request the skype name of all known contacts and caches the results.

Parameters:
connection
String de.fu_berlin.inf.dpp.communication.SkypeManager.requestSkypeName ( Connection  connection,
JID  rqJID 
) [protected]

Requests the Skype user name of given user. This method blocks up to 5 seconds to receive the value.

Parameters:
rqJIDthe rqJID of the user for which the Skype name is requested.
Returns:
the Skype user name of given user or null if the user doesn't respond in time (5s) or has no Skype name.

Member Data Documentation

final Map<JID, String> de.fu_berlin.inf.dpp.communication.SkypeManager.skypeNames = new HashMap<JID, String>() [protected]
XStreamExtensionProvider<String> de.fu_berlin.inf.dpp.communication.SkypeManager.skypeProvider [protected]
Initial value:
 new XStreamExtensionProvider<String>(
        SarosPacketExtension.EXTENSION_NAMESPACE, "skypeInfo")
 All Classes Namespaces Files Functions Variables Enumerations