Search in sources :

Example 1 with MachineRuntimeInfo

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;
}
Also used : Server(org.eclipse.che.api.core.model.machine.Server) MachineRuntimeInfo(org.eclipse.che.api.core.model.machine.MachineRuntimeInfo) ArrayList(java.util.ArrayList) Map(java.util.Map)

Aggregations

ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 MachineRuntimeInfo (org.eclipse.che.api.core.model.machine.MachineRuntimeInfo)1 Server (org.eclipse.che.api.core.model.machine.Server)1