当前位置: 首页>>代码示例>>Java>>正文


Java DNSRecordClass.CLASS_ANY属性代码示例

本文整理汇总了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;
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:23,代码来源:DNSCache.java

示例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;
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:25,代码来源:DNSCache.java

示例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;
}
 
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:23,代码来源:ServiceInfoImpl.java

示例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;
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:21,代码来源:DNSCache.java

示例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);
}
 
开发者ID:iilxy,项目名称:AndroidmDNS,代码行数:9,代码来源:DNSEntry.java

示例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()));
}
 
开发者ID:DeviceConnect,项目名称:DeviceConnect-Android,代码行数:9,代码来源:DNSEntry.java

示例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()));
}
 
开发者ID:blackshadowwalker,项目名称:log4j-collector,代码行数:11,代码来源:DNSEntry.java


注:本文中的javax.jmdns.impl.constants.DNSRecordClass.CLASS_ANY属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。