/** * PacketListener implementation.<br/> * Listens for delete requests and adds them to <code>receivedDeleteRequests</code> if a replication * is running. If not, this method does nothing. */ @Override public void packetReceived(CommunicationPacket packet, Destination sender, long receiveTime) { if (packet instanceof DeleteRequest && replicationRunning) { DeleteRequest delRequest = (DeleteRequest)packet; Collection<Hash> dhtKeys = delRequest.getDhtKeys(); // create a DHT key - delete request mapping for each DHT key in the delete request for (Hash dhtKey: dhtKeys) { DeleteRequest indivRequest = delRequest.getIndividualRequest(dhtKey); receivedDeleteRequests.put(dhtKey, indivRequest); } } } }
@Override public String toString() { return super.toString() + " #entries=" + getNumEntries(); } }
DhtStorageHandler storageHandler = storageHandlers.get(delRequest.getDataType()); if (storageHandler instanceof DeletionAwareDhtFolder<?>) ((DeletionAwareDhtFolder<?>)storageHandler).process(delRequest);
@Override public String toString() { return super.toString() + " dhtKey=" + (dhtKey==null?"<null>":dhtKey.toBase64().substring(0, 8)) + "..."; } }