Add basic IRC framework.
[xudocci.git] / src / main / java / net / pterodactylus / irc / event / ConnectionFailed.java
diff --git a/src/main/java/net/pterodactylus/irc/event/ConnectionFailed.java b/src/main/java/net/pterodactylus/irc/event/ConnectionFailed.java
new file mode 100644 (file)
index 0000000..9bd57ce
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * XdccDownloader - ConnectionFailed.java - Copyright © 2013 David Roden
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+package net.pterodactylus.irc.event;
+
+import net.pterodactylus.irc.Connection;
+
+/**
+ * Notifies a listener that a connection to an IRC server could not be
+ * established.
+ *
+ * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
+ */
+public class ConnectionFailed extends AbstractConnectionEvent {
+
+       /** The cause of the connection failure. */
+       private final Throwable cause;
+
+       /**
+        * Creates a new connection failure event.
+        *
+        * @param connection
+        *              The connection the event occured on
+        * @param cause
+        *              The cause of the connection failure
+        */
+       public ConnectionFailed(Connection connection, Throwable cause) {
+               super(connection);
+               this.cause = cause;
+       }
+
+       //
+       // ACCESSORS
+       //
+
+       /**
+        * Returns the cause of the connection failure.
+        *
+        * @return The cause of the connection failure
+        */
+       public Throwable cause() {
+               return cause;
+       }
+
+}