use of org.ow2.proactive.resourcemanager.frontend.topology.TopologyData in project scheduling by ow2-proactive.
the class RMRest method getTopology.
@Override
public TopologyData getTopology(String sessionId) throws NotConnectedException, PermissionRestException {
ResourceManager rm = checkAccess(sessionId);
TopologyImpl topology = (TopologyImpl) orThrowRpe(PAFuture.getFutureValue(rm.getTopology()));
TopologyData topologyData = new TopologyData();
Map<String, Map<String, Long>> distances = mapValues(mapKeys(topology.getDistances(), String::toString), map -> mapKeys(map, String::toString));
topologyData.setDistances(distances);
topologyData.setHosts(mapValues(topology.getHostsMap(), InetAddress::toString));
return topologyData;
}
Aggregations