JmDNS 3.4.1

javax.jmdns
Interface NetworkTopologyDiscovery

All Known Implementing Classes:
NetworkTopologyDiscoveryImpl

public interface NetworkTopologyDiscovery

This class is used to resolve the list of Internet address to use when attaching JmDNS to the network.

To create you own filtering class for Internet Addresses you will need to implement the class and the factory delegate. These must be called before any other call to JmDNS.

 public static class MyNetworkTopologyDiscovery implements NetworkTopologyDiscovery {

     @Override
     public InetAddress[] getInetAddresses() {
         // TODO Auto-generated method stub
         return null;
     }

     @Override
     public boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress) {
         // TODO Auto-generated method stub
         return false;
     }

 }

 public static class MyClass implements NetworkTopologyDiscovery.Factory.ClassDelegate {
     public MyClass() {
         super();
         NetworkTopologyDiscovery.Factory.setClassDelegate(this);

         // Access JmDNS or JmmDNS
     }

     @Override
     public NetworkTopologyDiscovery newNetworkTopologyDiscovery() {
         return new MyNetworkTopologyDiscovery();
     }

 }
 

Author:
Pierre Frisch

Nested Class Summary
static class NetworkTopologyDiscovery.Factory
          NetworkTopologyDiscovery.Factory enable the creation of new instance of NetworkTopologyDiscovery.
 
Method Summary
 InetAddress[] getInetAddresses()
          Get all local Internet Addresses for the machine.
 void lockInetAddress(InetAddress interfaceAddress)
          Locks the given InetAddress if the device requires it.
 void unlockInetAddress(InetAddress interfaceAddress)
          Locks the given InetAddress if the device requires it.
 boolean useInetAddress(NetworkInterface networkInterface, InetAddress interfaceAddress)
          Check if a given InetAddress should be used for mDNS
 

Method Detail

getInetAddresses

InetAddress[] getInetAddresses()
Get all local Internet Addresses for the machine.

Returns:
Set of InetAddress

useInetAddress

boolean useInetAddress(NetworkInterface networkInterface,
                       InetAddress interfaceAddress)
Check if a given InetAddress should be used for mDNS

Parameters:
networkInterface -
interfaceAddress -
Returns:
true is the address is to be used, false otherwise.

lockInetAddress

void lockInetAddress(InetAddress interfaceAddress)
Locks the given InetAddress if the device requires it.

Parameters:
interfaceAddress -

unlockInetAddress

void unlockInetAddress(InetAddress interfaceAddress)
Locks the given InetAddress if the device requires it.

Parameters:
interfaceAddress -

Last updated 2011-08-25 12:40

Copyright © 2002-2011 JmDNS. All Rights Reserved.