Search in sources :

Example 1 with ResolutionUnsuccessfulException

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

the class MiniDnsResolver method getExceptionFrom.

private static ResolutionUnsuccessfulException getExceptionFrom(ResolverResult<?> result) {
    Question question = result.getQuestion();
    RESPONSE_CODE responseCode = result.getResponseCode();
    ResolutionUnsuccessfulException resolutionUnsuccessfulException = new ResolutionUnsuccessfulException(question, responseCode);
    return resolutionUnsuccessfulException;
}
Also used : RESPONSE_CODE(org.minidns.dnsmessage.DnsMessage.RESPONSE_CODE) ResolutionUnsuccessfulException(org.minidns.hla.ResolutionUnsuccessfulException) Question(org.minidns.dnsmessage.Question)

Example 2 with ResolutionUnsuccessfulException

use of org.minidns.hla.ResolutionUnsuccessfulException 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

ResolutionUnsuccessfulException (org.minidns.hla.ResolutionUnsuccessfulException)2 IOException (java.io.IOException)1 RemoteConnectionEndpointLookupFailure (org.jivesoftware.smack.util.rce.RemoteConnectionEndpointLookupFailure)1 RESPONSE_CODE (org.minidns.dnsmessage.DnsMessage.RESPONSE_CODE)1 Question (org.minidns.dnsmessage.Question)1 DnssecResolverApi (org.minidns.hla.DnssecResolverApi)1 ResolverApi (org.minidns.hla.ResolverApi)1 SrvResolverResult (org.minidns.hla.SrvResolverResult)1