com.strangeberry.rendezvous
Class Rendezvous

java.lang.Object
  |
  +--com.strangeberry.rendezvous.DNSConstants
        |
        +--com.strangeberry.rendezvous.Rendezvous

public class Rendezvous
extends com.strangeberry.rendezvous.DNSConstants

Rendezvous implementation in Java.


Constructor Summary
Rendezvous()
          Create an instance of Rendezvous.
Rendezvous(java.net.InetAddress addr)
          Create an instance of Rendezvous and bind it to a specific network interface given its IP-address.
 
Method Summary
 void addServiceListener(java.lang.String type, ServiceListener listener)
          Listen for services of a given type.
 void close()
          Close down rendezvous.
 ServiceInfo getServiceInfo(java.lang.String type, java.lang.String name)
          Get service information.
 ServiceInfo getServiceInfo(java.lang.String type, java.lang.String name, int timeout)
          Get service information.
 void registerService(ServiceInfo info)
          Register a service.
 void removeServiceListener(ServiceListener listener)
          Remove listener for services of a given type.
 void unregisterAllServices()
          Unregister a service.
 void unregisterService(ServiceInfo info)
          Unregister a service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rendezvous

public Rendezvous()
           throws java.io.IOException
Create an instance of Rendezvous.

Rendezvous

public Rendezvous(java.net.InetAddress addr)
           throws java.io.IOException
Create an instance of Rendezvous and bind it to a specific network interface given its IP-address.
Method Detail

getServiceInfo

public ServiceInfo getServiceInfo(java.lang.String type,
                                  java.lang.String name)
Get service information. If the information is not cached, the method will block until updated informatin is received.
Parameters:
type - full qualified service type, such as _http._tcp.local..
type - full qualified service name, such as foobar._http._tcp.local..
Returns:
null if the service information cannot be obtained

getServiceInfo

public ServiceInfo getServiceInfo(java.lang.String type,
                                  java.lang.String name,
                                  int timeout)
Get service information. If the information is not cached, the method will block for the given timeout until updated informatin is received.
Parameters:
type - full qualified service type, such as _http._tcp.local..
type - full qualified service name, such as foobar._http._tcp.local..
timeout - timeout in milliseconds
Returns:
null if the service information cannot be obtained

addServiceListener

public void addServiceListener(java.lang.String type,
                               ServiceListener listener)
Listen for services of a given type. The type has to be a fully qualified type name such as _http._tcp.local..
Parameters:
type - full qualified service type, such as _http._tcp.local..
listener - listener for service updates

removeServiceListener

public void removeServiceListener(ServiceListener listener)
Remove listener for services of a given type.
Parameters:
listener - listener for service updates

registerService

public void registerService(ServiceInfo info)
                     throws java.io.IOException
Register a service. The service is registered for access by other rendezvous clients. The name of the service may be changed to make it unique.

unregisterService

public void unregisterService(ServiceInfo info)
Unregister a service. The service should have been registered.

unregisterAllServices

public void unregisterAllServices()
Unregister a service.

close

public void close()
Close down rendezvous. Release all resources and unregister all services.



This page is hosted by the Chair for Applied Software Engineering of the Technische Universität München.
Imprint (Impressum)