|
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 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 ServiceInfo
public String getTypeWithSubtype()
_printer._sub._http._tcp.local.
getTypeWithSubtype
in class ServiceInfo
public String getName()
foobar
.
getName
in class ServiceInfo
public String getKey()
getKey
in class ServiceInfo
public String getQualifiedName()
foobar._http._tcp.local.
.
getQualifiedName
in class ServiceInfo
public String getServer()
ServiceInfo
getServer
in class ServiceInfo
ServiceInfo.getServer()
@Deprecated public String getHostAddress()
getHostAddress
in class ServiceInfo
ServiceInfo.getHostAddresses()
public String[] getHostAddresses()
getHostAddresses
in class ServiceInfo
@Deprecated public InetAddress getAddress()
getAddress
in class ServiceInfo
ServiceInfo.getInetAddresses()
@Deprecated public InetAddress getInetAddress()
getInetAddress
in class ServiceInfo
ServiceInfo.getInetAddresses()
@Deprecated public Inet4Address getInet4Address()
getInet4Address
in class ServiceInfo
ServiceInfo.getInet4Addresses()
@Deprecated public Inet6Address getInet6Address()
getInet6Address
in class ServiceInfo
ServiceInfo.getInet6Addresses()
public InetAddress[] getInetAddresses()
ServiceInfo
In a multi-homed environment service info can be associated with more than one address.
getInetAddresses
in class ServiceInfo
public Inet4Address[] getInet4Addresses()
ServiceInfo
In a multi-homed environment service info can be associated with more than one address.
getInet4Addresses
in class ServiceInfo
public Inet6Address[] getInet6Addresses()
ServiceInfo
In a multi-homed environment service info can be associated with more than one address.
getInet6Addresses
in class ServiceInfo
public int getPort()
ServiceInfo
getPort
in class ServiceInfo
ServiceInfo.getPort()
public int getPriority()
ServiceInfo
getPriority
in class ServiceInfo
ServiceInfo.getPriority()
public int getWeight()
ServiceInfo
getWeight
in class ServiceInfo
ServiceInfo.getWeight()
public byte[] getTextBytes()
ServiceInfo
getTextBytes
in class ServiceInfo
ServiceInfo.getTextBytes()
@Deprecated public String getTextString()
getTextString
in class ServiceInfo
ServiceInfo.getPropertyNames()
,
ServiceInfo.getPropertyBytes(String)
,
ServiceInfo.getPropertyString(String)
@Deprecated public String getURL()
ServiceInfo
getURL
in class ServiceInfo
ServiceInfo.getURLs()
public String[] getURLs()
ServiceInfo
getURLs
in class ServiceInfo
@Deprecated public String getURL(String protocol)
ServiceInfo
getURL
in class ServiceInfo
protocol
- requested protocol
ServiceInfo.getURLs()
public String[] getURLs(String protocol)
ServiceInfo
getURLs
in class ServiceInfo
protocol
- requested protocol
public byte[] getPropertyBytes(String name)
getPropertyBytes
in class ServiceInfo
name
- property name
public String getPropertyString(String name)
getPropertyString
in class ServiceInfo
name
- property name
public Enumeration<String> getPropertyNames()
getPropertyNames
in class ServiceInfo
public String getApplication()
getApplication
in class ServiceInfo
public String getDomain()
getDomain
in class ServiceInfo
public String getProtocol()
getProtocol
in class ServiceInfo
public String getSubtype()
getSubtype
in class ServiceInfo
public 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 ServiceInfo
true
if the service info has data, false
otherwise.public boolean advanceState(DNSTask task)
advanceState
in interface DNSStatefulObject
task
- associated task
true
false otherwise.DNSState.advance()
public boolean revertState()
revertState
in interface DNSStatefulObject
true
false otherwise.DNSState.revert()
public boolean cancelState()
cancelState
in interface DNSStatefulObject
true
false otherwise.public boolean closeState()
closeState
in interface DNSStatefulObject
true
false otherwise.public boolean recoverState()
recoverState
in interface DNSStatefulObject
true
false otherwise.public void removeAssociationWithTask(DNSTask task)
removeAssociationWithTask
in interface DNSStatefulObject
task
- associated taskpublic void associateWithTask(DNSTask task, DNSState state)
associateWithTask
in interface DNSStatefulObject
task
- associated taskstate
- state of the taskpublic boolean isAssociatedWithTask(DNSTask task, DNSState state)
isAssociatedWithTask
in interface DNSStatefulObject
task
- associated taskstate
- state of the task
true
is the task is associated with this object, false
otherwise.public boolean isProbing()
isProbing
in interface DNSStatefulObject
true
if probing state, false
otherwisepublic boolean isAnnouncing()
isAnnouncing
in interface DNSStatefulObject
true
if announcing state, false
otherwisepublic boolean isAnnounced()
isAnnounced
in interface DNSStatefulObject
true
if announced state, false
otherwisepublic boolean isCanceling()
isCanceling
in interface DNSStatefulObject
true
if canceling state, false
otherwisepublic boolean isCanceled()
isCanceled
in interface DNSStatefulObject
true
if canceled state, false
otherwisepublic boolean isClosing()
isClosing
in interface DNSStatefulObject
true
if closing state, false
otherwisepublic boolean isClosed()
isClosed
in interface DNSStatefulObject
true
if closed state, false
otherwisepublic boolean waitForAnnounced(long timeout)
waitForAnnounced
in interface DNSStatefulObject
timeout
- the maximum time to wait in milliseconds.
true
if the object is announced, false
otherwisepublic boolean waitForCanceled(long timeout)
waitForCanceled
in interface DNSStatefulObject
timeout
- the maximum time to wait in milliseconds.
true
if the object is canceled, false
otherwisepublic int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public String getNiceTextString()
getNiceTextString
in class ServiceInfo
public ServiceInfoImpl clone()
clone
in class ServiceInfo
public 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 ServiceInfo
text
- 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 ServiceInfo
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 void setDns(JmDNSImpl dns)
public JmDNSImpl getDns()
getDns
in interface DNSStatefulObject
public boolean isPersistent()
true
if ServiceListener.resolveService will be called whenever new new information is received.
isPersistent
in class ServiceInfo
public 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 |