Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.provdisc.dhcp
Class ProvisioningDiscoveryServiceDHCPImpl

java.lang.Object
  extended by net.java.sip.communicator.service.provdisc.AbstractProvisioningDiscoveryService
      extended by net.java.sip.communicator.impl.provdisc.dhcp.ProvisioningDiscoveryServiceDHCPImpl
All Implemented Interfaces:
EventListener, DiscoveryListener, ProvisioningDiscoveryService

public class ProvisioningDiscoveryServiceDHCPImpl
extends AbstractProvisioningDiscoveryService
implements DiscoveryListener

Class that uses DHCP to retrieve provisioning URL. Basically it sends a DHCPINFORM message with a custom option code in parameters list. Note that DHCP server have to understand this option and thus configured to answer with a HTTP/HTTPS URL.

Author:
Sebastien Vincent

Constructor Summary
ProvisioningDiscoveryServiceDHCPImpl()
          Constructor.
 
Method Summary
 String discoverURL()
          Launch a discovery for a provisioning URL.
 String getMethodName()
          Get the name of the method name used to retrieve provisioning URL.
 void notifyProvisioningURL(DiscoveryEvent event)
          Notify the provisioning URL.
 void startDiscovery()
          Launch a discovery for a provisioning URL by sending a DHCP Inform with parameter list option containing a custom option code.
 
Methods inherited from class net.java.sip.communicator.service.provdisc.AbstractProvisioningDiscoveryService
addDiscoveryListener, fireDiscoveryEvent, removeDiscoveryListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProvisioningDiscoveryServiceDHCPImpl

public ProvisioningDiscoveryServiceDHCPImpl()
Constructor.

Method Detail

getMethodName

public String getMethodName()
Get the name of the method name used to retrieve provisioning URL.

Specified by:
getMethodName in interface ProvisioningDiscoveryService
Specified by:
getMethodName in class AbstractProvisioningDiscoveryService
Returns:
method name

discoverURL

public String discoverURL()
Launch a discovery for a provisioning URL. This method is synchronous and may block for some time. Note that you don't have to call startDiscovery method prior to this one to retrieve URL.

Specified by:
discoverURL in interface ProvisioningDiscoveryService
Specified by:
discoverURL in class AbstractProvisioningDiscoveryService
Returns:
provisioning URL

startDiscovery

public void startDiscovery()
Launch a discovery for a provisioning URL by sending a DHCP Inform with parameter list option containing a custom option code. This method is asynchronous, the response will be notified to any ProvisioningListener registered.

Specified by:
startDiscovery in interface ProvisioningDiscoveryService
Specified by:
startDiscovery in class AbstractProvisioningDiscoveryService

notifyProvisioningURL

public void notifyProvisioningURL(DiscoveryEvent event)
Notify the provisioning URL.

Specified by:
notifyProvisioningURL in interface DiscoveryListener
Parameters:
event - provisioning event

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

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