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


Java DNSName类代码示例

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


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

示例1: resolveSrv

import de.measite.minidns.DNSName; //导入依赖的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: resolveNoSrvRecords

import de.measite.minidns.DNSName; //导入依赖的package包/类
private static List<Result> resolveNoSrvRecords(DNSName dnsName, boolean withCnames) {
    List<Result> results = new ArrayList<>();
    try {
        for(A a : resolveWithFallback(dnsName,A.class,false).getAnswersOrEmptySet()) {
            results.add(Result.createDefault(dnsName,a.getInetAddress()));
        }
        for(AAAA aaaa : resolveWithFallback(dnsName,AAAA.class,false).getAnswersOrEmptySet()) {
            results.add(Result.createDefault(dnsName,aaaa.getInetAddress()));
        }
        if (results.size() == 0 && withCnames) {
            for (CNAME cname : resolveWithFallback(dnsName, CNAME.class, false).getAnswersOrEmptySet()) {
                results.addAll(resolveNoSrvRecords(cname.name, false));
            }
        }
    } catch (Throwable throwable) {
        Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + "error resolving fallback records",throwable);
    }
    results.add(Result.createDefault(dnsName));
    return results;
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:21,代码来源:Resolver.java

示例3: resolveSrv

import de.measite.minidns.DNSName; //导入依赖的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: resolveNoSrvRecords

import de.measite.minidns.DNSName; //导入依赖的package包/类
private static List<Result> resolveNoSrvRecords(DNSName dnsName, boolean withCnames) {
    List<Result> results = new ArrayList<>();
    try {
        for (A a : resolveWithFallback(dnsName, A.class, false).getAnswersOrEmptySet()) {
            results.add(Result.createDefault(dnsName, a.getInetAddress()));
        }
        for (AAAA aaaa : resolveWithFallback(dnsName, AAAA.class, false).getAnswersOrEmptySet()) {
            results.add(Result.createDefault(dnsName, aaaa.getInetAddress()));
        }
        if (results.size() == 0 && withCnames) {
            for (CNAME cname : resolveWithFallback(dnsName, CNAME.class, false).getAnswersOrEmptySet()) {
                results.addAll(resolveNoSrvRecords(cname.name, false));
            }
        }
    } catch (Throwable throwable) {
        Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + "error resolving fallback records", throwable);
    }
    results.add(Result.createDefault(dnsName));
    return results;
}
 
开发者ID:kriztan,项目名称:Pix-Art-Messenger,代码行数:21,代码来源:Resolver.java

示例5: resolveSrv

import de.measite.minidns.DNSName; //导入依赖的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: resolveNoSrvRecords

import de.measite.minidns.DNSName; //导入依赖的package包/类
private static List<Result> resolveNoSrvRecords(DNSName dnsName, boolean withCnames) {
	List<Result> results = new ArrayList<>();
	try {
		for (A a : resolveWithFallback(dnsName, A.class, false).getAnswersOrEmptySet()) {
			results.add(Result.createDefault(dnsName, a.getInetAddress()));
		}
		for (AAAA aaaa : resolveWithFallback(dnsName, AAAA.class, false).getAnswersOrEmptySet()) {
			results.add(Result.createDefault(dnsName, aaaa.getInetAddress()));
		}
		if (results.size() == 0 && withCnames) {
			for (CNAME cname : resolveWithFallback(dnsName, CNAME.class, false).getAnswersOrEmptySet()) {
				results.addAll(resolveNoSrvRecords(cname.name, false));
			}
		}
	} catch (Throwable throwable) {
		Log.d(Config.LOGTAG, Resolver.class.getSimpleName() + "error resolving fallback records", throwable);
	}
	results.add(Result.createDefault(dnsName));
	return results;
}
 
开发者ID:siacs,项目名称:Conversations,代码行数:21,代码来源:Resolver.java

示例7: createDefault

import de.measite.minidns.DNSName; //导入依赖的package包/类
public static Result createDefault(DNSName hostname, InetAddress ip) {
    Result result = new Result();
    result.port = 5222;
    result.hostname = hostname;
    result.ip = ip;
    return result;
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:8,代码来源:Resolver.java

示例8: createDefault

import de.measite.minidns.DNSName; //导入依赖的package包/类
public static Result createDefault(DNSName hostname, InetAddress ip) {
	Result result = new Result();
	result.port = 5222;
	result.hostname = hostname;
	result.ip = ip;
	return result;
}
 
开发者ID:siacs,项目名称:Conversations,代码行数:8,代码来源:Resolver.java

示例9: fromCursor

import de.measite.minidns.DNSName; //导入依赖的package包/类
public static Result fromCursor(Cursor cursor) {
	final Result result = new Result();
	try {
		result.ip = InetAddress.getByAddress(cursor.getBlob(cursor.getColumnIndex(IP)));
	} catch (UnknownHostException e) {
		result.ip = null;
	}
	result.hostname = DNSName.from(cursor.getString(cursor.getColumnIndex(HOSTNAME)));
	result.port = cursor.getInt(cursor.getColumnIndex(PORT));
	result.priority = cursor.getInt(cursor.getColumnIndex(PRIORITY));
	result.authenticated = cursor.getInt(cursor.getColumnIndex(AUTHENTICATED)) > 0;
	result.directTls = cursor.getInt(cursor.getColumnIndex(DIRECT_TLS)) > 0;
	return result;
}
 
开发者ID:siacs,项目名称:Conversations,代码行数:15,代码来源:Resolver.java

示例10: resolveWithFallback

import de.measite.minidns.DNSName; //导入依赖的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

示例11: getHostname

import de.measite.minidns.DNSName; //导入依赖的package包/类
public DNSName getHostname() {
    return hostname;
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:4,代码来源:Resolver.java

示例12: resolveWithFallback

import de.measite.minidns.DNSName; //导入依赖的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

示例13: resolveWithFallback

import de.measite.minidns.DNSName; //导入依赖的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

示例14: getHostname

import de.measite.minidns.DNSName; //导入依赖的package包/类
public DNSName getHostname() {
	return hostname;
}
 
开发者ID:siacs,项目名称:Conversations,代码行数:4,代码来源:Resolver.java


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