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

public class CommandLineSource extends Source
Represents a source that executes an operating system command to retrieve data.
See Also:
  • 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 of OsCommandSource.
      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

      public CommandLineSource copy()
      Copy the current instance
      Specified by:
      copy in class Source
      Returns:
      new CommandLineSource instance
    • update

      public void update(UnaryOperator<String> updater)
      Description copied from class: Source
      Updates the source based on the provided updater function.
      Specified by:
      update in class Source
      Parameters:
      updater - The updater function to modify the source.
    • toString

      public String toString()
      Overrides:
      toString in class Source
    • accept

      public SourceTable accept(ISourceProcessor sourceProcessor)
      Description copied from class: Source
      Accepts a source processor to perform processing on the source.
      Specified by:
      accept in class Source
      Parameters:
      sourceProcessor - The source processor to accept.
      Returns:
      A SourceTable representing the processed source.