Search in sources :

Example 1 with SrvResolverResult

use of org.minidns.hla.SrvResolverResult in project Smack by igniterealtime.

the class MiniDnsResolver method lookupSrvRecords0.

@Override
protected Set<SRV> lookupSrvRecords0(final DnsName name, List<RemoteConnectionEndpointLookupFailure> lookupFailures, DnssecMode dnssecMode) {
    final ResolverApi resolver = getResolver(dnssecMode);
    SrvResolverResult result;
    try {
        result = resolver.resolveSrv(name);
    } catch (IOException e) {
        RemoteConnectionEndpointLookupFailure failure = new RemoteConnectionEndpointLookupFailure.DnsLookupFailure(name, e);
        lookupFailures.add(failure);
        return null;
    }
    ResolutionUnsuccessfulException resolutionUnsuccessfulException = result.getResolutionUnsuccessfulException();
    if (resolutionUnsuccessfulException != null) {
        RemoteConnectionEndpointLookupFailure failure = new RemoteConnectionEndpointLookupFailure.DnsLookupFailure(name, resolutionUnsuccessfulException);
        lookupFailures.add(failure);
        return null;
    }
    if (shouldAbortIfNotAuthentic(name, dnssecMode, result, lookupFailures)) {
        return null;
    }
    return result.getAnswers();
}
Also used : RemoteConnectionEndpointLookupFailure(org.jivesoftware.smack.util.rce.RemoteConnectionEndpointLookupFailure) ResolutionUnsuccessfulException(org.minidns.hla.ResolutionUnsuccessfulException) DnssecResolverApi(org.minidns.hla.DnssecResolverApi) ResolverApi(org.minidns.hla.ResolverApi) IOException(java.io.IOException) SrvResolverResult(org.minidns.hla.SrvResolverResult)

Aggregations

IOException (java.io.IOException)1 RemoteConnectionEndpointLookupFailure (org.jivesoftware.smack.util.rce.RemoteConnectionEndpointLookupFailure)1 DnssecResolverApi (org.minidns.hla.DnssecResolverApi)1 ResolutionUnsuccessfulException (org.minidns.hla.ResolutionUnsuccessfulException)1 ResolverApi (org.minidns.hla.ResolverApi)1 SrvResolverResult (org.minidns.hla.SrvResolverResult)1