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.Tool
A 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
Tool
standard 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 boolean
isScriptFriendly()
Indicates whether the user has requested script-friendly output.static void
main(String[] args)
The main method for the status CLI tool.static int
mainStatus(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.ReturnCode
run(String... args)
Run thisTool
tool 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, ornull
if standard output is not needed.errStream
- The output stream to use for standard error, ornull
if 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.Tool
Run thisTool
tool 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:
run
in classcom.forgerock.opendj.cli.Tool
- Parameters:
args
- Arguments set to pass to the tool.- Returns:
- The tool
ReturnCode
. - 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.Tool
Indicates whether the user has requested script-friendly output. The default implementation returnsfalse
.- Overrides:
isScriptFriendly
in classcom.forgerock.opendj.cli.Tool
- Returns:
true
if the user has requested script-friendly output.
-
-