try {
cartridgeInfo = new CloudControllerServiceImpl().getCartridgeInfo(serviceName);
} catch (UnregisteredCartridgeException e) {
log.error("error while getting the cartridge information when publishing the state changes... ");
} finally {
MemberContext memberContext = FasterLookUpDataHolder.getInstance().getMemberContextOfMemberId(memberId);
//Construct the data to be published
List<Object> payload = new ArrayList<Object>();
// Payload values
payload.add(memberId);
payload.add(serviceName);
payload.add(clusterId);
payload.add(memberContext.getLbClusterId());
payload.add(partitionId);
payload.add(networkId);
if(cartridgeInfo != null) {
payload.add(String.valueOf(cartridgeInfo.isMultiTenant()));
} else {
payload.add("");
}
payload.add(memberContext.getPartition().getProvider());
payload.add(status);
if(metadata != null) {
payload.add(metadata.getHostname());
payload.add(metadata.getHardware().getHypervisor());
payload.add(String.valueOf(metadata.getHardware().getRam()));
payload.add(metadata.getImageId());
payload.add(metadata.getLoginPort());
payload.add(metadata.getOperatingSystem().getName());
payload.add(metadata.getOperatingSystem().getVersion());
payload.add(metadata.getOperatingSystem().getArch());
payload.add(String.valueOf(metadata.getOperatingSystem().is64Bit()));
} else {
payload.add("");
payload.add("");
payload.add("");
payload.add("");
payload.add(0);
payload.add("");
payload.add("");
payload.add("");
payload.add("");
}
payload.add(memberContext.getPrivateIpAddress());
payload.add(memberContext.getPublicIpAddress());
payload.add(memberContext.getAllocatedIpAddress());
Event event = new Event();
event.setPayloadData(payload.toArray());
event.setArbitraryDataMap(new HashMap<String, String>());