public class UriHandlerJabberImpl extends java.lang.Object implements UriHandler, org.osgi.framework.ServiceListener, AccountManagerListener
PROTOCOL_PROPERTY
Constructor and Description |
---|
UriHandlerJabberImpl(ProtocolProviderFactory protoFactory)
Creates an instance of this uri handler, so that it would start handling
URIs by passing them to the providers registered by protoFactory
.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of this
UriHandler by, for example, removing the
listeners it has added in its constructor (in order to prevent memory
leaks, for one). |
java.lang.String[] |
getProtocol()
Returns the protocols that this handler is responsible for.
|
void |
handleAccountManagerEvent(AccountManagerEvent event)
Notifies this listener about an event fired by a specific
AccountManager . |
void |
handleUri(java.lang.String uri)
Parses the specified URI and creates a chat with the currently active
im operation set.
|
void |
registerHandlerService()
Registers this UriHandler with the bundle context so that it could start
handling URIs
|
ProtocolProviderService |
selectHandlingProvider(java.lang.String uri)
Returns the default provider that we are supposed to handle URIs through
or null if there aren't any.
|
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.
|
public UriHandlerJabberImpl(ProtocolProviderFactory protoFactory) throws java.lang.NullPointerException
protoFactory
- the provider that created us.java.lang.NullPointerException
- if protoFactory is null.public void dispose()
UriHandler
by, for example, removing the
listeners it has added in its constructor (in order to prevent memory
leaks, for one).public void handleAccountManagerEvent(AccountManagerEvent event)
AccountManagerListener
AccountManager
.handleAccountManagerEvent
in interface AccountManagerListener
event
- the AccountManagerEvent
describing the
AccountManager
firing the notification and the
other details of the specific notification.public void registerHandlerService()
public void unregisterHandlerService()
public java.lang.String[] getProtocol()
getProtocol
in interface UriHandler
public void handleUri(java.lang.String uri)
handleUri
in interface UriHandler
uri
- the xmpp URI that we have to handle.public void serviceChanged(org.osgi.framework.ServiceEvent event)
serviceChanged
in interface org.osgi.framework.ServiceListener
event
- the OSGi ServiceEventpublic ProtocolProviderService selectHandlingProvider(java.lang.String uri) throws OperationFailedException
uri
- the uri that we'd like to handle with the provider that we are
about to select.OperationFailedException
- with code OPERATION_CANCELED if
the users.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.