@Override
	public synchronized void handlePieceCompleted(SharingPeer peer, Piece piece) {
		// Regardless of validity, record the number of bytes downloaded and
		// mark the piece as not requseted anymore
		this.downloaded += piece.size();
		this.requestedPieces.set(piece.getIndex(), false);

		if (piece.isValid()) {
			logger.trace("Validated download of " + piece + " from " + peer);
			this.markCompleted(piece);
		} else {
			// When invalid, remark that piece as non-requested.
			logger.warn("Downloaded piece " + piece + " was not valid ;-(");
		}

		if (this.isComplete()) {
			try {
				this.bucket.complete();
			} catch (IOException ioe) {
				logger.error("Could not move downloaded file(s) to their " +
					"target location!", ioe);
			}
		}

		logger.trace("We now have " + this.completedPieces.cardinality() +
				" piece(s) and " + this.requestedPieces.cardinality() +
				" outstanding request(s): " + this.requestedPieces + ".");
	}