Class SourceUpdaterProcessor

java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.source.SourceUpdaterProcessor
All Implemented Interfaces:
ISourceProcessor

public class SourceUpdaterProcessor extends Object implements ISourceProcessor
The SourceUpdaterProcessor class is responsible for processing various source types, including HTTP, IPMI, OS command, SNMP, static, table join, table union, WMI, and SNMP table sources. It performs operations such as replacing attribute references, updating source references, and extracting HTTP authentication tokens.
  • Constructor Details

    • SourceUpdaterProcessor

      public SourceUpdaterProcessor()
  • Method Details

    • process

      public SourceTable process(HttpSource httpSource)
      Description copied from interface: ISourceProcessor
      Process the HttpSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      httpSource - The HttpSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(CopySource copySource)
      Description copied from interface: ISourceProcessor
      Process the CopySource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      copySource - The CopySource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(IpmiSource ipmiSource)
      Description copied from interface: ISourceProcessor
      Process the IpmiSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      ipmiSource - The IpmiSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(CommandLineSource commandLineSource)
      Description copied from interface: ISourceProcessor
      Process the CommandLineSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      commandLineSource - The CommandLineSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(SnmpGetSource snmpGetSource)
      Description copied from interface: ISourceProcessor
      Process the SnmpGetSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      snmpGetSource - The SnmpGetSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(SnmpTableSource snmpTableSource)
      Description copied from interface: ISourceProcessor
      Process the SnmpTableSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      snmpTableSource - The SnmpTableSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(StaticSource staticSource)
      Description copied from interface: ISourceProcessor
      Process the StaticSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      staticSource - The StaticSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(TableJoinSource tableJoinSource)
      Description copied from interface: ISourceProcessor
      Process the TableJoinSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      tableJoinSource - The TableJoinSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(TableUnionSource tableUnionSource)
      Description copied from interface: ISourceProcessor
      Process the TableUnionSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      tableUnionSource - The TableUnionSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(WbemSource wbemSource)
      Description copied from interface: ISourceProcessor
      Process the WbemSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      wbemSource - The WbemSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(SqlSource sqlSource)
      Description copied from interface: ISourceProcessor
      Process the SqlSource and return a SourceTable.
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      sqlSource - The SqlSource to process.
      Returns:
      The SourceTable result.
    • process

      public SourceTable process(WmiSource wmiSource)
      This method processes WmiSource source
      Specified by:
      process in interface ISourceProcessor
      Parameters:
      wmiSource - WmiSource instance
      Returns:
      SourceTable instance
    • extractHttpTokenFromSource

      public String extractHttpTokenFromSource(String originalSourceKey, String foreignSourceKey, String fieldLabel)
      Extracts the HTTP authentication token from the specified foreign source identified by foreignSourceKey.
      Parameters:
      originalSourceKey - The original source key for debugging purposes.
      foreignSourceKey - The foreign source key used to extract the token.
      fieldLabel - The field label for debugging purposes.
      Returns:
      The extracted HTTP authentication token.
    • replaceAttributeReferences

      public static String replaceAttributeReferences(String key, Map<String,String> attributes)
      Replace the attribute identifiers referenced in the key with the attribute values that need to be retrieved from the given attributes lookup.
      Parameters:
      key - The key where to replace the deviceId.
      attributes - Key-value pairs of the monitor's attributes
      Returns:
      String value
    • replaceSourceReferenceContent

      public static String replaceSourceReferenceContent(String value, TelemetryManager telemetryManager, String connectorId, String operationType, Object operationKey)
      Replace source reference content in the given value
      Parameters:
      value - The value containing source key such as ${source::monitors.cpu.discovery.sources.source1}
      telemetryManager - The current TelemetryManager instance wrapping the host configuration and the host monitoring instance
      connectorId - The connector's identifier
      operationType - The type of the operation required for debug purpose. E.g. Substring, SnmpGetTableSource, ...
      operationKey - The unique key of the operation used required for debug purpose
      Returns:
      String value
    • rowToCsv

      public static String rowToCsv(List<String> row, String separator)
      Transform the List row to a String representation [a1,b1,c2] => a1,b1,c1
      Parameters:
      row - The row result we wish to parse
      separator - The cells separator on each line
      Returns:
      String value