Package net.bluemind.node.api
Interface INodeClient
- All Known Implementing Classes:
LocalNodeClient
public interface INodeClient
local or remote BM
manipulation API.
invalid reference
Host
-
Method Summary
Modifier and TypeMethodDescriptionvoidasyncExecute(ExecRequest req, ProcessHandler ph) voiddeleteFile(String path) Delete a filedefault TaskRefexecuteCommand(String... argv) executeCommand(List<String> argv) Starts a command in backend and returns a ref to track its progress.Runs a command.default TaskRefexecuteCommandNoOut(String... argv) executeCommandNoOut(List<String> argv) Starts a command in backend and returns a ref to track its progress No output, receive "Done" when command finish.booleanCheck if path existsReturns a list of running process matching the given query object.getExecutionStatus(TaskRef task) Tracks the progress of a taskvoidinterrupt(ExecDescriptor runningTask) List files from path.List files from path matching extension.default voiddefault voidvoidCreate a directory and all required parentsvoidMoves a file from a path, to anotheropenStream(String path) Opens a stream to a (maybe) remote file.voidping()Checks we can connect to a node.byte[]Fetches a file content into ram.voidwriteFile(String path, InputStream content) (Over)writes the file at path with content.
-
Method Details
-
ping
Checks we can connect to a node.- Throws:
ServerFault- if the connection does not work
-
read
Fetches a file content into ram. If the file does not exist, a zero-length byte array is returned.- Parameters:
path-- Returns:
- Throws:
ServerFault
-
exists
Check if path exists- Parameters:
path-- Returns:
-
openStream
Opens a stream to a (maybe) remote file. Use this one when you can't predict the size of the file you want to read. WARNING: If you forget to close this stream, your BM Core will die from out of memory, too many open files, etc sooner or later.- Parameters:
path-- Returns:
- Throws:
ServerFault
-
writeFile
(Over)writes the file at path with content. Content is closed by this method. You don't need to do it in your code.- Parameters:
path-content-- Throws:
ServerFault
-
executeCommand
Starts a command in backend and returns a ref to track its progress. Task return a String list as output.- Parameters:
cmd-- Returns:
- Throws:
ServerFault
-
executeCommand
- Throws:
ServerFault
-
executeCommandNoOut
Starts a command in backend and returns a ref to track its progress No output, receive "Done" when command finish.- Parameters:
cmd-- Returns:
- Throws:
ServerFault
-
executeCommandNoOut
- Throws:
ServerFault
-
getExecutionStatus
Tracks the progress of a task- Parameters:
task-- Returns:
- Throws:
ServerFault
-
listFiles
List files from path matching extension. Task return a list of FileDescription as output- Parameters:
path-extensionPattern-- Returns:
- empty list when the path does not exist
- Throws:
ServerFault
-
listFiles
List files from path. Task return a FileDescription list as output.- Parameters:
path-extensionPattern-- Returns:
- empty list when the path does not exist
- Throws:
ServerFault
-
deleteFile
Delete a file- Parameters:
path-- Throws:
ServerFault
-
moveFile
Moves a file from a path, to another- Parameters:
origin- : Original pathdestination- : Destination path- Throws:
ServerFault
-
mkdirs
Create a directory and all required parents- Parameters:
dst- : directory to createpermissions- : "java" permissions, like: "rwxrwx---", or "rw--------"- Throws:
ServerFault
-
mkdirs
- Throws:
ServerFault
-
mkdirs
- Throws:
ServerFault
-