Interface IProtocolExtension
public interface IProtocolExtension
Defines the contract for protocol extensions within the system. Protocol extensions are responsible for
executing network queries for data exchange such as HTTP, SNMP, WBEM, WMI, SSH, etc
standards. Implementations of this interface must provide mechanisms to validate configurations, determine
support for specific sources and criteria, perform protocol checks, and execute operations related to sources
and criteria.
-
Method Summary
Modifier and TypeMethodDescriptionbuildConfiguration(String configurationType, com.fasterxml.jackson.databind.JsonNode jsonNode, UnaryOperator<char[]> decrypt) Creates and returns a configuration object of the specified type based on the provided JSON node.checkProtocol(TelemetryManager telemetryManager) Performs a protocol check based on the given telemetry manager and its strategy time.Provides a mapping between configuration classes and their corresponding sets of source classes.
This method must provide a strict mapping between the configuration and the evident source to process.Returns the identifier for protocol extension.Retrieves the set of criterion classes that this extension supports.Retrieves the set of source classes that this extension supports.booleanisSupportedConfigurationType(String configurationType) Whether the configuration type expressed in theconfigurationTypeargument is supported or notbooleanisValidConfiguration(IConfiguration configuration) Checks if the given configuration is valid for this extension.processCriterion(Criterion criterion, String connectorId, TelemetryManager telemetryManager) Executes a criterion check based on the given criterion and configuration within the telemetry manager.processSource(Source source, String connectorId, TelemetryManager telemetryManager) Executes a source operation based on the given source and configuration within the telemetry manager.
-
Method Details
-
isValidConfiguration
Checks if the given configuration is valid for this extension. This method is intended to validate the configuration credentials to ensure they meet the expectations of the specific protocol extension.- Parameters:
configuration- Represents the generic configuration that's used and implemented by various protocol configurations.- Returns:
trueif the configuration is valid, otherwisefalse.
-
getSupportedSources
Retrieves the set of source classes that this extension supports. These sources define the protocol query this extension uses to fetch data.- Returns:
- A set of classes extending
Source, representing the supported sources.
-
getConfigurationToSourceMapping
Provides a mapping between configuration classes and their corresponding sets of source classes.
This method must provide a strict mapping between the configuration and the evident source to process.- Returns:
- A map where the keys are classes extending
IConfigurationrepresenting different types of protocol configurations, and the values are sets of classes extendingSource, indicating the sources that are compatible and can be utilized with each configuration type for data exchange operations.
-
getSupportedCriteria
Retrieves the set of criterion classes that this extension supports. Criteria represent specific conditions or checks that the engine execute to match connectors.- Returns:
- A set of classes extending
Criterion, representing the supported criteria.
-
checkProtocol
Performs a protocol check based on the given telemetry manager and its strategy time. This method is used to verify if a specific protocol or condition is met for the hostname defined by the telemetry manager.- Parameters:
telemetryManager- The telemetry manager to use for monitoring.- Returns:
- Optional.of(true) if the protocol check succeeds, Optional.of(false) otherwise.
-
processSource
Executes a source operation based on the given source and configuration within the telemetry manager.- Parameters:
source- The source to execute.connectorId- The unique identifier of the connector.telemetryManager- The telemetry manager to use for monitoring.- Returns:
- A
SourceTableobject representing the result of the source execution.
-
processCriterion
CriterionTestResult processCriterion(Criterion criterion, String connectorId, TelemetryManager telemetryManager) Executes a criterion check based on the given criterion and configuration within the telemetry manager.- Parameters:
criterion- The criterion to execute.connectorId- The unique identifier of the connector.telemetryManager- The telemetry manager to use for monitoring.- Returns:
- A
CriterionTestResultobject representing the result of the criterion execution.
-
isSupportedConfigurationType
Whether the configuration type expressed in theconfigurationTypeargument is supported or not- Parameters:
configurationType- A string representing the type of configuration to be checked. This type is used to select the appropriate configuration constructor through thebuildConfigurationmethod.- Returns:
trueif the configuration type is supported otherwisefalse.
-
buildConfiguration
IConfiguration buildConfiguration(String configurationType, com.fasterxml.jackson.databind.JsonNode jsonNode, UnaryOperator<char[]> decrypt) throws InvalidConfigurationException Creates and returns a configuration object of the specified type based on the provided JSON node. This method is designed to parse and construct a configuration instance specific to a protocol (e.g., HTTP, SNMP) using the provided JSON structure. If the provided JSON node contains valid data for constructing a configuration, anIConfigurationconfiguration instance is returned. If the JSON node does not contain valid data or if the specified configuration type is not supported, theInvalidConfigurationExceptionshould be thrown.- Parameters:
configurationType- A string representing the type of configuration to be checked. This type is used to select the appropriate configuration constructor. This type should be used when several configurations are managed by the same extension.jsonNode- AJsonNodecontaining the configuration data in JSON format. This data is parsed to construct the configuration object.decrypt- Decrypt function.- Returns:
- An
Optionalcontaining the createdIConfigurationobject if the construction is successful and the JSON data is valid; otherwise, theInvalidConfigurationExceptionshould be thrown. - Throws:
InvalidConfigurationException- if the providedJsonNodeis invalid and cannot be parsed.
-
getIdentifier
String getIdentifier()Returns the identifier for protocol extension.- Returns:
- The protocol identifier as a string.
-