org.apache.ignite.internal.commandline

## Class ClusterStateChangeCommand

- java.lang.Object
- - org.apache.ignite.internal.commandline.ClusterStateChangeCommand

All Implemented Interfaces:
  Command<ClusterState>

    public class ClusterStateChangeCommand
    extends Object
    implements Command<ClusterState>

Command to change cluster state.

### Constructor Summary

Constructors
Constructor and Description
`ClusterStateChangeCommand()`

### Method Summary

All Methods Instance Methods Concrete Methods
`ClusterState` `arg()`
`String` `confirmationPrompt()`
`Object` `execute(GridClientConfiguration clientCfg, Logger log)` Actual command execution.
`String` `name()`
`void` `parseArguments(CommandArgIterator argIter)` Parse command-specific arguments.
`void` `prepareConfirmation(GridClientConfiguration clientCfg)` Prepares confirmation for the command.
`void` `printUsage(Logger log)` Print info for user about command (parameters, use cases and so on).

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.ignite.internal.commandline.Command

`experimental, experimentalEnabled, extendToLen, startClient, usage, usage, usageParams`

### Constructor Detail

#### ClusterStateChangeCommand

    public ClusterStateChangeCommand()

### Method Detail

#### printUsage

    public void printUsage(Logger log)

Print info for user about command (parameters, use cases and so on).

Specified by:
  `printUsage` in interface `Command<ClusterState>`
Parameters:
  `log` - Logger to use.

#### prepareConfirmation

    public void prepareConfirmation(GridClientConfiguration clientCfg)
                             throws Exception

Prepares confirmation for the command.

Specified by:
  `prepareConfirmation` in interface `Command<ClusterState>`
Parameters:
  `clientCfg` - Thin client configuration.
Throws:
  `Exception` - If error occur.

#### confirmationPrompt

    public String confirmationPrompt()

Specified by:
  `confirmationPrompt` in interface `Command<ClusterState>`
Returns:
  Message text to show user for. If null it means that confirmantion is not needed.

#### execute

    public Object execute(GridClientConfiguration clientCfg,
                          Logger log)
                   throws Exception

Actual command execution. Parameters for run should be already set by calling parseArguments method.

Specified by:
  `execute` in interface `Command<ClusterState>`
Parameters:
  `clientCfg` - Thin client configuration if connection to cluster is necessary.
  `log` - Logger to use.
Returns:
  Result of operation (mostly usable for tests).
Throws:
  `Exception` - If error occur.

#### parseArguments

    public void parseArguments(CommandArgIterator argIter)

Parse command-specific arguments.

Specified by:
  `parseArguments` in interface `Command<ClusterState>`
Parameters:
  `argIter` - Argument iterator.

#### arg

    public ClusterState arg()

Specified by:
  `arg` in interface `Command<ClusterState>`
Returns:
  Command arguments which were parsed during `Command.parseArguments(CommandArgIterator)` call.

#### name

    public String name()

Specified by:
  `name` in interface `Command<ClusterState>`
Returns:
  command name.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.9.1
Release Date | : December 9 2020