Example usage for javax.naming CommunicationException getExplanation

List of usage examples for javax.naming CommunicationException getExplanation

Introduction

In this page you can find the example usage for javax.naming CommunicationException getExplanation.

Prototype

public String getExplanation() 

Source Link

Document

Retrieves the explanation associated with this exception.

Usage

From source file:net.spfbl.core.Reverse.java

public void refresh() {
    long time = System.currentTimeMillis();
    try {/*from   w  ww.j  av a2s .  c  o  m*/
        String reverse;
        if (SubnetIPv4.isValidIPv4(ip)) {
            reverse = getHostReverse(ip, "in-addr.arpa");
        } else if (SubnetIPv6.isValidIPv6(ip)) {
            reverse = getHostReverse(ip, "ip6.arpa");
        } else {
            reverse = null;
        }
        if (reverse != null) {
            TreeSet<String> ptrSet = getPointerSet(reverse);
            this.addressSet = ptrSet;
            Server.logReverseDNS(time, ip, ptrSet.toString());
        }
    } catch (CommunicationException ex) {
        Server.logReverseDNS(time, ip, "TIMEOUT");
    } catch (ServiceUnavailableException ex) {
        Server.logReverseDNS(time, ip, "SERVFAIL");
    } catch (NameNotFoundException ex) {
        this.addressSet = null;
        Server.logReverseDNS(time, ip, "NXDOMAIN");
    } catch (NamingException ex) {
        this.addressSet = null;
        Server.logReverseDNS(time, ip, "ERROR " + ex.getClass() + " " + ex.getExplanation());
    } finally {
        this.queryCount = 0;
        CHANGED = true;
    }
}