public class UriHandlerSipImpl extends java.lang.Object implements UriHandler, org.osgi.framework.ServiceListener, AccountManagerListener
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_INITIAL_REGISTRATION_TIMEOUT
Default value for INITIAL_REGISTRATION_TIMEOUT (milliseconds)
|
static java.lang.String |
INITIAL_REGISTRATION_TIMEOUT_PROP
Property to set the amount of time to wait for SIP registration
to complete before trying to dial a URI from the command line.
|
PROTOCOL_PROPERTY
Constructor and Description |
---|
UriHandlerSipImpl(ProtocolProviderFactorySipImpl 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 tries to create a call when online.
|
protected void |
handleUri(java.lang.String uri,
ProtocolProviderService provider)
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
|
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 static final java.lang.String INITIAL_REGISTRATION_TIMEOUT_PROP
public static final long DEFAULT_INITIAL_REGISTRATION_TIMEOUT
public UriHandlerSipImpl(ProtocolProviderFactorySipImpl 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 SIP URI that we have to call.protected void handleUri(java.lang.String uri, ProtocolProviderService provider)
uri
- the SIP URI that we have to call.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.