Search in sources :

Example 1 with TopologyImpl

use of org.ow2.proactive.resourcemanager.frontend.topology.TopologyImpl 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;
}
Also used : TopologyData(org.ow2.proactive.resourcemanager.frontend.topology.TopologyData) ResourceManager(org.ow2.proactive.resourcemanager.frontend.ResourceManager) TopologyImpl(org.ow2.proactive.resourcemanager.frontend.topology.TopologyImpl)

Aggregations

ResourceManager (org.ow2.proactive.resourcemanager.frontend.ResourceManager)1 TopologyData (org.ow2.proactive.resourcemanager.frontend.topology.TopologyData)1 TopologyImpl (org.ow2.proactive.resourcemanager.frontend.topology.TopologyImpl)1