public class ServiceInfoImpl extends ServiceInfo implements DNSStatefulObject
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ServiceInfoImpl.Delegate |
ServiceInfo.FieldsDNSStatefulObject.DefaultImplementation, DNSStatefulObject.DNSStatefulObjectSemaphore| 构造器和说明 |
|---|
ServiceInfoImpl(java.util.Map<ServiceInfo.Fields,java.lang.String> qualifiedNameMap,
int port,
int weight,
int priority,
boolean persistent,
java.util.Map<java.lang.String,?> props) |
ServiceInfoImpl(java.lang.String type,
java.lang.String name,
java.lang.String subtype,
int port,
int weight,
int priority,
boolean persistent,
byte[] text) |
ServiceInfoImpl(java.lang.String type,
java.lang.String name,
java.lang.String subtype,
int port,
int weight,
int priority,
boolean persistent,
java.util.Map<java.lang.String,?> props) |
ServiceInfoImpl(java.lang.String type,
java.lang.String name,
java.lang.String subtype,
int port,
int weight,
int priority,
boolean persistent,
java.lang.String text) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
advanceState(DNSTask task)
Sets the state and notifies all objects that wait on the ServiceInfo.
|
java.util.Collection<DNSRecord> |
answers(DNSRecordClass recordClass,
boolean unique,
int ttl,
HostInfo localHost)
Create a series of answer that correspond with the give service info.
|
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 java.util.Map<ServiceInfo.Fields,java.lang.String> |
checkQualifiedNameMap(java.util.Map<ServiceInfo.Fields,java.lang.String> qualifiedNameMap) |
ServiceInfoImpl |
clone() |
boolean |
closeState()
Sets the state and notifies all objects that wait on the ServiceInfo.
|
boolean |
equals(java.lang.Object obj) |
java.net.InetAddress |
getAddress()
已过时。
|
java.lang.String |
getApplication()
Returns the application of the service info suitable for printing.
|
JmDNSImpl |
getDns()
Returns the DNS associated with this object.
|
java.lang.String |
getDomain()
Returns the domain of the service info suitable for printing.
|
java.lang.String |
getHostAddress()
已过时。
|
java.lang.String[] |
getHostAddresses()
Returns the host IP addresses string in textual presentation.
|
java.net.Inet4Address |
getInet4Address()
已过时。
|
java.net.Inet4Address[] |
getInet4Addresses()
Returns a list of all IPv4 InetAddresses that can be used for this service.
|
java.net.Inet6Address |
getInet6Address()
已过时。
|
java.net.Inet6Address[] |
getInet6Addresses()
Returns a list of all IPv6 InetAddresses that can be used for this service.
|
java.net.InetAddress |
getInetAddress()
已过时。
|
java.net.InetAddress[] |
getInetAddresses()
Returns a list of all InetAddresses that can be used for this service.
|
java.lang.String |
getKey()
The key is used to retrieve service info in hash tables.
|
java.lang.String |
getName()
Unqualified service instance name, such as
foobar . |
java.lang.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(java.lang.String name)
Get a property of the service.
|
java.util.Enumeration<java.lang.String> |
getPropertyNames()
Enumeration of the property names.
|
java.lang.String |
getPropertyString(java.lang.String name)
Get a property of the service.
|
java.lang.String |
getProtocol()
Returns the protocol of the service info suitable for printing.
|
java.lang.String |
getQualifiedName()
Fully qualified service name, such as
foobar. |
java.util.Map<ServiceInfo.Fields,java.lang.String> |
getQualifiedNameMap()
Returns a dictionary of the fully qualified name component of this service.
|
java.lang.String |
getServer()
Get the name of the server.
|
java.lang.String |
getSubtype()
Returns the sub type of the service info suitable for printing.
|
byte[] |
getTextBytes()
Get the text for the service as raw bytes.
|
java.lang.String |
getTextString()
已过时。
|
java.lang.String |
getType()
Fully qualified service type name, such as
_http. |
java.lang.String |
getTypeWithSubtype()
Fully qualified service type name with the subtype if appropriate, such as
_printer. |
java.lang.String |
getURL()
已过时。
|
java.lang.String |
getURL(java.lang.String protocol)
已过时。
|
java.lang.String[] |
getURLs()
Get the list of URL for this service.
|
java.lang.String[] |
getURLs(java.lang.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 |
hasSameAddresses(ServiceInfo other)
Compare addresses of another ServiceInfo
|
boolean |
hasServer()
Returns true if the service info has a server
|
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(java.util.Map<java.lang.String,?> props)
Set the text for the service.
|
java.lang.String |
toString() |
void |
updateRecord(DNSCache dnsCache,
long now,
DNSEntry dnsEntry)
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.
|
public ServiceInfoImpl(java.lang.String type,
java.lang.String name,
java.lang.String subtype,
int port,
int weight,
int priority,
boolean persistent,
java.lang.String text)
type - name - subtype - port - weight - priority - persistent - text - ServiceInfo.create(String, String, int, int, int, String)public ServiceInfoImpl(java.lang.String type,
java.lang.String name,
java.lang.String subtype,
int port,
int weight,
int priority,
boolean persistent,
java.util.Map<java.lang.String,?> props)
type - name - subtype - port - weight - priority - persistent - props - ServiceInfo.create(String, String, int, int, int, Map)public ServiceInfoImpl(java.lang.String type,
java.lang.String name,
java.lang.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(java.util.Map<ServiceInfo.Fields,java.lang.String> qualifiedNameMap, int port, int weight, int priority, boolean persistent, java.util.Map<java.lang.String,?> props)
protected static java.util.Map<ServiceInfo.Fields,java.lang.String> checkQualifiedNameMap(java.util.Map<ServiceInfo.Fields,java.lang.String> qualifiedNameMap)
public java.lang.String getType()
_http._tcp.local.getType 在类中 ServiceInfopublic java.lang.String getTypeWithSubtype()
_printer._sub._http._tcp.local.getTypeWithSubtype 在类中 ServiceInfopublic java.lang.String getName()
foobar .getName 在类中 ServiceInfopublic java.lang.String getKey()
getKey 在类中 ServiceInfopublic java.lang.String getQualifiedName()
foobar._http._tcp.local. .getQualifiedName 在类中 ServiceInfopublic java.lang.String getServer()
ServiceInfogetServer 在类中 ServiceInfoServiceInfo.getServer()public boolean hasServer()
ServiceInfohasServer 在类中 ServiceInfotrue if the service info has a server specified, false otherwise.ServiceInfo.hasServer()@Deprecated public java.lang.String getHostAddress()
getHostAddress 在类中 ServiceInfoServiceInfo.getHostAddresses()public java.lang.String[] getHostAddresses()
getHostAddresses 在类中 ServiceInfo@Deprecated public java.net.InetAddress getAddress()
getAddress 在类中 ServiceInfoServiceInfo.getInetAddresses()@Deprecated public java.net.InetAddress getInetAddress()
getInetAddress 在类中 ServiceInfoServiceInfo.getInetAddresses()@Deprecated public java.net.Inet4Address getInet4Address()
getInet4Address 在类中 ServiceInfoServiceInfo.getInet4Addresses()@Deprecated public java.net.Inet6Address getInet6Address()
getInet6Address 在类中 ServiceInfoServiceInfo.getInet6Addresses()public java.net.InetAddress[] getInetAddresses()
ServiceInfoIn a multi-homed environment service info can be associated with more than one address.
getInetAddresses 在类中 ServiceInfopublic java.net.Inet4Address[] getInet4Addresses()
ServiceInfoIn a multi-homed environment service info can be associated with more than one address.
getInet4Addresses 在类中 ServiceInfopublic java.net.Inet6Address[] getInet6Addresses()
ServiceInfoIn a multi-homed environment service info can be associated with more than one address.
getInet6Addresses 在类中 ServiceInfopublic int getPort()
ServiceInfogetPort 在类中 ServiceInfoServiceInfo.getPort()public int getPriority()
ServiceInfogetPriority 在类中 ServiceInfoServiceInfo.getPriority()public int getWeight()
ServiceInfogetWeight 在类中 ServiceInfoServiceInfo.getWeight()public byte[] getTextBytes()
ServiceInfogetTextBytes 在类中 ServiceInfoServiceInfo.getTextBytes()@Deprecated public java.lang.String getTextString()
getTextString 在类中 ServiceInfoServiceInfo.getPropertyNames(),
ServiceInfo.getPropertyBytes(String),
ServiceInfo.getPropertyString(String)@Deprecated public java.lang.String getURL()
ServiceInfogetURL 在类中 ServiceInfoServiceInfo.getURLs()public java.lang.String[] getURLs()
ServiceInfogetURLs 在类中 ServiceInfo@Deprecated public java.lang.String getURL(java.lang.String protocol)
ServiceInfogetURL 在类中 ServiceInfoprotocol - requested protocolServiceInfo.getURLs()public java.lang.String[] getURLs(java.lang.String protocol)
ServiceInfogetURLs 在类中 ServiceInfoprotocol - requested protocolpublic byte[] getPropertyBytes(java.lang.String name)
getPropertyBytes 在类中 ServiceInfoname - property namepublic java.lang.String getPropertyString(java.lang.String name)
getPropertyString 在类中 ServiceInfoname - property namepublic java.util.Enumeration<java.lang.String> getPropertyNames()
getPropertyNames 在类中 ServiceInfopublic java.lang.String getApplication()
getApplication 在类中 ServiceInfopublic java.lang.String getDomain()
getDomain 在类中 ServiceInfopublic java.lang.String getProtocol()
getProtocol 在类中 ServiceInfopublic java.lang.String getSubtype()
getSubtype 在类中 ServiceInfopublic java.util.Map<ServiceInfo.Fields,java.lang.String> getQualifiedNameMap()
getQualifiedNameMap 在类中 ServiceInfopublic void updateRecord(DNSCache dnsCache, long now, DNSEntry dnsEntry)
dnsCache - now - dnsEntry - public boolean hasData()
hasData 在类中 ServiceInfotrue if the service info has data, false otherwise.public boolean advanceState(DNSTask task)
advanceState 在接口中 DNSStatefulObjecttask - associated tasktrue if the state was changed by this thread, false otherwise.DNSState.advance()public boolean revertState()
revertState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.DNSState.revert()public boolean cancelState()
cancelState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.public boolean closeState()
closeState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.public boolean recoverState()
recoverState 在接口中 DNSStatefulObjecttrue if the state was changed by this thread, false otherwise.public void removeAssociationWithTask(DNSTask task)
removeAssociationWithTask 在接口中 DNSStatefulObjecttask - associated taskpublic void associateWithTask(DNSTask task, DNSState state)
associateWithTask 在接口中 DNSStatefulObjecttask - associated taskstate - state of the taskpublic boolean isAssociatedWithTask(DNSTask task, DNSState state)
isAssociatedWithTask 在接口中 DNSStatefulObjecttask - associated taskstate - state of the tasktrue is the task is associated with this object, false otherwise.public boolean isProbing()
isProbing 在接口中 DNSStatefulObjecttrue if probing state, false otherwisepublic boolean isAnnouncing()
isAnnouncing 在接口中 DNSStatefulObjecttrue if announcing state, false otherwisepublic boolean isAnnounced()
isAnnounced 在接口中 DNSStatefulObjecttrue if announced state, false otherwisepublic boolean isCanceling()
isCanceling 在接口中 DNSStatefulObjecttrue if canceling state, false otherwisepublic boolean isCanceled()
isCanceled 在接口中 DNSStatefulObjecttrue if canceled state, false otherwisepublic boolean isClosing()
isClosing 在接口中 DNSStatefulObjecttrue if closing state, false otherwisepublic boolean isClosed()
isClosed 在接口中 DNSStatefulObjecttrue if closed state, false otherwisepublic boolean waitForAnnounced(long timeout)
waitForAnnounced 在接口中 DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.true if the object is announced, false otherwisepublic boolean waitForCanceled(long timeout)
waitForCanceled 在接口中 DNSStatefulObjecttimeout - the maximum time to wait in milliseconds.true if the object is canceled, false otherwisepublic int hashCode()
hashCode 在类中 java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Objectpublic java.lang.String getNiceTextString()
getNiceTextString 在类中 ServiceInfopublic ServiceInfoImpl clone()
clone 在类中 ServiceInfopublic java.lang.String toString()
toString 在类中 java.lang.Objectpublic java.util.Collection<DNSRecord> answers(DNSRecordClass recordClass, boolean unique, int ttl, HostInfo localHost)
recordClass - record class of the queryunique - ttl - localHost - public void setText(byte[] text)
throws java.lang.IllegalStateException
setText 在类中 ServiceInfotext - the raw byte representation of the text field.java.lang.IllegalStateException - if attempting to set the text for a non persistent service info.public void setText(java.util.Map<java.lang.String,?> props)
throws java.lang.IllegalStateException
setText 在类中 ServiceInfoprops - a key=value map that will be encoded into raw bytes.java.lang.IllegalStateException - if attempting to set the text for a non persistent service info.public void setDns(JmDNSImpl dns)
public JmDNSImpl getDns()
getDns 在接口中 DNSStatefulObjectpublic boolean isPersistent()
true if ServiceListener.resolveService will be called whenever new new information is received.isPersistent 在类中 ServiceInfopublic void setNeedTextAnnouncing(boolean needTextAnnouncing)
needTextAnnouncing - the needTextAnnouncing to setpublic boolean needTextAnnouncing()
public boolean hasSameAddresses(ServiceInfo other)
ServiceInfohasSameAddresses 在类中 ServiceInfoother - ServiceInfo to compare