@Override public AmqpServiceInfo createServiceInfo(Process process) { ActualLRPResponse actual = process.getFirstActual(); String address = actual.getAddress(); int port = actual.getPorts()[0].getHostPort(); String username = "******"; String password = "******"; String virtualHost = null; return new LatticeAmqpServiceInfo( actual.getInstanceGuid(), address, port, username, password, virtualHost); }
private void refreshActualLRPs(List<DesiredLRPResponse> dlrps) { List<ActualLRPResponse> lrps = getReceptor().getActualLRPs(); Multimap<String, ActualLRPResponse> byProcessGuid = ArrayListMultimap.create(); for (ActualLRPResponse lrp : lrps) { byProcessGuid.put(lrp.getProcessGuid(), lrp); } for (DesiredLRPResponse dlrp : dlrps) { String processGuid = dlrp.getProcessGuid(); Collection<ActualLRPResponse> alrps = byProcessGuid.get(processGuid); LatticeBootDashElement el = getElementFor(processGuid); if (el != null) { el.setActualLrps(alrps); } } }