}
/**
+ * @see net.pterodactylus.util.fcp.FcpListener#receivedTestDDAComplete(net.pterodactylus.util.fcp.FcpConnection,
+ * net.pterodactylus.util.fcp.TestDDAComplete)
+ */
+ public void receivedTestDDAComplete(FcpConnection fcpConnection, TestDDAComplete testDDAComplete) {
+ /* empty. */
+ }
+
+ /**
* @see net.pterodactylus.util.fcp.FcpListener#receivedMessage(net.pterodactylus.util.fcp.FcpConnection,
* net.pterodactylus.util.fcp.FcpMessage)
*/
}
/**
+ * Notifies all listeners that a “TestDDAComplete” message was received.
+ *
+ * @param testDDAComplete
+ * The “TestDDAComplete” message
+ */
+ private void fireReceivedTestDDAComplete(TestDDAComplete testDDAComplete) {
+ for (FcpListener fcpListener: fcpListeners) {
+ fcpListener.receivedTestDDAComplete(this, testDDAComplete);
+ }
+ }
+
+ /**
* Notifies all registered listeners that a message has been received.
*
* @see FcpListener#receivedMessage(FcpConnection, FcpMessage)
fireReceivedNodeData(new NodeData(fcpMessage));
} else if ("TestDDAReply".equals(messageName)) {
fireReceivedTestDDAReply(new TestDDAReply(fcpMessage));
+ } else if ("TestDDAComplete".equals(messageName)) {
+ fireReceivedTestDDAComplete(new TestDDAComplete(fcpMessage));
} else if ("NodeHello".equals(messageName)) {
fireReceivedNodeHello(new NodeHello(fcpMessage));
} else if ("CloseConnectionDuplicateClientName".equals(messageName)) {
public void receivedTestDDAReply(FcpConnection fcpConnection, TestDDAReply testDDAReply);
/**
+ * Notifies a listener that a “TestDDAComplete” was received.
+ *
+ * @param fcpConnection
+ * The connection that received the message
+ * @param testDDAComplete
+ * The “TestDDAComplete” message
+ */
+ public void receivedTestDDAComplete(FcpConnection fcpConnection, TestDDAComplete testDDAComplete);
+
+ /**
* Notifies a listener that a message has been received. This method is only
* called if {@link FcpConnection#handleMessage(FcpMessage)} does not
* recognize the message. Should that ever happen, please file a bug report!
--- /dev/null
+/**
+ * © 2008 INA Service GmbH
+ */
+package net.pterodactylus.util.fcp;
+
+/**
+ * The “TestDDAComplete” message signals that the node has finished checking
+ * your read and write access to a certain directory.
+ *
+ * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @version $Id$
+ */
+public class TestDDAComplete extends BaseMessage {
+
+ /**
+ * Creates a new “TestDDAComplete” message that wraps the received message.
+ *
+ * @param receivedMessage
+ * The received message
+ */
+ public TestDDAComplete(FcpMessage receivedMessage) {
+ super(receivedMessage);
+ }
+
+ /**
+ * Returns the directory the authorization is given for.
+ *
+ * @return The directory that was tested for read and/or write access
+ */
+ public String getDirectory() {
+ return getField("Directory");
+ }
+
+ /**
+ * Returns whether read access to the directory is allowed.
+ *
+ * @return <code>true</code> if the client is allowed to read from that
+ * directory, <code>false</code> otherwise
+ */
+ public boolean isReadDirectoryAllowed() {
+ return Boolean.valueOf(getField("ReadDirectoryAllowed"));
+ }
+
+ /**
+ * Returns whether write access to the directory is allowed.
+ *
+ * @return <code>true</code> if the client is allowed to write into that
+ * directory, <code>false</code> otherwise
+ */
+ public boolean isWriteDirectoryAllowed() {
+ return Boolean.valueOf(getField("WriteDirectoryAllowed"));
+ }
+
+}