Search in sources :

Example 1 with ProcessStartRequestDto

use of org.eclipse.che.api.machine.shared.dto.execagent.ProcessStartRequestDto in project che by eclipse.

the class JsonRpcExecAgentCommandManager method startProcess.

@Override
public ExecAgentPromise<ProcessStartResponseDto> startProcess(final String endpointId, Command command) {
    String name = command.getName();
    String commandLine = command.getCommandLine();
    String type = command.getType();
    Log.debug(getClass(), "Starting a process. Name: " + name + ", command line: " + commandLine + ", type: " + type);
    ProcessStartRequestDto dto = dtoFactory.createDto(ProcessStartRequestDto.class).withCommandLine(commandLine).withName(name).withType(type);
    final ExecAgentPromise<ProcessStartResponseDto> execAgentPromise = new ExecAgentPromise<>();
    transmitter.transmitOneToOne(endpointId, PROCESS_START, dto, ProcessStartResponseDto.class).then(new Operation<ProcessStartResponseDto>() {

        @Override
        public void apply(ProcessStartResponseDto arg) throws OperationException {
            subscribe(endpointId, execAgentPromise, arg);
        }
    });
    return execAgentPromise;
}
Also used : ProcessStartRequestDto(org.eclipse.che.api.machine.shared.dto.execagent.ProcessStartRequestDto) ProcessStartResponseDto(org.eclipse.che.api.machine.shared.dto.execagent.ProcessStartResponseDto) OperationException(org.eclipse.che.api.promises.client.OperationException)

Aggregations

ProcessStartRequestDto (org.eclipse.che.api.machine.shared.dto.execagent.ProcessStartRequestDto)1 ProcessStartResponseDto (org.eclipse.che.api.machine.shared.dto.execagent.ProcessStartResponseDto)1 OperationException (org.eclipse.che.api.promises.client.OperationException)1