synchronized void gotFinalURI(String identifier, FreenetURI finalURI) {
   UploadRequestStatus status = (UploadRequestStatus) requestsByIdentifier.get(identifier);
   if (status == null) return; // Can happen during cancel etc.
   if (status.getFinalURI() == null)
     // No final URI set yet, put into the index.
     uploadsByFinalURI.put(finalURI, status);
   status.setFinalURI(finalURI);
 }
 synchronized void addUpload(UploadRequestStatus status) {
   RequestStatus old = requestsByIdentifier.put(status.getIdentifier(), status);
   if (old == status) return;
   if (logMINOR) Logger.minor(this, "Starting upload " + status.getIdentifier());
   if (old != null) uploads.remove(old);
   uploads.add(status);
   FreenetURI uri = status.getURI();
   if (uri != null) uploadsByFinalURI.put(uri, status);
 }
 synchronized void finishedUpload(
     String identifier,
     boolean success,
     FreenetURI finalURI,
     InsertExceptionMode failureCode,
     String failureReasonShort,
     String failureReasonLong) {
   UploadRequestStatus status = (UploadRequestStatus) requestsByIdentifier.get(identifier);
   if (status == null) return; // Can happen during cancel etc.
   if (status.getFinalURI() == null && finalURI != null)
     // No final URI set yet, put into the index.
     uploadsByFinalURI.put(finalURI, status);
   status.setFinished(success, finalURI, failureCode, failureReasonShort, failureReasonLong);
 }