* Checks whether the client is already connected and throws an exception if
* it is not.
*
- * @throws HighLevelException
+ * @throws NotConnectedException
* if the client is not connected
*/
- private void checkConnection() throws HighLevelException {
+ private void checkConnection() throws NotConnectedException {
synchronized (this) {
if (fcpConnection == null) {
- throw new HighLevelException("client is not connected");
+ throw new NotConnectedException("client is not connected");
}
}
}
--- /dev/null
+/**
+ *
+ */
+package net.pterodactylus.fcp.highlevel;
+
+/**
+ * Exception that is thrown when an operation is tried on a not connected
+ * connection.
+ *
+ * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @version $Id$
+ */
+public class NotConnectedException extends HighLevelException {
+
+ /**
+ * Creates a new not-connected exception.
+ */
+ public NotConnectedException() {
+ super();
+ }
+
+ /**
+ * Creates a new not-connected exception with the given message.
+ *
+ * @param message
+ * The message of the exception
+ */
+ public NotConnectedException(String message) {
+ super(message);
+ }
+
+ /**
+ * Creates a new not-connected exception with the given cause.
+ *
+ * @param cause
+ * The cause of the exception
+ */
+ public NotConnectedException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Creates a new not-connected exception with the given message and cause.
+ *
+ * @param message
+ * The message of the exception
+ * @param cause
+ * The cause of the exception
+ */
+ public NotConnectedException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+}