• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ResolverResult类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中de.measite.minidns.hla.ResolverResult的典型用法代码示例。如果您正苦于以下问题:Java ResolverResult类的具体用法?Java ResolverResult怎么用?Java ResolverResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ResolverResult类属于de.measite.minidns.hla包,在下文中一共展示了ResolverResult类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: resolveSrv

点赞 3

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static List<Result> resolveSrv(String domain, final boolean directTls) throws IOException {
    if (Thread.currentThread().isInterrupted()) {
        return Collections.emptyList();
    }
    DNSName dnsName = DNSName.from((directTls ? DIRECT_TLS_SERVICE : STARTTLS_SERICE)+"._tcp."+domain);
    ResolverResult<SRV> result = resolveWithFallback(dnsName,SRV.class);
    List<Result> results = new ArrayList<>();
    for(SRV record : result.getAnswersOrEmptySet()) {
        final boolean addedIPv4 = results.addAll(resolveIp(record,A.class,result.isAuthenticData(),directTls));
        results.addAll(resolveIp(record,AAAA.class,result.isAuthenticData(),directTls));
        if (!addedIPv4 && !Thread.currentThread().isInterrupted()) {
            Result resolverResult = Result.fromRecord(record, directTls);
            resolverResult.authenticated = resolverResult.isAuthenticated();
            results.add(resolverResult);
        }
    }
    return results;
}
 

开发者ID:syntafin,
项目名称:TenguChat,
代码行数:19,
代码来源:Resolver.java

示例2: resolveIp

点赞 3

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static <D extends InternetAddressRR> List<Result> resolveIp(SRV srv, Class<D> type, boolean authenticated, boolean directTls) {
    if (Thread.currentThread().isInterrupted()) {
        return Collections.emptyList();
    }
    List<Result> list = new ArrayList<>();
    try {
        ResolverResult<D> results = resolveWithFallback(srv.name,type, authenticated);
        for (D record : results.getAnswersOrEmptySet()) {
            Result resolverResult = Result.fromRecord(srv, directTls);
            resolverResult.authenticated = results.isAuthenticData() && authenticated;
            resolverResult.ip = record.getInetAddress();
            list.add(resolverResult);
        }
    } catch (Throwable t) {
        Log.d(Config.LOGTAG,Resolver.class.getSimpleName()+": error resolving "+type.getSimpleName()+" "+t.getMessage());
    }
    return list;
}
 

开发者ID:syntafin,
项目名称:TenguChat,
代码行数:19,
代码来源:Resolver.java

示例3: resolveSrv

点赞 3

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static List<Result> resolveSrv(String domain, final boolean directTls) throws IOException {
    if (Thread.currentThread().isInterrupted()) {
        return Collections.emptyList();
    }
    DNSName dnsName = DNSName.from((directTls ? DIRECT_TLS_SERVICE : STARTTLS_SERICE) + "._tcp." + domain);
    ResolverResult<SRV> result = resolveWithFallback(dnsName, SRV.class);
    List<Result> results = new ArrayList<>();
    for (SRV record : result.getAnswersOrEmptySet()) {
        final boolean addedIPv4 = results.addAll(resolveIp(record, A.class, result.isAuthenticData(), directTls));
        results.addAll(resolveIp(record, AAAA.class, result.isAuthenticData(), directTls));
        if (!addedIPv4 && !Thread.currentThread().isInterrupted()) {
            Result resolverResult = Result.fromRecord(record, directTls);
            resolverResult.authenticated = resolverResult.isAuthenticated();
            results.add(resolverResult);
        }
    }
    return results;
}
 

开发者ID:kriztan,
项目名称:Pix-Art-Messenger,
代码行数:19,
代码来源:Resolver.java

示例4: resolveIp

点赞 3

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static <D extends InternetAddressRR> List<Result> resolveIp(SRV srv, Class<D> type, boolean authenticated, boolean directTls) {
    if (Thread.currentThread().isInterrupted()) {
        return Collections.emptyList();
    }
    List<Result> list = new ArrayList<>();
    try {
        ResolverResult<D> results = resolveWithFallback(srv.name, type, authenticated);
        for (D record : results.getAnswersOrEmptySet()) {
            Result resolverResult = Result.fromRecord(srv, directTls);
            resolverResult.authenticated = results.isAuthenticData() && authenticated;
            resolverResult.ip = record.getInetAddress();
            list.add(resolverResult);
        }
    } catch (Throwable t) {
        Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": error resolving " + type.getSimpleName() + " " + t.getMessage());
    }
    return list;
}
 

开发者ID:kriztan,
项目名称:Pix-Art-Messenger,
代码行数:19,
代码来源:Resolver.java

示例5: resolveSrv

点赞 3

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static List<Result> resolveSrv(String domain, final boolean directTls) throws IOException {
	if (Thread.currentThread().isInterrupted()) {
		return Collections.emptyList();
	}
	DNSName dnsName = DNSName.from((directTls ? DIRECT_TLS_SERVICE : STARTTLS_SERICE) + "._tcp." + domain);
	ResolverResult<SRV> result = resolveWithFallback(dnsName, SRV.class);
	List<Result> results = new ArrayList<>();
	for (SRV record : result.getAnswersOrEmptySet()) {
		final boolean addedIPv4 = results.addAll(resolveIp(record, A.class, result.isAuthenticData(), directTls));
		results.addAll(resolveIp(record, AAAA.class, result.isAuthenticData(), directTls));
		if (!addedIPv4 && !Thread.currentThread().isInterrupted()) {
			Result resolverResult = Result.fromRecord(record, directTls);
			resolverResult.authenticated = resolverResult.isAuthenticated();
			results.add(resolverResult);
		}
	}
	return results;
}
 

开发者ID:siacs,
项目名称:Conversations,
代码行数:19,
代码来源:Resolver.java

示例6: resolveIp

点赞 3

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static <D extends InternetAddressRR> List<Result> resolveIp(SRV srv, Class<D> type, boolean authenticated, boolean directTls) {
	if (Thread.currentThread().isInterrupted()) {
		return Collections.emptyList();
	}
	List<Result> list = new ArrayList<>();
	try {
		ResolverResult<D> results = resolveWithFallback(srv.name, type, authenticated);
		for (D record : results.getAnswersOrEmptySet()) {
			Result resolverResult = Result.fromRecord(srv, directTls);
			resolverResult.authenticated = results.isAuthenticData() && authenticated;
			resolverResult.ip = record.getInetAddress();
			list.add(resolverResult);
		}
	} catch (Throwable t) {
		Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + ": error resolving " + type.getSimpleName() + " " + t.getMessage());
	}
	return list;
}
 

开发者ID:siacs,
项目名称:Conversations,
代码行数:19,
代码来源:Resolver.java

示例7: resolveWithFallback

点赞 2

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static <D extends Data> ResolverResult<D> resolveWithFallback(DNSName dnsName, Class<D> type) throws IOException {
    return resolveWithFallback(dnsName,type,validateHostname());
}
 

开发者ID:syntafin,
项目名称:TenguChat,
代码行数:4,
代码来源:Resolver.java

示例8: resolveWithFallback

点赞 2

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static <D extends Data> ResolverResult<D> resolveWithFallback(DNSName dnsName, Class<D> type) throws IOException {
    return resolveWithFallback(dnsName, type, validateHostname());
}
 

开发者ID:kriztan,
项目名称:Pix-Art-Messenger,
代码行数:4,
代码来源:Resolver.java

示例9: resolveWithFallback

点赞 2

import de.measite.minidns.hla.ResolverResult; //导入依赖的package包/类
private static <D extends Data> ResolverResult<D> resolveWithFallback(DNSName dnsName, Class<D> type) throws IOException {
	return resolveWithFallback(dnsName, type, validateHostname());
}
 

开发者ID:siacs,
项目名称:Conversations,
代码行数:4,
代码来源:Resolver.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)