# Class AbstractFourLetterCommand

java.lang.Object
org.apache.zookeeper.server.command.AbstractFourLetterCommand

Direct Known Subclasses:
  `CnxnStatResetCommand, ConfCommand, ConsCommand, DigestCommand, DirsCommand, DumpCommand, EnvCommand, IsroCommand, MonitorCommand, NopCommand, RuokCommand, SetTraceMaskCommand, StatCommand, StatResetCommand, TraceMaskCommand, WatchCommand`

public abstract class AbstractFourLetterCommand extends Object
Set of threads for command ports. All the 4 letter commands are run via a thread. Each class maps to a corresponding 4 letter command. CommandThread is the abstract class from which all the others inherit.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected ServerCnxnFactory`
`factory`
`protected PrintWriter`
`pw`
`protected ServerCnxn`
`serverCnxn`
`static final String`
`ZK_NOT_SERVING`
`protected ZooKeeperServer`
`zkServer`

## Constructor Summary

Constructors
Constructor
Description
`AbstractFourLetterCommand(PrintWriter pw, ServerCnxn serverCnxn)`

## Method Summary

Modifier and Type
Method
Description
`abstract void`
`commandRun()`
`void`
`run()`
`void`
`setFactory(ServerCnxnFactory factory)`
`void`
`setZkServer(ZooKeeperServer zkServer)`
`void`
`start()`

### Methods inherited from class Object

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

## Field Details

### ZK_NOT_SERVING

public static final String ZK_NOT_SERVING

See Also:
  - Constant Field Values

### pw

protected PrintWriter pw

### serverCnxn

protected ServerCnxn serverCnxn

### zkServer

protected ZooKeeperServer zkServer

### factory

protected ServerCnxnFactory factory

## Constructor Details

### AbstractFourLetterCommand

public AbstractFourLetterCommand(PrintWriter pw, ServerCnxn serverCnxn)

## Method Details

### start

public void start()

### run

public void run()

### setZkServer

public void setZkServer(ZooKeeperServer zkServer)

### setFactory

public void setFactory(ServerCnxnFactory factory)

### commandRun

public abstract void commandRun() throws IOException

Throws:
  `IOException`