Package javax.jmdns.impl
Class DNSRecord.Service
java.lang.Object
javax.jmdns.impl.DNSEntry
javax.jmdns.impl.DNSRecord
javax.jmdns.impl.DNSRecord.Service
- Enclosing class:
DNSRecord
Service record.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.jmdns.impl.DNSRecord
DNSRecord.Address, DNSRecord.HostInformation, DNSRecord.IPv4Address, DNSRecord.IPv6Address, DNSRecord.Pointer, DNSRecord.Service, DNSRecord.Text
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
private final String
private final int
private static org.slf4j.Logger
Fields inherited from class javax.jmdns.impl.DNSEntry
_qualifiedNameMap
-
Constructor Summary
ConstructorsConstructorDescriptionService
(String name, DNSRecordClass recordClass, boolean unique, int ttl, int priority, int weight, int port, String server) -
Method Summary
Modifier and TypeMethodDescription(package private) DNSOutgoing
addAnswer
(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) Adds this as an answer to the provided outgoing datagram.int
getPort()
int
(package private) String
getServiceEvent
(JmDNSImpl dns) Creates and return a service event for this record.getServiceInfo
(boolean persistent) Return a service information associated with that record if appropriate.int
(package private) boolean
handleQuery
(JmDNSImpl dns, long expirationTime) Handles a query represented by this record.(package private) boolean
handleResponse
(JmDNSImpl dns) Handles a response represented by this record.boolean
Determine if a record can have multiple values in the cache.(package private) boolean
True if this record has the same value as some other record.protected void
toByteArray
(DataOutputStream dout) protected void
(package private) void
Write this record into an outgoing message.Methods inherited from class javax.jmdns.impl.DNSRecord
equals, getCreated, getExpirationTime, getRecordSource, getRemainingTTL, getServiceInfo, getTTL, incrementRefreshPercentage, isExpired, isStale, isStaleAndShouldBeRefreshed, resetTTL, sameType, setRecordSource, setTTL, setWillExpireSoon, suppressedBy, suppressedBy
Methods inherited from class javax.jmdns.impl.DNSEntry
compareTo, getKey, getName, getQualifiedNameMap, getRecordClass, getRecordType, getSubtype, getType, hashCode, isDomainDiscoveryQuery, isReverseLookup, isSameEntry, isSameRecordClass, isSameType, isServicesDiscoveryMetaQuery, isUnique, isV4ReverseLookup, isV6ReverseLookup, matchRecordClass, matchRecordType, sameSubtype, toByteArray, toString
-
Field Details
-
logger1
private static org.slf4j.Logger logger1 -
_priority
private final int _priority -
_weight
private final int _weight -
_port
private final int _port -
_server
-
-
Constructor Details
-
Service
public Service(String name, DNSRecordClass recordClass, boolean unique, int ttl, int priority, int weight, int port, String server)
-
-
Method Details
-
write
Description copied from class:DNSRecord
Write this record into an outgoing message. -
toByteArray
- Overrides:
toByteArray
in classDNSEntry
- Parameters:
dout
-- Throws:
IOException
-
getServer
String getServer() -
getPriority
public int getPriority()- Returns:
- the priority
-
getWeight
public int getWeight()- Returns:
- the weight
-
getPort
public int getPort()- Returns:
- the port
-
sameValue
Description copied from class:DNSRecord
True if this record has the same value as some other record. -
isSingleValued
public boolean isSingleValued()Description copied from class:DNSRecord
Determine if a record can have multiple values in the cache.- Specified by:
isSingleValued
in classDNSRecord
- Returns:
false
if this record can have multiple values in the cache,true
otherwise.
-
handleQuery
Description copied from class:DNSRecord
Handles a query represented by this record.- Specified by:
handleQuery
in classDNSRecord
- Returns:
- Returns true if a conflict with one of the services registered with JmDNS or with the hostname occured.
-
handleResponse
Description copied from class:DNSRecord
Handles a response represented by this record.- Specified by:
handleResponse
in classDNSRecord
- Returns:
- Returns true if a conflict with one of the services registered with JmDNS or with the hostname occured.
-
addAnswer
DNSOutgoing addAnswer(JmDNSImpl dns, DNSIncoming in, InetAddress addr, int port, DNSOutgoing out) throws IOException Description copied from class:DNSRecord
Adds this as an answer to the provided outgoing datagram.- Specified by:
addAnswer
in classDNSRecord
- Throws:
IOException
-
getServiceInfo
Description copied from class:DNSRecord
Return a service information associated with that record if appropriate.- Specified by:
getServiceInfo
in classDNSRecord
- Parameters:
persistent
- iftrue
ServiceListener.resolveService will be called whenever new new information is received.- Returns:
- service information
-
getServiceEvent
Description copied from class:DNSRecord
Creates and return a service event for this record.- Specified by:
getServiceEvent
in classDNSRecord
- Parameters:
dns
- DNS serviced by this event- Returns:
- service event
-
toString
-