public synchronized void messageArrived(DoorTransferFinishedMessage message) { HttpProtocolInfo pinfo = (HttpProtocolInfo) message.getProtocolInfo(); int sessionId = pinfo.getSessionId(); Companion companion = _companions.get(sessionId); if (companion != null) { companion.messageArrived(message); } }
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. */ PnfsId pnfsId = new 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. */ } }