use of org.eclipse.che.api.core.model.machine.MachineRuntimeInfo in project che by eclipse.
the class ServerPresenter method getServers.
private List<ServerEntity> getServers(Machine machine) {
MachineRuntimeInfo machineRuntime = machine.getRuntime();
if (machineRuntime == null) {
return emptyList();
}
Map<String, ? extends Server> servers = machineRuntime.getServers();
List<ServerEntity> serversList = new ArrayList<>(servers.size());
for (Map.Entry<String, ? extends Server> entry : servers.entrySet()) {
String exposedPort = entry.getKey();
Server descriptor = entry.getValue();
ServerEntity serverEntity = entityFactory.createServer(exposedPort, descriptor);
serversList.add(serverEntity);
}
return serversList;
}
Aggregations