Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes
javax.jmdns.ServiceInfo Class Reference
Inheritance diagram for javax.jmdns.ServiceInfo:
Inheritance graph
[legend]

List of all members.

Classes

enum  Fields

Public Member Functions

ServiceInfo clone ()
abstract InetAddress getAddress ()
abstract String getApplication ()
abstract String getDomain ()
abstract String getHostAddress ()
abstract String[] getHostAddresses ()
abstract Inet4Address getInet4Address ()
abstract Inet4Address[] getInet4Addresses ()
abstract Inet6Address getInet6Address ()
abstract Inet6Address[] getInet6Addresses ()
abstract InetAddress getInetAddress ()
abstract InetAddress[] getInetAddresses ()
abstract String getKey ()
abstract String getName ()
abstract String getNiceTextString ()
abstract int getPort ()
abstract int getPriority ()
abstract byte[] getPropertyBytes (final String name)
abstract Enumeration< String > getPropertyNames ()
abstract String getPropertyString (final String name)
abstract String getProtocol ()
abstract String getQualifiedName ()
abstract Map< Fields, String > getQualifiedNameMap ()
abstract String getServer ()
abstract String getSubtype ()
abstract byte[] getTextBytes ()
abstract String getTextString ()
abstract String getType ()
abstract String getTypeWithSubtype ()
abstract String getURL ()
abstract String getURL (String protocol)
abstract String[] getURLs ()
abstract String[] getURLs (String protocol)
abstract int getWeight ()
abstract boolean hasData ()
abstract boolean isPersistent ()
abstract void setText (final byte[] text) throws IllegalStateException
abstract void setText (final Map< String,?> props) throws IllegalStateException

Static Public Member Functions

static ServiceInfo create (final String type, final String name, final int port, final String text)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final String text)
static ServiceInfo create (final String type, final String name, final int port, final int weight, final int priority, final String text)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final int weight, final int priority, final String text)
static ServiceInfo create (final String type, final String name, final int port, final int weight, final int priority, final Map< String,?> props)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final int weight, final int priority, final Map< String,?> props)
static ServiceInfo create (final String type, final String name, final int port, final int weight, final int priority, final byte[] text)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final int weight, final int priority, final byte[] text)
static ServiceInfo create (final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final String text)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final String text)
static ServiceInfo create (final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final Map< String,?> props)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final Map< String,?> props)
static ServiceInfo create (final String type, final String name, final int port, final int weight, final int priority, final boolean persistent, final byte[] text)
static ServiceInfo create (final String type, final String name, final String subtype, final int port, final int weight, final int priority, final boolean persistent, final byte[] text)
static ServiceInfo create (final Map< Fields, String > qualifiedNameMap, final int port, final int weight, final int priority, final boolean persistent, final Map< String,?> props)

Static Public Attributes

static final byte[] NO_VALUE = new byte[0]

Detailed Description

The fully qualified service name is build using up to 5 components with the following structure:

            <app>.<protocol>.<servicedomain>.<parentdomain>.
<Instance>.<app>.<protocol>.<servicedomain>.<parentdomain>.
<sub>._sub.<app>.<protocol>.<servicedomain>.<parentdomain>.
  1. <servicedomain>.<parentdomain>: This is the domain scope of the service typically "local.", but this can also be something similar to "in-addr.arpa." or "ip6.arpa."
  2. <protocol>: This is either "_tcp" or "_udp"
  3. <app>: This define the application protocol. Typical example are "_http", "_ftp", etc.
  4. <Instance>: This is the service name
  5. <sub>: This is the subtype for the application protocol

Definition at line 33 of file ServiceInfo.java.


Member Function Documentation

Reimplemented in javax.jmdns.impl.ServiceInfoImpl.

Definition at line 718 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final String  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
textstring describing the service
Returns:
new service info

Definition at line 79 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final String  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
textstring describing the service
Returns:
new service info

Definition at line 98 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final int  weight,
final int  priority,
final String  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
textstring describing the service
Returns:
new service info

Definition at line 119 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final int  weight,
final int  priority,
final String  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
textstring describing the service
Returns:
new service info

Definition at line 142 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final int  weight,
final int  priority,
final Map< String,?>  props 
) [inline, static]

Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
propsproperties describing the service
Returns:
new service info

Definition at line 163 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final int  weight,
final int  priority,
final Map< String,?>  props 
) [inline, static]

Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
propsproperties describing the service
Returns:
new service info

Definition at line 186 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final int  weight,
final int  priority,
final byte[]  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
textbytes describing the service
Returns:
new service info

Definition at line 207 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final int  weight,
final int  priority,
final byte[]  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
textbytes describing the service
Returns:
new service info

Definition at line 230 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final String  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
textstring describing the service
Returns:
new service info

Definition at line 253 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final String  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
textstring describing the service
Returns:
new service info

Definition at line 278 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final Map< String,?>  props 
) [inline, static]

Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
propsproperties describing the service
Returns:
new service info

Definition at line 301 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final Map< String,?>  props 
) [inline, static]

Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
propsproperties describing the service
Returns:
new service info

Definition at line 326 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final byte[]  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
textbytes describing the service
Returns:
new service info

Definition at line 349 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final String  type,
final String  name,
final String  subtype,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final byte[]  text 
) [inline, static]

Construct a service description for registering with JmDNS.

Parameters:
typefully qualified service type name, such as _http._tcp.local..
nameunqualified service instance name, such as foobar
subtypeservice subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumeration
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
textbytes describing the service
Returns:
new service info

Definition at line 374 of file ServiceInfo.java.

static ServiceInfo javax.jmdns.ServiceInfo.create ( final Map< Fields, String >  qualifiedNameMap,
final int  port,
final int  weight,
final int  priority,
final boolean  persistent,
final Map< String,?>  props 
) [inline, static]

Construct a service description for registering with JmDNS. The properties hashtable must map property names to either Strings or byte arrays describing the property values.

Parameters:
qualifiedNameMapdictionary of values to build the fully qualified service name. Mandatory keys are Application and Instance. The Domain default is local, the Protocol default is tcp and the subtype default is none.
portthe local port on which the service runs
weightweight of the service
prioritypriority of the service
persistentif true ServiceListener.resolveService will be called whenever new new information is received.
propsproperties describing the service
Returns:
new service info

Definition at line 395 of file ServiceInfo.java.

abstract InetAddress javax.jmdns.ServiceInfo.getAddress ( ) [pure virtual]

Get the host address of the service.

Returns:
host Internet address
Deprecated:
since 3.1.8
See also:
getInetAddresses()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getApplication ( ) [pure virtual]

Returns the application of the service info suitable for printing.

Returns:
service application

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getDomain ( ) [pure virtual]

Returns the domain of the service info suitable for printing.

Returns:
service domain

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getHostAddress ( ) [pure virtual]

Returns the host IP address string in textual presentation.
Note: This can be either an IPv4 or an IPv6 representation.

Returns:
the host raw IP address in a string format.
Deprecated:
since 3.2.3
See also:
getHostAddresses()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String [] javax.jmdns.ServiceInfo.getHostAddresses ( ) [pure virtual]

Returns the host IP addresses string in textual presentation.

Returns:
list of host raw IP address in a string format.

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract Inet4Address javax.jmdns.ServiceInfo.getInet4Address ( ) [pure virtual]

Get the IPv4 InetAddress of the service.
Note: This return null if the service IPv4 address cannot be resolved.

Returns:
Internet address
Deprecated:
since 3.2.3
See also:
getInet4Addresses()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract Inet4Address [] javax.jmdns.ServiceInfo.getInet4Addresses ( ) [pure virtual]

Returns a list of all IPv4 InetAddresses that can be used for this service.

In a multi-homed environment service info can be associated with more than one address.

Returns:
list of InetAddress objects

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract Inet6Address javax.jmdns.ServiceInfo.getInet6Address ( ) [pure virtual]

Get the IPv6 InetAddress of the service.
Note: This return null if the service IPv6 address cannot be resolved.

Returns:
Internet address
Deprecated:
since 3.2.3
See also:
getInet6Addresses()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract Inet6Address [] javax.jmdns.ServiceInfo.getInet6Addresses ( ) [pure virtual]

Returns a list of all IPv6 InetAddresses that can be used for this service.

In a multi-homed environment service info can be associated with more than one address.

Returns:
list of InetAddress objects

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract InetAddress javax.jmdns.ServiceInfo.getInetAddress ( ) [pure virtual]

Get the InetAddress of the service. This will return the IPv4 if it exist, otherwise it return the IPv6 if set.
Note: This return null if the service IP address cannot be resolved.

Returns:
Internet address
Deprecated:
since 3.2.3
See also:
getInetAddresses()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract InetAddress [] javax.jmdns.ServiceInfo.getInetAddresses ( ) [pure virtual]

Returns a list of all InetAddresses that can be used for this service.

In a multi-homed environment service info can be associated with more than one address.

Returns:
list of InetAddress objects

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getKey ( ) [pure virtual]

The key is used to retrieve service info in hash tables.
The key is the lower case qualified name.

Returns:
the key

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getName ( ) [pure virtual]

Unqualified service instance name, such as foobar .

Returns:
service name

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getNiceTextString ( ) [pure virtual]

Returns a description of the service info suitable for printing.

Returns:
service info description

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract int javax.jmdns.ServiceInfo.getPort ( ) [pure virtual]

Get the port for the service.

Returns:
service port

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract int javax.jmdns.ServiceInfo.getPriority ( ) [pure virtual]

Get the priority of the service.

Returns:
service priority

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract byte [] javax.jmdns.ServiceInfo.getPropertyBytes ( final String  name) [pure virtual]

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.

Parameters:
nameproperty name
Returns:
raw property text
abstract Enumeration<String> javax.jmdns.ServiceInfo.getPropertyNames ( ) [pure virtual]

Enumeration of the property names.

Returns:
property name enumeration

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getPropertyString ( final String  name) [pure virtual]

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.

Parameters:
nameproperty name
Returns:
property text
abstract String javax.jmdns.ServiceInfo.getProtocol ( ) [pure virtual]

Returns the protocol of the service info suitable for printing.

Returns:
service protocol

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getQualifiedName ( ) [pure virtual]

Fully qualified service name, such as foobar._http._tcp.local. .

Returns:
qualified service name

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract Map<Fields, String> javax.jmdns.ServiceInfo.getQualifiedNameMap ( ) [pure virtual]

Returns a dictionary of the fully qualified name component of this service.

Returns:
dictionary of the fully qualified name components

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getServer ( ) [pure virtual]

Get the name of the server.

Returns:
server name

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getSubtype ( ) [pure virtual]

Returns the sub type of the service info suitable for printing.

Returns:
service sub type

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract byte [] javax.jmdns.ServiceInfo.getTextBytes ( ) [pure virtual]

Get the text for the service as raw bytes.

Returns:
raw service text

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getTextString ( ) [pure virtual]

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.
Note: Do not use. This method make the assumption that the TXT record is one string. This is false. The TXT record is a series of key value pairs.

Returns:
service text
See also:
getPropertyNames()
#getPropertyBytes(String)
#getPropertyString(String)
Deprecated:
since 3.1.7

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getType ( ) [pure virtual]

Fully qualified service type name, such as _http._tcp.local.

Returns:
service type name

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getTypeWithSubtype ( ) [pure virtual]

Fully qualified service type name with the subtype if appropriate, such as _printer._sub._http._tcp.local.

Returns:
service type name

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getURL ( ) [pure virtual]

Get the URL for this service. An http URL is created by combining the address, port, and path properties.

Returns:
service URL
Deprecated:
since 3.2.3
See also:
getURLs()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String javax.jmdns.ServiceInfo.getURL ( String  protocol) [pure virtual]

Get the URL for this service. An URL is created by combining the protocol, address, port, and path properties.

Parameters:
protocolrequested protocol
Returns:
service URL
Deprecated:
since 3.2.3
See also:
getURLs()

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String [] javax.jmdns.ServiceInfo.getURLs ( ) [pure virtual]

Get the list of URL for this service. An http URL is created by combining the address, port, and path properties.

Returns:
list of service URL

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract String [] javax.jmdns.ServiceInfo.getURLs ( String  protocol) [pure virtual]

Get the list of URL for this service. An URL is created by combining the protocol, address, port, and path properties.

Parameters:
protocolrequested protocol
Returns:
list of service URL

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract int javax.jmdns.ServiceInfo.getWeight ( ) [pure virtual]

Get the weight of the service.

Returns:
service weight

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract boolean javax.jmdns.ServiceInfo.hasData ( ) [pure virtual]

Returns true if the service info is filled with data.

Returns:
true if the service info has data, false otherwise.

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract boolean javax.jmdns.ServiceInfo.isPersistent ( ) [pure virtual]

Returns true if ServiceListener.resolveService will be called whenever new new information is received.

Returns:
the persistent

Implemented in javax.jmdns.impl.ServiceInfoImpl.

abstract void javax.jmdns.ServiceInfo.setText ( final byte[]  text) throws IllegalStateException [pure virtual]

Set the text for the service. Setting the text will fore a re-announce of the service.

Parameters:
textthe raw byte representation of the text field.
Exceptions:
IllegalStateExceptionif attempting to set the text for a non persistent service info.
abstract void javax.jmdns.ServiceInfo.setText ( final Map< String,?>  props) throws IllegalStateException [pure virtual]

Set the text for the service. Setting the text will fore a re-announce of the service.

Parameters:
propsa key=value map that will be encoded into raw bytes.
Exceptions:
IllegalStateExceptionif attempting to set the text for a non persistent service info.

Member Data Documentation

final byte [] javax.jmdns.ServiceInfo.NO_VALUE = new byte[0] [static]

This is the no value text byte. According top the specification it is one byte with 0 value.

Definition at line 38 of file ServiceInfo.java.


The documentation for this class was generated from the following file:


zeroconf_jmdns_suite
Author(s): Daniel Stonier
autogenerated on Thu Aug 27 2015 15:50:27