}
/**
+ * @see net.pterodactylus.util.fcp.FcpListener#receivedURIGenerated(net.pterodactylus.util.fcp.FcpConnection,
+ * net.pterodactylus.util.fcp.URIGenerated)
+ */
+ public void receivedURIGenerated(FcpConnection fcpConnection, URIGenerated uriGenerated) {
+ /* empty. */
+ }
+
+ /**
* @see net.pterodactylus.util.fcp.FcpListener#receivedProtocolError(net.pterodactylus.util.fcp.FcpConnection,
* net.pterodactylus.util.fcp.ProtocolError)
*/
}
/**
+ * Notifies all listeners that a “URIGenerated” message was received.
+ *
+ * @param uriGenerated
+ * The “URIGenerated” message
+ */
+ private void fireReceivedURIGenerated(URIGenerated uriGenerated) {
+ for (FcpListener fcpListener: fcpListeners) {
+ fcpListener.receivedURIGenerated(this, uriGenerated);
+ }
+ }
+
+ /**
* Notifies all listeners that a “ProtocolError” message was received.
*
* @param protocolError
fireReceivedProtocolError(new ProtocolError(fcpMessage));
} else if ("PersistentPut".equals(messageName)) {
fireReceivedPersistentPut(new PersistentPut(fcpMessage));
+ } else if ("URIGenerated".equals(messageName)) {
+ fireReceivedURIGenerated(new URIGenerated(fcpMessage));
} else if ("EndListPersistentRequests".equals(messageName)) {
fireReceivedEndListPersistentRequests(new EndListPersistentRequests(fcpMessage));
} else if ("Peer".equals(messageName)) {
public void receivedEndListPersistentRequests(FcpConnection fcpConnection, EndListPersistentRequests endListPersistentRequests);
/**
+ * Notifies a listener that a “URIGenerated” was received.
+ *
+ * @param fcpConnection
+ * The connection that received the message
+ * @param uriGenerated
+ * The “URIGenerated” message
+ */
+ public void receivedURIGenerated(FcpConnection fcpConnection, URIGenerated uriGenerated);
+
+ /**
* Notifies a listener that a “ProtocolError” was received.
*
* @param fcpConnection
--- /dev/null
+/**
+ * © 2008 INA Service GmbH
+ */
+package net.pterodactylus.util.fcp;
+
+/**
+ * The “URIGenerated” message signals the client that an URI was generated for a
+ * {@link ClientPut} (or {@link ClientPutDiskDir} or {@link ClientPutComplexDir})
+ * request.
+ *
+ * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @version $Id$
+ */
+public class URIGenerated extends BaseMessage {
+
+ /**
+ * Creates a new “URIGenerated” message that wraps the received message.
+ *
+ * @param receivedMessage
+ * The received message
+ */
+ public URIGenerated(FcpMessage receivedMessage) {
+ super(receivedMessage);
+ }
+
+ /**
+ * Returns the identifier of the request that generated an URI.
+ *
+ * @return The identifier of the request
+ */
+ public String getIdentifier() {
+ return getField("Identifier");
+ }
+
+ /**
+ * Returns the URI that was generated by the request.
+ *
+ * @return The URI that was generated by the request
+ */
+ public String getURI() {
+ return getField("URI");
+ }
+
+}