com.strangeberry.rendezvous
Class ServiceInfo

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

public class ServiceInfo
extends com.strangeberry.rendezvous.Rendezvous.Listener

Rendezvous service information.


Field Summary
static byte[] NO_VALUE
           
 
Constructor Summary
ServiceInfo(java.lang.String type, java.lang.String name, java.net.InetAddress addr, int port, int weight, int priority, byte[] text)
          Construct a service description for registrating with Rendezvous.
ServiceInfo(java.lang.String type, java.lang.String name, java.net.InetAddress addr, int port, int weight, int priority, java.util.Hashtable props)
          Construct a service description for registrating with Rendezvous.
ServiceInfo(java.lang.String type, java.lang.String name, java.net.InetAddress addr, int port, int weight, int priority, java.lang.String text)
          Construct a service description for registrating with Rendezvous.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.net.InetAddress getAddress()
          Get the host address of the service.
 java.lang.String getName()
          Service name, such as foobar.
 int getPort()
          Get the port for the service.
 int getPriority()
          Get the priority of the service.
 byte[] getPropertyBytes(java.lang.String name)
          Get a property of the service.
 java.util.Enumeration getPropertyNames()
          Enumeration of the property names.
 java.lang.String getPropertyString(java.lang.String name)
          Get a property of the service.
 byte[] getTextBytes()
          Get the text for the serivce as raw bytes.
 java.lang.String getTextString()
          Get the text for the service.
 java.lang.String getType()
          Fully qualified service type name, such as _http._tcp.local..
 int getWeight()
          Get the weight of the service.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_VALUE

public static final byte[] NO_VALUE
Constructor Detail

ServiceInfo

public ServiceInfo(java.lang.String type,
                   java.lang.String name,
                   java.net.InetAddress addr,
                   int port,
                   int weight,
                   int priority,
                   java.lang.String text)
Construct a service description for registrating with Rendezvous.
Parameters:
type - fully qualified service type name
name - fully qualified service name
addr - the address to which the service is bound
port - the local port on which the service runs
weight - weight of the service
priority - priority of the service
text - string describing the service

ServiceInfo

public ServiceInfo(java.lang.String type,
                   java.lang.String name,
                   java.net.InetAddress addr,
                   int port,
                   int weight,
                   int priority,
                   java.util.Hashtable props)
Construct a service description for registrating with Rendezvous. The properties hashtable must map property names to either Strings or byte arrays describing the property values.
Parameters:
type - fully qualified service type name
name - fully qualified service name
addr - the address to which the service is bound
port - the local port on which the service runs
weight - weight of the service
priority - priority of the service
props - properties describing the service

ServiceInfo

public ServiceInfo(java.lang.String type,
                   java.lang.String name,
                   java.net.InetAddress addr,
                   int port,
                   int weight,
                   int priority,
                   byte[] text)
Construct a service description for registrating with Rendezvous.
Parameters:
type - fully qualified service type name
name - fully qualified service name
addr - the address to which the service is bound
port - the local port on which the service runs
weight - weight of the service
priority - priority of the service
text - bytes describing the service
Method Detail

getType

public java.lang.String getType()
Fully qualified service type name, such as _http._tcp.local..

getName

public java.lang.String getName()
Service name, such as foobar.

getAddress

public java.net.InetAddress getAddress()
Get the host address of the service.

getPort

public int getPort()
Get the port for the service.

getPriority

public int getPriority()
Get the priority of the service.

getWeight

public int getWeight()
Get the weight of the service.

getTextBytes

public byte[] getTextBytes()
Get the text for the serivce as raw bytes.

getTextString

public java.lang.String getTextString()
Get the text for the service. This will interpret the text bytes as a UTF8 encoded string. Will return null if the bytes are not a valid UTF8 encoded string.

getPropertyBytes

public byte[] getPropertyBytes(java.lang.String name)
Get a property of the service. This involves decoding the text bytes into a property list. Returns null if the property is not found or the text data could not be decoded correctly.

getPropertyString

public java.lang.String getPropertyString(java.lang.String name)
Get a property of the service. This involves decoding the text bytes into a property list. Returns null if the property is not found, the text data could not be decoded correctly, or the resulting bytes are not a valid UTF8 string.

getPropertyNames

public java.util.Enumeration getPropertyNames()
Enumeration of the property names.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object



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