final void processAdvertisementPacket(AdvertisementPacket advPkt) { switch (advPkt.getAdvType()) { case ADV: processAdv(advPkt); break; case UNADV: processUnadv(advPkt); break; default: assert false : advPkt.getAdvType(); } }
private final void processAdv(AdvertisementPacket advPkt) { if (!advPkt.containtsSubscriptions()) return; for (Subscription sub : advPkt.getSubscriptions()) { String advSignature = advPkt.getAdvertisement().getSignature(); String subSignature = sub.getSignature(); Collection<String> subSignatures = dependencyGraph.get(advSignature); if (subSignatures == null) { subSignatures = new HashSet<String>(); dependencyGraph.put(advSignature, subSignatures); } subSignatures.add(subSignature); } }