Class CommandInvoker<A extends IgniteDataTransferObject>
- java.lang.Object
-
- org.apache.ignite.internal.management.api.CommandInvoker<A>
-
public class CommandInvoker<A extends IgniteDataTransferObject> extends Object
Command invoker.
-
-
Constructor Summary
Constructors Constructor Description CommandInvoker(Command<A,?> cmd, A arg, @Nullable IgniteEx ignite)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @Nullable GridClientclient()protected GridClientNodedefaultNode()protected @Nullable IgniteClientigniteClient()<R> Rinvoke(Consumer<String> printer, boolean verbose)Actual command execution with verbose mode if required.booleanprepare(Consumer<String> printer)
-
-
-
Field Detail
-
cmd
protected final Command<A extends IgniteDataTransferObject,?> cmd
Command to execute.
-
arg
protected final A extends IgniteDataTransferObject arg
Parsed argument.
-
-
Method Detail
-
prepare
public boolean prepare(Consumer<String> printer) throws Exception
- Parameters:
printer- Result printer.- Returns:
Trueof command successfully prepared and can be invoked,falseotherwise.- Throws:
GridClientException- If failed.Exception
-
invoke
public <R> R invoke(Consumer<String> printer, boolean verbose) throws Exception
Actual command execution with verbose mode if required.- Parameters:
printer- Result printer.verbose- Use verbose mode or not- Returns:
- Result of operation (mostly usable for tests).
- Throws:
Exception- If failed.
-
defaultNode
protected GridClientNode defaultNode() throws GridClientException
- Returns:
- Default node to execute commands.
- Throws:
GridClientException
-
client
@Nullable protected @Nullable GridClient client() throws GridClientException
- Returns:
- Grid thin client instance which is already connected to cluster.
- Throws:
GridClientException- If failed.
-
igniteClient
@Nullable protected @Nullable IgniteClient igniteClient()
- Returns:
- Ignite client instance.
-
-