Object FileCommand
-
- All Implemented Interfaces:
public class FileCommand
-
-
Field Summary
Fields Modifier and Type Field Description private final PathCOMMAND_FILEprivate final DurationCHECK_INTERVALprivate final Map<String, Long>LAST_CHECK_TIMEpublic final static FileCommandINSTANCE
-
Method Summary
Modifier and Type Method Description final Pathsubmit(String command)final Booleancheck(String command, Long checkInterval)Check local command file to see if there are pending commands. final Booleancheck(String command, Duration checkInterval, Function0<Unit> action)Check local command file to see if there are pending commands Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only final Booleancheck(String command, Duration checkInterval)Check local command file to see if there are pending commands Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only final Booleancheck(String command)Check local command file to see if there are pending commands Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only final PathgetCOMMAND_FILE()final DurationgetCHECK_INTERVAL()final Map<String, Long>getLAST_CHECK_TIME()-
-
Method Detail
-
submit
@Synchronized() final Path submit(String command)
-
check
@Synchronized() final Boolean check(String command, Long checkInterval)
Check local command file to see if there are pending commands. Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only
- Parameters:
command- Check if the command existscheckInterval- The check interval in seconds- Returns:
true if the command is exists during this check period
-
check
@JvmOverloads()@Synchronized() final Boolean check(String command, Duration checkInterval, Function0<Unit> action)
Check local command file to see if there are pending commands Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only
- Parameters:
command- Check if the command existscheckInterval- The check interval- Returns:
true if the command is exists during this check period
-
check
@JvmOverloads()@Synchronized() final Boolean check(String command, Duration checkInterval)
Check local command file to see if there are pending commands Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only
- Parameters:
command- Check if the command existscheckInterval- The check interval- Returns:
true if the command is exists during this check period
-
check
@JvmOverloads()@Synchronized() final Boolean check(String command)
Check local command file to see if there are pending commands Supported local file commands can be found in AppConstants CMD_* General command options are supported: -perm: the command should be always keep in the file and execute every time the command file is checked, otherwise the command is executed only
- Parameters:
command- Check if the command exists- Returns:
true if the command is exists during this check period
-
getCOMMAND_FILE
final Path getCOMMAND_FILE()
-
getCHECK_INTERVAL
final Duration getCHECK_INTERVAL()
-
getLAST_CHECK_TIME
final Map<String, Long> getLAST_CHECK_TIME()
-
-
-
-