Package org.opends.server.tools
Class WaitForFileDelete
- java.lang.Object
-
- com.forgerock.opendj.cli.ConsoleApplication
-
- org.opends.server.tools.WaitForFileDelete
-
public class WaitForFileDelete extends ConsoleApplication
This program provides a simple tool that will wait for a specified file to be deleted before exiting. It can be used in the process of confirming that the server has completed its startup or shutdown process.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.forgerock.opendj.cli.ConsoleApplication
ConsoleApplication.Style
-
-
Field Summary
Fields Modifier and Type Field Description static intEXIT_CODE_INTERNAL_ERRORThe exit code value that will be used if an internal error occurs within this program.static intEXIT_CODE_SUCCESSThe exit code value that will be used if the target file is deleted successfully.static intEXIT_CODE_TIMEOUTThe exit code value that will be used if a timeout occurs while waiting for the file to be removed.
-
Constructor Summary
Constructors Constructor Description WaitForFileDelete(PrintStream out, PrintStream err, InputStream in)Constructor for the WaitForFileDelete object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisAdvancedMode()Indicates whether the user has requested advanced mode.booleanisInteractive()Indicates whether the user has requested interactive behavior.booleanisMenuDrivenMode()Indicates whether this console application is running in its menu-driven mode.booleanisQuiet()Indicates whether the user has requested quiet output.booleanisScriptFriendly()Indicates whether the user has requested script-friendly output.booleanisVerbose()Indicates whether the user has requested verbose output.static voidmain(String[] args)Processes the command-line arguments and initiates the process of waiting for the file to be removed.static intmainCLI(String[] args, boolean initializeServer, OutputStream outStream, OutputStream errStream, InputStream inStream)Processes the command-line arguments and initiates the process of waiting for the file to be removed.-
Methods inherited from class com.forgerock.opendj.cli.ConsoleApplication
askConfirmation, askPort, confirmAction, errPrint, errPrintln, errPrintln, errPrintln, errPrintVerboseMessage, getErrorStream, getErrStream, getInputStream, getOutputStream, pressReturnToContinue, print, println, println, println, println, printlnNoWrap, printProgressBar, printVerboseMessage, readInput, readInput, readLineOfInput, readPassword, readPassword, readPort, readValidatedInput, readValidatedInput
-
-
-
-
Field Detail
-
EXIT_CODE_SUCCESS
public static final int EXIT_CODE_SUCCESS
The exit code value that will be used if the target file is deleted successfully.- See Also:
- Constant Field Values
-
EXIT_CODE_INTERNAL_ERROR
public static final int EXIT_CODE_INTERNAL_ERROR
The exit code value that will be used if an internal error occurs within this program.- See Also:
- Constant Field Values
-
EXIT_CODE_TIMEOUT
public static final int EXIT_CODE_TIMEOUT
The exit code value that will be used if a timeout occurs while waiting for the file to be removed.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WaitForFileDelete
public WaitForFileDelete(PrintStream out, PrintStream err, InputStream in)
Constructor for the WaitForFileDelete object.- Parameters:
out- the print stream to use for standard output.err- the print stream to use for standard error.in- the input stream to use for standard input.
-
-
Method Detail
-
main
public static void main(String[] args)
Processes the command-line arguments and initiates the process of waiting for the file to be removed.- Parameters:
args- The command-line arguments provided to this program.
-
mainCLI
public static int mainCLI(String[] args, boolean initializeServer, OutputStream outStream, OutputStream errStream, InputStream inStream)
Processes the command-line arguments and initiates the process of waiting for the file to be removed.- Parameters:
args- The command-line arguments provided to this program.initializeServer- Indicates whether to initialize the server.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.inStream- The input stream to use for standard input.- Returns:
- The error code.
-
isAdvancedMode
public boolean isAdvancedMode()
Indicates whether the user has requested advanced mode.- Overrides:
isAdvancedModein classConsoleApplication- Returns:
- Returns
trueif the user has requested advanced mode.
-
isInteractive
public boolean isInteractive()
Indicates whether the user has requested interactive behavior. The default implementation returnstrue.- Overrides:
isInteractivein classConsoleApplication- Returns:
trueif the user has requested interactive behavior.
-
isMenuDrivenMode
public boolean isMenuDrivenMode()
Indicates whether this console application is running in its menu-driven mode. This can be used to dictate whether output should go to the error stream or not. In addition, it may also dictate whether sub-menus should display a cancel option as well as a quit option.- Overrides:
isMenuDrivenModein classConsoleApplication- Returns:
- Returns
trueif this console application is running in its menu-driven mode.
-
isQuiet
public boolean isQuiet()
Indicates whether the user has requested quiet output. The default implementation returnsfalse.- Overrides:
isQuietin classConsoleApplication- Returns:
trueif the user has requested quiet output.
-
isScriptFriendly
public boolean isScriptFriendly()
Indicates whether the user has requested script-friendly output. The default implementation returnsfalse.- Overrides:
isScriptFriendlyin classConsoleApplication- Returns:
trueif the user has requested script-friendly output.
-
isVerbose
public boolean isVerbose()
Indicates whether the user has requested verbose output. The default implementation returnsfalse.- Overrides:
isVerbosein classConsoleApplication- Returns:
trueif the user has requested verbose output.
-
-