com.strangeberry.rendezvous
Class Rendezvous

java.lang.Object
  extended by com.strangeberry.rendezvous.Rendezvous

public class Rendezvous
extends java.lang.Object

Rendezvous implementation in Java.

Version:
1.45, 03/05/2003
Author:
Arthur van Hoff

Field Summary
static java.lang.String VERSION
           
 
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.
 java.net.InetAddress getInterface()
          Return the address of the interface to which this instance of Rendezvous is bound.
 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 requestServiceInfo(java.lang.String type, java.lang.String name)
          Request service information.
 void requestServiceInfo(java.lang.String type, java.lang.String name, int timeout)
          Request service information.
 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
 

Field Detail

VERSION

public static java.lang.String VERSION
Constructor Detail

Rendezvous

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

Throws:
java.io.IOException

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.

Throws:
java.io.IOException
Method Detail

getInterface

public java.net.InetAddress getInterface()
                                  throws java.io.IOException
Return the address of the interface to which this instance of Rendezvous is bound.

Throws:
java.io.IOException

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

requestServiceInfo

public void requestServiceInfo(java.lang.String type,
                               java.lang.String name)
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.


requestServiceInfo

public void requestServiceInfo(java.lang.String type,
                               java.lang.String name,
                               int timeout)
Request service information. The information about the service is requested and the ServiceListener.resolveService method is called as soon as it is available.


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.

Throws:
java.io.IOException

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.



Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.