/** Cancels all companions for a given file. */ private synchronized void cancelCompanions(PnfsId pnfsId, String cause) { for (Companion companion : _companions.values()) { if (pnfsId.equals(companion.getPnfsId())) { companion.cancel(cause); } } }
public synchronized void messageArrived(HttpDoorUrlInfoMessage message) { int sessionId = (int) message.getId(); Companion companion = _companions.get(sessionId); if (companion != null) { companion.messageArrived(message); } else { /* The original p2p is no longer around, but maybe we can use the redirect * for another p2p transfer. */ String pnfsId = message.getPnfsId(); for (Companion c : _companions.values()) { if (c.getPnfsId().equals(pnfsId)) { c.messageArrived(message); return; } } /* TODO: We should kill the mover, but at the moment we don't * know the mover id here. */ } }