Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.rss
Class UriHandlerRssImpl

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.rss.UriHandlerRssImpl
All Implemented Interfaces:
EventListener, UriHandler, org.osgi.framework.ServiceListener

public class UriHandlerRssImpl
extends Object
implements UriHandler, org.osgi.framework.ServiceListener

The RSS implementation of the URI handler. This class handles RSS feeds by adding them to your contact list.

Author:
Emil Ivov

Field Summary
 
Fields inherited from interface net.java.sip.communicator.service.argdelegation.UriHandler
PROTOCOL_PROPERTY
 
Constructor Summary
protected UriHandlerRssImpl()
          Creates an instance of this uri handler, so that it would start handling URIs by passing them to the RSS providers.
 
Method Summary
 String getProtocol()
          Returns the protocol that this handler is responsible for.
 ProtocolProviderService getRssProvider()
          Returns the default provider that we are supposed to add feeds to.
 void handleUri(String uri)
          Parses the specified URI and creates a call with the currently active telephony operation set.
 void registerHandlerService()
          Registers this UriHandler with the bundle context so that it could start handling URIs
 void serviceChanged(org.osgi.framework.ServiceEvent event)
          The point of implementing a service listener here is so that we would only register our own uri handling service and thus only handle URIs while the factory is available as an OSGi service.
 void unregisterHandlerService()
          Unregisters this UriHandler from the bundle context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UriHandlerRssImpl

protected UriHandlerRssImpl()
                     throws NullPointerException
Creates an instance of this uri handler, so that it would start handling URIs by passing them to the RSS providers.

Throws:
NullPointerException
Method Detail

registerHandlerService

public void registerHandlerService()
Registers this UriHandler with the bundle context so that it could start handling URIs


unregisterHandlerService

public void unregisterHandlerService()
Unregisters this UriHandler from the bundle context.


getProtocol

public String getProtocol()
Returns the protocol that this handler is responsible for. In this case this would be the "feed" protocol.

Specified by:
getProtocol in interface UriHandler
Returns:
the protocol that this handler is responsible for.

handleUri

public void handleUri(String uri)
Parses the specified URI and creates a call with the currently active telephony operation set.

Specified by:
handleUri in interface UriHandler
Parameters:
uri - the feed: URI that we have to call.

serviceChanged

public void serviceChanged(org.osgi.framework.ServiceEvent event)
The point of implementing a service listener here is so that we would only register our own uri handling service and thus only handle URIs while the factory is available as an OSGi service. We remove ourselves when our factory unregisters its service reference.

Specified by:
serviceChanged in interface org.osgi.framework.ServiceListener
Parameters:
event - the OSGi ServiceEvent

getRssProvider

public ProtocolProviderService getRssProvider()
                                       throws OperationFailedException
Returns the default provider that we are supposed to add feeds to.

Returns:
the provider that we should add the URIs to or null if no provider was found.
Throws:
OperationFailedException

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.