Class ClientsExecutor

java.lang.Object
org.sentrysoftware.metricshub.engine.client.ClientsExecutor

public class ClientsExecutor extends Object
The ClientsExecutor class provides utility methods for executing various operations through Clients. It includes functionalities for executing computations and running scripts. The execution is done on utilities like AWK, JFlat, TableJoin and XFlat are supported.
  • Constructor Details

    • ClientsExecutor

      public ClientsExecutor()
  • Method Details

    • executeTableJoin

      public List<List<String>> executeTableJoin(List<List<String>> leftTable, List<List<String>> rightTable, int leftKeyColumnNumber, int rightKeyColumnNumber, List<String> defaultRightLine, boolean wbemKeyType, boolean caseInsensitive)
      Execute TableJoin
      Parameters:
      leftTable - The left table.
      rightTable - The right table.
      leftKeyColumnNumber - The column number for the key in the left table.
      rightKeyColumnNumber - The column number for the key in the right table.
      defaultRightLine - The default line for the right table.
      wbemKeyType - true if WBEM.
      caseInsensitive - true for case-insensitive comparison.
      Returns:
      The result of the table join operation.
    • executeAwkScript

      public String executeAwkScript(String embeddedFileScript, String input) throws AwkException
      Call AwkExecutor in order to execute the Awk script on the given input
      Parameters:
      embeddedFileScript - The embedded file script.
      input - The input for the Awk script.
      Returns:
      The result of executing the Awk script.
      Throws:
      AwkException - if an error occurs during Awk script execution.
    • executeJson2Csv

      public String executeJson2Csv(String jsonSource, String jsonEntryKey, List<String> propertyList, String separator) throws InterruptedException, ExecutionException, TimeoutException
      Execute JSON to CSV operation.
      Parameters:
      jsonSource - The JSON source string.
      jsonEntryKey - The JSON entry key.
      propertyList - The list of properties.
      separator - The separator for CSV.
      Returns:
      The CSV representation of the JSON.
      Throws:
      TimeoutException - If the execution times out.
      ExecutionException - If an execution exception occurs.
      InterruptedException - If the execution is interrupted.
    • executeXmlParsing

      public List<List<String>> executeXmlParsing(String xml, String properties, String recordTag) throws org.sentrysoftware.xflat.exceptions.XFlatException
      Parse a XML with the argument properties into a list of values list.
      Parameters:
      xml - The XML.
      properties - A string containing the paths to properties to retrieve separated by a semi-colon character.
      If the property comes from an attribute, it will be preceded by a superior character: '>'.
      recordTag - A string containing the first element xml tags path to convert. example: /rootTag/tag2
      Returns:
      The list of values list.
      Throws:
      org.sentrysoftware.xflat.exceptions.XFlatException - if an error occurred in the XML parsing.