Package net.bluemind.node.api
Class NCUtils
java.lang.Object
net.bluemind.node.api.NCUtils
Helper methods for monitoring tasks running a remote node using
INodeClient
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static ExitList
exec
(INodeClient nc, long delay, TimeUnit unit, String... argv) static ExitList
exec
(INodeClient nc, String... argv) static ExitList
exec
(INodeClient nc, List<String> argv) Waits for a tasks to complete, returning its output.static ExitList
exec
(INodeClient nc, List<String> argv, long delay, TimeUnit unit) The command runs over a websocketstatic void
execNoOut
(INodeClient nc, long delay, TimeUnit unit, String... argv) static void
execNoOut
(INodeClient nc, String... argv) static void
execNoOut
(INodeClient nc, List<String> argv) Waits for a tasks to complete, don't retrieve its output.static void
execNoOut
(INodeClient nc, List<String> argv, long delay, TimeUnit unit) The commands runs over a websocketstatic void
execOrFail
(INodeClient nc, String... argv) static void
execOrFail
(INodeClient nc, List<String> argv) Waits for a tasks to complete, throws ServerFault if task failsstatic void
forget
(INodeClient nc, String... argv) static void
forget
(INodeClient nc, List<String> argv) Spawns a tasks.static ExitList
waitFor
(INodeClient nc, TaskRef ref) Waits for a tasks to complete and returns its output
-
Constructor Details
-
NCUtils
public NCUtils()
-
-
Method Details
-
exec
Waits for a tasks to complete, returning its output.- Parameters:
nc
-cmd
-- Returns:
- the command output
- Throws:
ServerFault
-
exec
- Throws:
ServerFault
-
exec
public static ExitList exec(INodeClient nc, List<String> argv, long delay, TimeUnit unit) throws ServerFault The command runs over a websocket- Parameters:
nc
-delay
-unit
-cmd
-- Returns:
- Throws:
ServerFault
-
exec
public static ExitList exec(INodeClient nc, long delay, TimeUnit unit, String... argv) throws ServerFault - Throws:
ServerFault
-
execNoOut
Waits for a tasks to complete, don't retrieve its output.- Parameters:
nc
-cmd
-- Throws:
ServerFault
-
execNoOut
- Throws:
ServerFault
-
execNoOut
public static void execNoOut(INodeClient nc, List<String> argv, long delay, TimeUnit unit) throws ServerFault The commands runs over a websocket- Parameters:
nc
-delay
-unit
-cmd
-- Throws:
ServerFault
-
execNoOut
public static void execNoOut(INodeClient nc, long delay, TimeUnit unit, String... argv) throws ServerFault - Throws:
ServerFault
-
execOrFail
Waits for a tasks to complete, throws ServerFault if task fails- Parameters:
nc
-cmd
-- Throws:
ServerFault
-
execOrFail
- Throws:
ServerFault
-
forget
Spawns a tasks. Use it when you don't care about the task result or completion.- Parameters:
nc
-cmd
-- Throws:
ServerFault
-
forget
-
waitFor
Waits for a tasks to complete and returns its output- Parameters:
nc
-ref
-- Returns:
- Throws:
ServerFault
-
connectedToMyself
- Throws:
ServerFault
-