/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.vertx.reactivex.ext.shell.system;

import io.vertx.reactivex.RxHelper;
import io.vertx.reactivex.ObservableHelper;
import io.vertx.reactivex.FlowableHelper;
import io.vertx.reactivex.impl.AsyncResultMaybe;
import io.vertx.reactivex.impl.AsyncResultSingle;
import io.vertx.reactivex.impl.AsyncResultCompletable;
import io.vertx.reactivex.WriteStreamObserver;
import io.vertx.reactivex.WriteStreamSubscriber;
import java.util.Map;
import java.util.Set;
import java.util.List;
import java.util.Iterator;
import java.util.function.Function;
import java.util.stream.Collectors;
import io.vertx.core.Handler;
import io.vertx.core.AsyncResult;
import io.vertx.core.json.JsonObject;
import io.vertx.core.json.JsonArray;
import io.vertx.lang.rx.RxGen;
import io.vertx.lang.rx.TypeArg;
import io.vertx.lang.rx.MappingIterator;

A process managed by the shell.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * A process managed by the shell. * * <p/> * NOTE: This class has been automatically generated from the {@link io.vertx.ext.shell.system.Process original} non RX-ified interface using Vert.x codegen. */
@RxGen(io.vertx.ext.shell.system.Process.class) public class Process { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Process that = (Process) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final TypeArg<Process> __TYPE_ARG = new TypeArg<>( obj -> new Process((io.vertx.ext.shell.system.Process) obj), Process::getDelegate ); private final io.vertx.ext.shell.system.Process delegate; public Process(io.vertx.ext.shell.system.Process delegate) { this.delegate = delegate; } public Process(Object delegate) { this.delegate = (io.vertx.ext.shell.system.Process)delegate; } public io.vertx.ext.shell.system.Process getDelegate() { return delegate; }
Returns:the current process status
/** * @return the current process status */
public io.vertx.ext.shell.system.ExecStatus status() { io.vertx.ext.shell.system.ExecStatus ret = delegate.status(); return ret; }
Returns:the process exit code when the status is otherwise null
/** * @return the process exit code when the status is otherwise <code>null</code> */
public Integer exitCode() { Integer ret = delegate.exitCode(); return ret; }
Set the process tty.
Params:
  • tty – the process tty
Returns:this object
/** * Set the process tty. * @param tty the process tty * @return this object */
public io.vertx.reactivex.ext.shell.system.Process setTty(io.vertx.reactivex.ext.shell.term.Tty tty) { delegate.setTty(tty.getDelegate()); return this; }
Returns:the process tty
/** * @return the process tty */
public io.vertx.reactivex.ext.shell.term.Tty getTty() { if (cached_0 != null) { return cached_0; } io.vertx.reactivex.ext.shell.term.Tty ret = io.vertx.reactivex.ext.shell.term.Tty.newInstance((io.vertx.ext.shell.term.Tty)delegate.getTty()); cached_0 = ret; return ret; }
Set the process session
Params:
  • session – the process session
Returns:this object
/** * Set the process session * @param session the process session * @return this object */
public io.vertx.reactivex.ext.shell.system.Process setSession(io.vertx.reactivex.ext.shell.session.Session session) { delegate.setSession(session.getDelegate()); return this; }
Returns:the process session
/** * @return the process session */
public io.vertx.reactivex.ext.shell.session.Session getSession() { if (cached_1 != null) { return cached_1; } io.vertx.reactivex.ext.shell.session.Session ret = io.vertx.reactivex.ext.shell.session.Session.newInstance((io.vertx.ext.shell.session.Session)delegate.getSession()); cached_1 = ret; return ret; }
Set an handler for being notified when the process terminates.
Params:
  • handler – the handler called when the process terminates.
Returns:this object
/** * Set an handler for being notified when the process terminates. * @param handler the handler called when the process terminates. * @return this object */
public io.vertx.reactivex.ext.shell.system.Process terminatedHandler(Handler<Integer> handler) { delegate.terminatedHandler(handler); return this; }
Run the process.
/** * Run the process. * */
public void run() { delegate.run(); }
Run the process.
Params:
  • foregraound –
/** * Run the process. * * @param foregraound */
public void run(boolean foregraound) { delegate.run(foregraound); }
Attempt to interrupt the process.
Returns:true if the process caught the signal
/** * Attempt to interrupt the process. * @return true if the process caught the signal */
public boolean interrupt() { boolean ret = delegate.interrupt(); return ret; }
Attempt to interrupt the process.
Params:
  • completionHandler – handler called after interrupt callback
Returns:true if the process caught the signal
/** * Attempt to interrupt the process. * @param completionHandler handler called after interrupt callback * @return true if the process caught the signal */
public boolean interrupt(Handler<Void> completionHandler) { boolean ret = delegate.interrupt(completionHandler); return ret; }
Suspend the process.
/** * Suspend the process. */
public void resume() { delegate.resume(); }
Suspend the process.
Params:
  • foreground –
/** * Suspend the process. * @param foreground */
public void resume(boolean foreground) { delegate.resume(foreground); }
Suspend the process.
Params:
  • completionHandler – handler called after resume callback
/** * Suspend the process. * @param completionHandler handler called after resume callback */
public void resume(Handler<Void> completionHandler) { delegate.resume(completionHandler); }
Suspend the process.
Params:
  • foreground –
  • completionHandler – handler called after resume callback
/** * Suspend the process. * @param foreground * @param completionHandler handler called after resume callback */
public void resume(boolean foreground, Handler<Void> completionHandler) { delegate.resume(foreground, completionHandler); }
Resume the process.
/** * Resume the process. */
public void suspend() { delegate.suspend(); }
Resume the process.
Params:
  • completionHandler – handler called after suspend callback
/** * Resume the process. * @param completionHandler handler called after suspend callback */
public void suspend(Handler<Void> completionHandler) { delegate.suspend(completionHandler); }
Terminate the process.
/** * Terminate the process. */
public void terminate() { delegate.terminate(); }
Terminate the process.
Params:
  • completionHandler – handler called after end callback
/** * Terminate the process. * @param completionHandler handler called after end callback */
public void terminate(Handler<Void> completionHandler) { delegate.terminate(completionHandler); }
Set the process in background.
/** * Set the process in background. */
public void toBackground() { delegate.toBackground(); }
Set the process in background.
Params:
  • completionHandler – handler called after background callback
/** * Set the process in background. * @param completionHandler handler called after background callback */
public void toBackground(Handler<Void> completionHandler) { delegate.toBackground(completionHandler); }
Set the process in foreground.
/** * Set the process in foreground. */
public void toForeground() { delegate.toForeground(); }
Set the process in foreground.
Params:
  • completionHandler – handler called after foreground callback
/** * Set the process in foreground. * @param completionHandler handler called after foreground callback */
public void toForeground(Handler<Void> completionHandler) { delegate.toForeground(completionHandler); } private io.vertx.reactivex.ext.shell.term.Tty cached_0; private io.vertx.reactivex.ext.shell.session.Session cached_1; public static Process newInstance(io.vertx.ext.shell.system.Process arg) { return arg != null ? new Process(arg) : null; } }