本文整理汇总了Java中javax.jmdns.impl.constants.DNSRecordClass.CLASS_ANY属性的典型用法代码示例。如果您正苦于以下问题:Java DNSRecordClass.CLASS_ANY属性的具体用法?Java DNSRecordClass.CLASS_ANY怎么用?Java DNSRecordClass.CLASS_ANY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.jmdns.impl.constants.DNSRecordClass
的用法示例。
在下文中一共展示了DNSRecordClass.CLASS_ANY属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDNSEntryList
/**
* Get all matching DNS entries from the table.
*
* @param name
* @param type
* @param recordClass
* @return list of entries
*/
public synchronized Collection<? extends DNSEntry> getDNSEntryList(String name, DNSRecordType type, DNSRecordClass recordClass) {
Collection<? extends DNSEntry> entryList = this._getDNSEntryList(name);
if (entryList != null) {
entryList = new ArrayList<DNSEntry>(entryList);
for (Iterator<? extends DNSEntry> i = entryList.iterator(); i.hasNext();) {
DNSEntry testDNSEntry = i.next();
if (!testDNSEntry.getRecordType().equals(type) || ((DNSRecordClass.CLASS_ANY != recordClass) && !testDNSEntry.getRecordClass().equals(recordClass))) {
i.remove();
}
}
} else {
entryList = Collections.emptyList();
}
return entryList;
}
示例2: getDNSEntry
/**
* Get a matching DNS entry from the table.
*
* @param name
* @param type
* @param recordClass
* @return DNSEntry
*/
public synchronized DNSEntry getDNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass)
{
DNSEntry result = null;
Collection<? extends DNSEntry> entryList = this.getDNSEntryList(name);
if (entryList != null)
{
for (DNSEntry testDNSEntry : entryList)
{
if (testDNSEntry.getRecordType().equals(type) && ((DNSRecordClass.CLASS_ANY == recordClass) || testDNSEntry.getRecordClass().equals(recordClass)))
{
result = testDNSEntry;
break;
}
}
}
return result;
}
示例3: answers
/**
* Create a series of answer that correspond with the give service info.
*
* @param recordClass
* record class of the query
* @param unique
* @param ttl
* @param localHost
* @return collection of answers
*/
public Collection<DNSRecord> answers(DNSRecordClass recordClass, boolean unique, int ttl, HostInfo localHost) {
List<DNSRecord> list = new ArrayList<DNSRecord>();
// [PJYF Dec 6 2011] This is bad hack as I don't know what the spec should really means in this case. i.e. what is the class of our registered services.
if ((recordClass == DNSRecordClass.CLASS_ANY) || (recordClass == DNSRecordClass.CLASS_IN)) {
if (this.getSubtype().length() > 0) {
list.add(new Pointer(this.getTypeWithSubtype(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
}
list.add(new Pointer(this.getType(), DNSRecordClass.CLASS_IN, DNSRecordClass.NOT_UNIQUE, ttl, this.getQualifiedName()));
list.add(new Service(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, _priority, _weight, _port, localHost.getName()));
list.add(new Text(this.getQualifiedName(), DNSRecordClass.CLASS_IN, unique, ttl, this.getTextBytes()));
}
return list;
}
示例4: getDNSEntry
/**
* Get a matching DNS entry from the table.
*
* @param name
* @param type
* @param recordClass
* @return DNSEntry
*/
public synchronized DNSEntry getDNSEntry(String name, DNSRecordType type, DNSRecordClass recordClass) {
DNSEntry result = null;
Collection<? extends DNSEntry> entryList = this._getDNSEntryList(name);
if (entryList != null) {
for (DNSEntry testDNSEntry : entryList) {
if (testDNSEntry.getRecordType().equals(type) && ((DNSRecordClass.CLASS_ANY == recordClass) || testDNSEntry.getRecordClass().equals(recordClass))) {
result = testDNSEntry;
break;
}
}
}
return result;
}
示例5: matchRecordClass
/**
* Check if the requested record class match the current record class
*
* @param recordClass
* @return <code>true</code> if the two entries have compatible class, <code>false</code> otherwise
*/
public boolean matchRecordClass(DNSRecordClass recordClass) {
return (DNSRecordClass.CLASS_ANY == recordClass) || (DNSRecordClass.CLASS_ANY == this.getRecordClass()) || this.getRecordClass().equals(recordClass);
}
示例6: isSameEntry
/**
* Check if two entries have exactly the same name, type, and class.
*
* @param entry
* @return <code>true</code> if the two entries have are for the same record, <code>false</code> otherwise
*/
public boolean isSameEntry(DNSEntry entry) {
return this.getKey().equals(entry.getKey()) && this.getRecordType().equals(entry.getRecordType()) && ((DNSRecordClass.CLASS_ANY == entry.getRecordClass()) || this.getRecordClass().equals(entry.getRecordClass()));
}
示例7: isSameEntry
/**
* Check if two entries have exactly the same name, type, and class.
*
* @param entry
*
* @return <code>true</code> if the two entries have are for the same record, <code>false</code> otherwise
*/
public boolean isSameEntry(DNSEntry entry)
{
return this.getKey().equals(entry.getKey()) && this.getRecordType().equals(entry.getRecordType()) && ((DNSRecordClass.CLASS_ANY == entry.getRecordClass()) || this.getRecordClass().equals(entry.getRecordClass()));
}