Class StatusCli
- java.lang.Object
-
- com.forgerock.opendj.cli.Tool
-
- org.opends.server.tools.status.StatusCli
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public final class StatusCli extends com.forgerock.opendj.cli.ToolA tool which displays a server status.Server status includes an overview of the following server components:
- General (online/offline, host name and admin port, install/instance paths...)
- Running JVM
- Connection handlers
- Replication Server
- Backends
- Base DNs
- Disks usage
The tool can connect to either the local server if the --offline option is provided, (see
StatusCli.LocalServerStatusProvider) or any online server, including the local one (seeStatusCli.RemoteServerStatusProvider).
Information for the components listed above are collected from server configuration and from the monitor backend (i.e by querying cn=monitor whole subtree). Hence, only information collected from configuration are available in the offline mode.By default, server status is printed on the
Toolstandard output with a human readable format. Status can also be printed in JSON format if the -s, --script-friendly option is provided.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisScriptFriendly()Indicates whether the user has requested script-friendly output.static voidmain(String[] args)The main method for the status CLI tool.static intmainStatus(String[] args, PrintStream outStream, PrintStream errStream)Parses the provided command-line arguments and uses that information to run the status tool.com.forgerock.opendj.cli.ReturnCoderun(String... args)Run thisTooltool with the provided arguments.-
Methods inherited from class com.forgerock.opendj.cli.Tool
askPort, close, confirmAction, enableConsoleLoggingIfVerbose, errPrintln, errPrintln, errPrintln, errPrintlnSurroundedByBlankLines, errPrintVerboseMessage, flush, flushLogStream, getErrorStream, getErrStream, getInputStream, getOutputStream, isFullyInteractive, isQuiet, isVerbose, logVerboseMessage, mayPrompt, parseArguments, pressReturnToContinue, print, println, println, println, printlnNoWrap, printlnSurroundedByBlankLines, printNoWrap, readInput, readInput, readInputAllowEmpty, readLineOfInput, readPassword, readValidatedInput, readValidatedInputOrThrow, report
-
-
-
-
Method Detail
-
main
public static void main(String[] args)
The main method for the status CLI tool.- Parameters:
args- The command-line arguments provided to this program.
-
mainStatus
public static int mainStatus(String[] args, PrintStream outStream, PrintStream errStream)
Parses the provided command-line arguments and uses that information to run the status tool.- Parameters:
args- The command-line arguments provided to this program.outStream- The output stream to use for standard output, ornullif standard output is not needed.errStream- The output stream to use for standard error, ornullif standard error is not needed.- Returns:
- The return code.
-
run
public com.forgerock.opendj.cli.ReturnCode run(String... args) throws com.forgerock.opendj.cli.ClientException
Description copied from class:com.forgerock.opendj.cli.ToolRun thisTooltool with the provided arguments. Output and errors will be written on the provided streams.This method can be used to run the tool programmatically.
- Overrides:
runin classcom.forgerock.opendj.cli.Tool- Parameters:
args- Arguments set to pass to the tool.- Returns:
0if all processing completed successfully, or non-zero if an error occurred.- Throws:
com.forgerock.opendj.cli.ClientException- If an error occurs while running the tool.
-
isScriptFriendly
public boolean isScriptFriendly()
Description copied from class:com.forgerock.opendj.cli.ToolIndicates whether the user has requested script-friendly output. The default implementation returnsfalse.- Overrides:
isScriptFriendlyin classcom.forgerock.opendj.cli.Tool- Returns:
trueif the user has requested script-friendly output.
-
-