Search in sources :

Example 1 with WorkspaceRuntime

use of org.eclipse.che.api.core.model.workspace.WorkspaceRuntime in project che by eclipse.

the class ProcessesPanelPresenter method getMachines.

private List<MachineEntity> getMachines(Workspace workspace) {
    WorkspaceRuntime workspaceRuntime = workspace.getRuntime();
    if (workspaceRuntime == null) {
        return emptyList();
    }
    List<? extends Machine> runtimeMachines = workspaceRuntime.getMachines();
    List<MachineEntity> machines = new ArrayList<>(runtimeMachines.size());
    for (Machine machine : runtimeMachines) {
        if (machine instanceof MachineDto) {
            MachineEntity machineEntity = entityFactory.createMachine((MachineDto) machine);
            machines.add(machineEntity);
        }
    }
    return machines;
}
Also used : MachineEntity(org.eclipse.che.ide.api.machine.MachineEntity) MachineDto(org.eclipse.che.api.machine.shared.dto.MachineDto) WorkspaceRuntime(org.eclipse.che.api.core.model.workspace.WorkspaceRuntime) ArrayList(java.util.ArrayList) ExtendedMachine(org.eclipse.che.api.core.model.workspace.ExtendedMachine) Machine(org.eclipse.che.api.core.model.machine.Machine)

Example 2 with WorkspaceRuntime

use of org.eclipse.che.api.core.model.workspace.WorkspaceRuntime in project che by eclipse.

the class WorkspaceEventsHandler method getDevMachineName.

private String getDevMachineName(final WorkspaceDto workspace) {
    WorkspaceRuntime runtime = workspace.getRuntime();
    if (runtime == null) {
        return null;
    }
    String activeEnv = runtime.getActiveEnv();
    EnvironmentDto environment = workspace.getConfig().getEnvironments().get(activeEnv);
    if (environment != null) {
        return Utils.getDevMachineName(environment);
    }
    // if no machine with ws-agent found
    return null;
}
Also used : EnvironmentDto(org.eclipse.che.api.workspace.shared.dto.EnvironmentDto) WorkspaceRuntime(org.eclipse.che.api.core.model.workspace.WorkspaceRuntime)

Example 3 with WorkspaceRuntime

use of org.eclipse.che.api.core.model.workspace.WorkspaceRuntime in project che by eclipse.

the class SelectCommandComboBox method getMachines.

private List<MachineEntity> getMachines(Workspace workspace) {
    WorkspaceRuntime workspaceRuntime = workspace.getRuntime();
    if (workspaceRuntime == null) {
        return emptyList();
    }
    List<? extends Machine> runtimeMachines = workspaceRuntime.getMachines();
    List<MachineEntity> machines = new ArrayList<>(runtimeMachines.size());
    for (Machine machine : runtimeMachines) {
        if (machine instanceof MachineDto) {
            MachineEntity machineEntity = entityFactory.createMachine((MachineDto) machine);
            machines.add(machineEntity);
        }
    }
    return machines;
}
Also used : MachineEntity(org.eclipse.che.ide.api.machine.MachineEntity) MachineDto(org.eclipse.che.api.machine.shared.dto.MachineDto) WorkspaceRuntime(org.eclipse.che.api.core.model.workspace.WorkspaceRuntime) ArrayList(java.util.ArrayList) Machine(org.eclipse.che.api.core.model.machine.Machine)

Example 4 with WorkspaceRuntime

use of org.eclipse.che.api.core.model.workspace.WorkspaceRuntime in project che by eclipse.

the class MachinePanelPresenter method getMachines.

private List<MachineEntity> getMachines(Workspace workspace) {
    WorkspaceRuntime workspaceRuntime = workspace.getRuntime();
    if (workspaceRuntime == null) {
        return emptyList();
    }
    List<? extends Machine> runtimeMachines = workspaceRuntime.getMachines();
    List<MachineEntity> machines = new ArrayList<>(runtimeMachines.size());
    for (Machine machine : runtimeMachines) {
        if (machine instanceof MachineDto) {
            MachineEntity machineEntity = entityFactory.createMachine((MachineDto) machine);
            machines.add(machineEntity);
        }
    }
    return machines;
}
Also used : MachineEntity(org.eclipse.che.ide.api.machine.MachineEntity) MachineDto(org.eclipse.che.api.machine.shared.dto.MachineDto) WorkspaceRuntime(org.eclipse.che.api.core.model.workspace.WorkspaceRuntime) ArrayList(java.util.ArrayList) Machine(org.eclipse.che.api.core.model.machine.Machine)

Aggregations

WorkspaceRuntime (org.eclipse.che.api.core.model.workspace.WorkspaceRuntime)4 ArrayList (java.util.ArrayList)3 Machine (org.eclipse.che.api.core.model.machine.Machine)3 MachineDto (org.eclipse.che.api.machine.shared.dto.MachineDto)3 MachineEntity (org.eclipse.che.ide.api.machine.MachineEntity)3 ExtendedMachine (org.eclipse.che.api.core.model.workspace.ExtendedMachine)1 EnvironmentDto (org.eclipse.che.api.workspace.shared.dto.EnvironmentDto)1