Class CommandLineSource
java.lang.Object
org.sentrysoftware.metricshub.engine.connector.model.monitor.task.source.Source
org.sentrysoftware.metricshub.engine.connector.model.monitor.task.source.CommandLineSource
- All Implemented Interfaces:
Serializable
Represents a source that executes an operating system command to retrieve data.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCommandLineSource(String type, List<Compute> computes, boolean forceSerialization, @NonNull String commandLine, Long timeout, Boolean executeLocally, String exclude, String keep, Integer beginAtLineNumber, Integer endAtLineNumber, String separators, String selectColumns, String key, ExecuteForEachEntryOf executeForEachEntryOf) Builder for creating instances ofOsCommandSource. -
Method Summary
Modifier and TypeMethodDescriptionaccept(ISourceProcessor sourceProcessor) Accepts a source processor to perform processing on the source.copy()Copy the current instancetoString()voidupdate(UnaryOperator<String> updater) Updates the source based on the provided updater function.Methods inherited from class org.sentrysoftware.metricshub.engine.connector.model.monitor.task.source.Source
getEntryConcatMethod, getExecuteForEachEntryOf, getSleepExecuteForEachEntryOf, isExecuteForEachEntryOf
-
Constructor Details
-
CommandLineSource
public CommandLineSource(String type, List<Compute> computes, boolean forceSerialization, @NonNull @NonNull String commandLine, Long timeout, Boolean executeLocally, String exclude, String keep, Integer beginAtLineNumber, Integer endAtLineNumber, String separators, String selectColumns, String key, ExecuteForEachEntryOf executeForEachEntryOf) Builder for creating instances ofOsCommandSource.- Parameters:
type- The type of the source.computes- List of computations to be applied to the source.forceSerialization- Flag indicating whether to force serialization.commandLine- The command line to execute.timeout- The timeout for executing the command.executeLocally- Flag indicating whether to execute the command locally.exclude- The pattern to exclude lines from the command output.keep- The pattern to keep lines from the command output.beginAtLineNumber- The line number to begin extracting output from.endAtLineNumber- The line number to end extracting output at.separators- The separators for columns in the command output.selectColumns- The columns to select from the command output.key- The key associated with the source.executeForEachEntryOf- The execution context for each entry of the source.
-
-
Method Details
-
copy
Copy the current instance- Specified by:
copyin classSource- Returns:
- new
CommandLineSourceinstance
-
update
Description copied from class:SourceUpdates the source based on the provided updater function. -
toString
-
accept
Description copied from class:SourceAccepts a source processor to perform processing on the source.
-