|
JmDNS 3.4.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.jmdns.ServiceInfo
public abstract class ServiceInfo
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>.
Nested Class Summary | |
---|---|
static class |
ServiceInfo.Fields
Fields for the fully qualified map. |
Field Summary | |
---|---|
static byte[] |
NO_VALUE
This is the no value text byte. |
Constructor Summary | |
---|---|
ServiceInfo()
|
Method Summary | |
---|---|
ServiceInfo |
clone()
|
static ServiceInfo |
create(Map<ServiceInfo.Fields,String> qualifiedNameMap,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
int weight,
int priority,
boolean persistent,
byte[] text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
int weight,
int priority,
boolean persistent,
String text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
int weight,
int priority,
byte[] text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
int weight,
int priority,
Map<String,?> props)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
int weight,
int priority,
String text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
int port,
String text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
byte[] text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
String text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
int weight,
int priority,
byte[] text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
int weight,
int priority,
Map<String,?> props)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
int weight,
int priority,
String text)
Construct a service description for registering with JmDNS. |
static ServiceInfo |
create(String type,
String name,
String subtype,
int port,
String text)
Construct a service description for registering with JmDNS. |
abstract InetAddress |
getAddress()
Deprecated. since 3.1.8 |
abstract String |
getApplication()
Returns the application of the service info suitable for printing. |
abstract String |
getDomain()
Returns the domain of the service info suitable for printing. |
abstract String |
getHostAddress()
Deprecated. since 3.2.3 |
abstract String[] |
getHostAddresses()
Returns the host IP addresses string in textual presentation. |
abstract Inet4Address |
getInet4Address()
Deprecated. since 3.2.3 |
abstract Inet4Address[] |
getInet4Addresses()
Returns a list of all IPv4 InetAddresses that can be used for this service. |
abstract Inet6Address |
getInet6Address()
Deprecated. since 3.2.3 |
abstract Inet6Address[] |
getInet6Addresses()
Returns a list of all IPv6 InetAddresses that can be used for this service. |
abstract InetAddress |
getInetAddress()
Deprecated. since 3.2.3 |
abstract InetAddress[] |
getInetAddresses()
Returns a list of all InetAddresses that can be used for this service. |
abstract String |
getKey()
The key is used to retrieve service info in hash tables. The key is the lower case qualified name. |
abstract String |
getName()
Unqualified service instance name, such as foobar . |
abstract String |
getNiceTextString()
Returns a description of the service info suitable for printing. |
abstract int |
getPort()
Get the port for the service. |
abstract int |
getPriority()
Get the priority of the service. |
abstract byte[] |
getPropertyBytes(String name)
Get a property of the service. |
abstract Enumeration<String> |
getPropertyNames()
Enumeration of the property names. |
abstract String |
getPropertyString(String name)
Get a property of the service. |
abstract String |
getProtocol()
Returns the protocol of the service info suitable for printing. |
abstract String |
getQualifiedName()
Fully qualified service name, such as foobar._http._tcp.local. . |
abstract Map<ServiceInfo.Fields,String> |
getQualifiedNameMap()
Returns a dictionary of the fully qualified name component of this service. |
abstract String |
getServer()
Get the name of the server. |
abstract String |
getSubtype()
Returns the sub type of the service info suitable for printing. |
abstract byte[] |
getTextBytes()
Get the text for the service as raw bytes. |
abstract String |
getTextString()
Deprecated. since 3.1.7 |
abstract String |
getType()
Fully qualified service type name, such as _http._tcp.local. |
abstract String |
getTypeWithSubtype()
Fully qualified service type name with the subtype if appropriate, such as _printer._sub._http._tcp.local. |
abstract String |
getURL()
Deprecated. since 3.2.3 |
abstract String |
getURL(String protocol)
Deprecated. since 3.2.3 |
abstract String[] |
getURLs()
Get the list of URL for this service. |
abstract String[] |
getURLs(String protocol)
Get the list of URL for this service. |
abstract int |
getWeight()
Get the weight of the service. |
abstract boolean |
hasData()
Returns true if the service info is filled with data. |
abstract boolean |
isPersistent()
Returns true if ServiceListener.resolveService will be called whenever new new information is received. |
abstract void |
setText(byte[] text)
Set the text for the service. |
abstract void |
setText(Map<String,?> props)
Set the text for the service. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] NO_VALUE
Constructor Detail |
---|
public ServiceInfo()
Method Detail |
---|
public static ServiceInfo create(String type, String name, int port, String text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runstext
- string describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, String text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runstext
- string describing the service
public static ServiceInfo create(String type, String name, int port, int weight, int priority, String text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicetext
- string describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, int weight, int priority, String text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicetext
- string describing the service
public static ServiceInfo create(String type, String name, int port, int weight, int priority, Map<String,?> props)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the serviceprops
- properties describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, int weight, int priority, Map<String,?> props)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the serviceprops
- properties describing the service
public static ServiceInfo create(String type, String name, int port, int weight, int priority, byte[] text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicetext
- bytes describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, int weight, int priority, byte[] text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicetext
- bytes describing the service
public static ServiceInfo create(String type, String name, int port, int weight, int priority, boolean persistent, String text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.text
- string describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, int weight, int priority, boolean persistent, String text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.text
- string describing the service
public static ServiceInfo create(String type, String name, int port, int weight, int priority, boolean persistent, Map<String,?> props)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.props
- properties describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, int weight, int priority, boolean persistent, Map<String,?> props)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.props
- properties describing the service
public static ServiceInfo create(String type, String name, int port, int weight, int priority, boolean persistent, byte[] text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.text
- bytes describing the service
public static ServiceInfo create(String type, String name, String subtype, int port, int weight, int priority, boolean persistent, byte[] text)
type
- fully qualified service type name, such as _http._tcp.local.
.name
- unqualified service instance name, such as foobar
subtype
- service subtype see draft-cheshire-dnsext-dns-sd-06.txt chapter 7.1 Selective Instance Enumerationport
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.text
- bytes describing the service
public static ServiceInfo create(Map<ServiceInfo.Fields,String> qualifiedNameMap, int port, int weight, int priority, boolean persistent, Map<String,?> props)
qualifiedNameMap
- dictionary 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.port
- the local port on which the service runsweight
- weight of the servicepriority
- priority of the servicepersistent
- if true
ServiceListener.resolveService will be called whenever new new information is received.props
- properties describing the service
public abstract boolean hasData()
true
if the service info has data, false
otherwise.public abstract String getType()
_http._tcp.local.
public abstract String getTypeWithSubtype()
_printer._sub._http._tcp.local.
public abstract String getName()
foobar
.
public abstract String getKey()
public abstract String getQualifiedName()
foobar._http._tcp.local.
.
public abstract String getServer()
@Deprecated public abstract String getHostAddress()
getHostAddresses()
public abstract String[] getHostAddresses()
@Deprecated public abstract InetAddress getAddress()
getInetAddresses()
@Deprecated public abstract InetAddress getInetAddress()
getInetAddresses()
@Deprecated public abstract Inet4Address getInet4Address()
getInet4Addresses()
@Deprecated public abstract Inet6Address getInet6Address()
getInet6Addresses()
public abstract InetAddress[] getInetAddresses()
In a multi-homed environment service info can be associated with more than one address.
public abstract Inet4Address[] getInet4Addresses()
In a multi-homed environment service info can be associated with more than one address.
public abstract Inet6Address[] getInet6Addresses()
In a multi-homed environment service info can be associated with more than one address.
public abstract int getPort()
public abstract int getPriority()
public abstract int getWeight()
public abstract byte[] getTextBytes()
@Deprecated public abstract String getTextString()
getPropertyNames()
,
getPropertyBytes(String)
,
getPropertyString(String)
@Deprecated public abstract String getURL()
getURLs()
public abstract String[] getURLs()
@Deprecated public abstract String getURL(String protocol)
protocol
- requested protocol
getURLs()
public abstract String[] getURLs(String protocol)
protocol
- requested protocol
public abstract byte[] getPropertyBytes(String name)
name
- property name
public abstract String getPropertyString(String name)
name
- property name
public abstract Enumeration<String> getPropertyNames()
public abstract String getNiceTextString()
public abstract void setText(byte[] text) throws IllegalStateException
text
- the raw byte representation of the text field.
IllegalStateException
- if attempting to set the text for a non persistent service info.public abstract void setText(Map<String,?> props) throws IllegalStateException
props
- a key=value map that will be encoded into raw bytes.
IllegalStateException
- if attempting to set the text for a non persistent service info.public abstract boolean isPersistent()
true
if ServiceListener.resolveService will be called whenever new new information is received.
public abstract String getDomain()
public abstract String getProtocol()
public abstract String getApplication()
public abstract String getSubtype()
public abstract Map<ServiceInfo.Fields,String> getQualifiedNameMap()
public ServiceInfo clone()
clone
in class Object
|
Last updated 2011-08-25 12:40 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |