From 46f4a553e03d990873950370a4cf71286f8b51c2 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 17 Jun 2014 11:00:05 +0200 Subject: [PATCH] Add javadoc to SmackException.ConnectionException and HostAddress --- .../main/java/org/jivesoftware/smack/SmackException.java | 6 ++++++ .../org/jivesoftware/smack/util/dns/HostAddress.java | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java b/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java index 33f89e927..61aea2c98 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/SmackException.java @@ -122,6 +122,12 @@ public class SmackException extends Exception { } } + /** + * ConnectionException is thrown if Smack is unable to connect to all hosts of a given XMPP + * service. The failed hosts can be retrieved with + * {@link ConnectionException#getFailedAddresses()}, which will have the exception causing the + * connection failure set and retrievable with {@link HostAddress#getException()}. + */ public static class ConnectionException extends SmackException { /** diff --git a/smack-core/src/main/java/org/jivesoftware/smack/util/dns/HostAddress.java b/smack-core/src/main/java/org/jivesoftware/smack/util/dns/HostAddress.java index 7f55db598..9b34239e5 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/util/dns/HostAddress.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/util/dns/HostAddress.java @@ -16,6 +16,8 @@ */ package org.jivesoftware.smack.util.dns; +import org.jivesoftware.smack.SmackException.ConnectionException; + public class HostAddress { private final String fqdn; private final int port; @@ -66,6 +68,13 @@ public class HostAddress { this.exception = e; } + /** + * Retrieve the Exception that caused a connection failure to this HostAddress. Every + * HostAddress found in {@link ConnectionException} will have an Exception set, + * which can be retrieved with this method. + * + * @return the Exception causing this HostAddress to fail + */ public Exception getException() { return this.exception; }