|
JmDNS 3.4.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.jmdns.ServiceInfo
javax.jmdns.impl.ServiceInfoImpl
public class ServiceInfoImpl
JmDNS service information.
| Nested Class Summary | |
|---|---|
static interface |
ServiceInfoImpl.Delegate
|
| Nested classes/interfaces inherited from class javax.jmdns.ServiceInfo |
|---|
ServiceInfo.Fields |
| Nested classes/interfaces inherited from interface javax.jmdns.impl.DNSStatefulObject |
|---|
DNSStatefulObject.DefaultImplementation, DNSStatefulObject.DNSStatefulObjectSemaphore |
| Field Summary |
|---|
| Fields inherited from class javax.jmdns.ServiceInfo |
|---|
NO_VALUE |
| Constructor Summary | |
|---|---|
ServiceInfoImpl(Map<ServiceInfo.Fields,String> qualifiedNameMap,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
|
|
ServiceInfoImpl(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
byte[] text)
|
|
ServiceInfoImpl(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
|
|
ServiceInfoImpl(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
String text)
|
|
| Method Summary | |
|---|---|
boolean |
advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo. |
Collection<DNSRecord> |
answers(boolean unique,
int ttl,
HostInfo localHost)
|
void |
associateWithTask(DNSTask task,
DNSState state)
Sets the task associated with this Object. |
boolean |
cancelState()
Sets the state and notifies all objects that wait on the ServiceInfo. |
protected static Map<ServiceInfo.Fields,String> |
checkQualifiedNameMap(Map<ServiceInfo.Fields,String> qualifiedNameMap)
|
ServiceInfoImpl |
clone()
|
boolean |
closeState()
Sets the state and notifies all objects that wait on the ServiceInfo. |
static Map<ServiceInfo.Fields,String> |
decodeQualifiedNameMap(String type,
String name,
String subtype)
|
static Map<ServiceInfo.Fields,String> |
decodeQualifiedNameMapForType(String type)
|
boolean |
equals(Object obj)
|
InetAddress |
getAddress()
Deprecated. |
String |
getApplication()
Returns the application of the service info suitable for printing. |
JmDNSImpl |
getDns()
Returns the DNS associated with this object. |
String |
getDomain()
Returns the domain of the service info suitable for printing. |
String |
getHostAddress()
Deprecated. |
String[] |
getHostAddresses()
Returns the host IP addresses string in textual presentation. |
Inet4Address |
getInet4Address()
Deprecated. |
Inet4Address[] |
getInet4Addresses()
Returns a list of all IPv4 InetAddresses that can be used for this service. |
Inet6Address |
getInet6Address()
Deprecated. |
Inet6Address[] |
getInet6Addresses()
Returns a list of all IPv6 InetAddresses that can be used for this service. |
InetAddress |
getInetAddress()
Deprecated. |
InetAddress[] |
getInetAddresses()
Returns a list of all InetAddresses that can be used for this service. |
String |
getKey()
The key is used to retrieve service info in hash tables. The key is the lower case qualified name. |
String |
getName()
Unqualified service instance name, such as foobar . |
String |
getNiceTextString()
Returns a description of the service info suitable for printing. |
int |
getPort()
Get the port for the service. |
int |
getPriority()
Get the priority of the service. |
byte[] |
getPropertyBytes(String name)
Get a property of the service. |
Enumeration<String> |
getPropertyNames()
Enumeration of the property names. |
String |
getPropertyString(String name)
Get a property of the service. |
String |
getProtocol()
Returns the protocol of the service info suitable for printing. |
String |
getQualifiedName()
Fully qualified service name, such as foobar._http._tcp.local. . |
Map<ServiceInfo.Fields,String> |
getQualifiedNameMap()
Returns a dictionary of the fully qualified name component of this service. |
String |
getServer()
Get the name of the server. |
String |
getSubtype()
Returns the sub type of the service info suitable for printing. |
byte[] |
getTextBytes()
Get the text for the service as raw bytes. |
String |
getTextString()
Deprecated. |
String |
getType()
Fully qualified service type name, such as _http._tcp.local. |
String |
getTypeWithSubtype()
Fully qualified service type name with the subtype if appropriate, such as _printer._sub._http._tcp.local. |
String |
getURL()
Deprecated. |
String |
getURL(String protocol)
Deprecated. |
String[] |
getURLs()
Get the list of URL for this service. |
String[] |
getURLs(String protocol)
Get the list of URL for this service. |
int |
getWeight()
Get the weight of the service. |
boolean |
hasData()
Returns true if the service info is filled with data. |
int |
hashCode()
|
boolean |
isAnnounced()
Returns true, if this is an announced state. |
boolean |
isAnnouncing()
Returns true, if this is an announcing state. |
boolean |
isAssociatedWithTask(DNSTask task,
DNSState state)
Checks if this object is associated with the task and in the same state. |
boolean |
isCanceled()
Returns true, if this is a canceled state. |
boolean |
isCanceling()
Returns true, if this is a canceling state. |
boolean |
isClosed()
Returns true, if this is a closed state. |
boolean |
isClosing()
Returns true, if this is a closing state. |
boolean |
isPersistent()
Returns true if ServiceListener.resolveService will be called whenever new new information is received. |
boolean |
isProbing()
Returns true, if this is a probing state. |
boolean |
needTextAnnouncing()
|
boolean |
recoverState()
Sets the state and notifies all objects that wait on the ServiceInfo. |
void |
removeAssociationWithTask(DNSTask task)
Remove the association of the task with this Object. |
boolean |
revertState()
Sets the state and notifies all objects that wait on the ServiceInfo. |
void |
setDns(JmDNSImpl dns)
|
void |
setNeedTextAnnouncing(boolean needTextAnnouncing)
|
void |
setText(byte[] text)
Set the text for the service. |
void |
setText(Map<String,?> props)
Set the text for the service. |
String |
toString()
|
void |
updateRecord(DNSCache dnsCache,
long now,
DNSEntry rec)
JmDNS callback to update a DNS record. |
boolean |
waitForAnnounced(long timeout)
Waits for the object to be announced. |
boolean |
waitForCanceled(long timeout)
Waits for the object to be canceled. |
| Methods inherited from class javax.jmdns.ServiceInfo |
|---|
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceInfoImpl(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
String text)
type - name - subtype - port - weight - priority - persistent - text - ServiceInfo.create(String, String, int, int, int, String)
public ServiceInfoImpl(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
type - name - subtype - port - weight - priority - persistent - props - ServiceInfo.create(String, String, int, int, int, Map)
public ServiceInfoImpl(String type,
String name,
String subtype,
int port,
int weight,
int priority,
boolean persistent,
byte[] text)
type - name - subtype - port - weight - priority - persistent - text - ServiceInfo.create(String, String, int, int, int, byte[])
public ServiceInfoImpl(Map<ServiceInfo.Fields,String> qualifiedNameMap,
int port,
int weight,
int priority,
boolean persistent,
Map<String,?> props)
| Method Detail |
|---|
public static Map<ServiceInfo.Fields,String> decodeQualifiedNameMap(String type,
String name,
String subtype)
public static Map<ServiceInfo.Fields,String> decodeQualifiedNameMapForType(String type)
protected static Map<ServiceInfo.Fields,String> checkQualifiedNameMap(Map<ServiceInfo.Fields,String> qualifiedNameMap)
public String getType()
_http._tcp.local.
getType in class ServiceInfopublic String getTypeWithSubtype()
_printer._sub._http._tcp.local.
getTypeWithSubtype in class ServiceInfopublic String getName()
foobar .
getName in class ServiceInfopublic String getKey()
getKey in class ServiceInfopublic String getQualifiedName()
foobar._http._tcp.local. .
getQualifiedName in class ServiceInfopublic String getServer()
ServiceInfo
getServer in class ServiceInfoServiceInfo.getServer()@Deprecated public String getHostAddress()
getHostAddress in class ServiceInfoServiceInfo.getHostAddresses()public String[] getHostAddresses()
getHostAddresses in class ServiceInfo@Deprecated public InetAddress getAddress()
getAddress in class ServiceInfoServiceInfo.getInetAddresses()@Deprecated public InetAddress getInetAddress()
getInetAddress in class ServiceInfoServiceInfo.getInetAddresses()@Deprecated public Inet4Address getInet4Address()
getInet4Address in class ServiceInfoServiceInfo.getInet4Addresses()@Deprecated public Inet6Address getInet6Address()
getInet6Address in class ServiceInfoServiceInfo.getInet6Addresses()public InetAddress[] getInetAddresses()
ServiceInfoIn a multi-homed environment service info can be associated with more than one address.
getInetAddresses in class ServiceInfopublic Inet4Address[] getInet4Addresses()
ServiceInfoIn a multi-homed environment service info can be associated with more than one address.
getInet4Addresses in class ServiceInfopublic Inet6Address[] getInet6Addresses()
ServiceInfoIn a multi-homed environment service info can be associated with more than one address.
getInet6Addresses in class ServiceInfopublic int getPort()
ServiceInfo
getPort in class ServiceInfoServiceInfo.getPort()public int getPriority()
ServiceInfo
getPriority in class ServiceInfoServiceInfo.getPriority()public int getWeight()
ServiceInfo
getWeight in class ServiceInfoServiceInfo.getWeight()public byte[] getTextBytes()
ServiceInfo
getTextBytes in class ServiceInfoServiceInfo.getTextBytes()@Deprecated public String getTextString()
getTextString in class ServiceInfoServiceInfo.getPropertyNames(),
ServiceInfo.getPropertyBytes(String),
ServiceInfo.getPropertyString(String)@Deprecated public String getURL()
ServiceInfo
getURL in class ServiceInfoServiceInfo.getURLs()public String[] getURLs()
ServiceInfo
getURLs in class ServiceInfo@Deprecated public String getURL(String protocol)
ServiceInfo
getURL in class ServiceInfoprotocol - requested protocol
ServiceInfo.getURLs()public String[] getURLs(String protocol)
ServiceInfo
getURLs in class ServiceInfoprotocol - requested protocol
public byte[] getPropertyBytes(String name)
getPropertyBytes in class ServiceInfoname - property name
public String getPropertyString(String name)
getPropertyString in class ServiceInfoname - property name
public Enumeration<String> getPropertyNames()
getPropertyNames in class ServiceInfopublic String getApplication()
getApplication in class ServiceInfopublic String getDomain()
getDomain in class ServiceInfopublic String getProtocol()
getProtocol in class ServiceInfopublic String getSubtype()
getSubtype in class ServiceInfopublic Map<ServiceInfo.Fields,String> getQualifiedNameMap()
getQualifiedNameMap in class ServiceInfo
public void updateRecord(DNSCache dnsCache,
long now,
DNSEntry rec)
dnsCache - now - rec - public boolean hasData()
hasData in class ServiceInfotrue if the service info has data, false otherwise.public boolean advanceState(DNSTask task)
advanceState in interface DNSStatefulObjecttask - associated task
truefalse otherwise.DNSState.advance()public boolean revertState()
revertState in interface DNSStatefulObjecttruefalse otherwise.DNSState.revert()public boolean cancelState()
cancelState in interface DNSStatefulObjecttruefalse otherwise.public boolean closeState()
closeState in interface DNSStatefulObjecttruefalse otherwise.public boolean recoverState()
recoverState in interface DNSStatefulObjecttruefalse otherwise.public void removeAssociationWithTask(DNSTask task)
removeAssociationWithTask in interface DNSStatefulObjecttask - associated task
public void associateWithTask(DNSTask task,
DNSState state)
associateWithTask in interface DNSStatefulObjecttask - associated taskstate - state of the task
public boolean isAssociatedWithTask(DNSTask task,
DNSState state)
isAssociatedWithTask in interface DNSStatefulObjecttask - associated taskstate - state of the task
true is the task is associated with this object, false otherwise.public boolean isProbing()
isProbing in interface DNSStatefulObjecttrue if probing state, false otherwisepublic boolean isAnnouncing()
isAnnouncing in interface DNSStatefulObjecttrue if announcing state, false otherwisepublic boolean isAnnounced()
isAnnounced in interface DNSStatefulObjecttrue if announced state, false otherwisepublic boolean isCanceling()
isCanceling in interface DNSStatefulObjecttrue if canceling state, false otherwisepublic boolean isCanceled()
isCanceled in interface DNSStatefulObjecttrue if canceled state, false otherwisepublic boolean isClosing()
isClosing in interface DNSStatefulObjecttrue if closing state, false otherwisepublic boolean isClosed()
isClosed in interface DNSStatefulObjecttrue if closed state, false otherwisepublic boolean waitForAnnounced(long timeout)
waitForAnnounced in interface DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.
true if the object is announced, false otherwisepublic boolean waitForCanceled(long timeout)
waitForCanceled in interface DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.
true if the object is canceled, false otherwisepublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic String getNiceTextString()
getNiceTextString in class ServiceInfopublic ServiceInfoImpl clone()
clone in class ServiceInfopublic String toString()
toString in class Object
public Collection<DNSRecord> answers(boolean unique,
int ttl,
HostInfo localHost)
public void setText(byte[] text)
throws IllegalStateException
setText in class ServiceInfotext - the raw byte representation of the text field.
IllegalStateException - if attempting to set the text for a non persistent service info.
public void setText(Map<String,?> props)
throws IllegalStateException
setText in class ServiceInfoprops - 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 void setDns(JmDNSImpl dns)
public JmDNSImpl getDns()
getDns in interface DNSStatefulObjectpublic boolean isPersistent()
true if ServiceListener.resolveService will be called whenever new new information is received.
isPersistent in class ServiceInfopublic void setNeedTextAnnouncing(boolean needTextAnnouncing)
needTextAnnouncing - the needTextAnnouncing to setpublic boolean needTextAnnouncing()
|
Last updated 2011-08-25 12:40 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||