Class CriterionProcessor
java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.detection.CriterionProcessor
The `CriterionProcessor` class is responsible for processing various criteria,
facilitating detection operations related to different aspects such as IPMI, HTTP, SNMP, etc.
This class integrates with ClientsExecutor and TelemetryManager to execute criterion-specific tests and log relevant information. It also utilizes a WqlDetectionHelper for Windows Management Instrumentation (WMI) queries.
The class includes methods for processing different types of criteria, such as IpmiCriterion, HttpCriterion, DeviceTypeCriterion.
-
Constructor Summary
ConstructorsConstructorDescriptionCriterionProcessor(ClientsExecutor clientsExecutor, TelemetryManager telemetryManager, String connectorId, ExtensionManager extensionManager) Constructor for the CriterionProcessor class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisDeviceKindIncluded(List<DeviceKind> deviceKindList, DeviceTypeCriterion deviceTypeCriterion) Return true if the deviceKind in the deviceKindList is included in the DeviceTypeCriterion detection.process(CommandLineCriterion commandLineCriterion) Process the givenCommandLineCriterionthrough Client and return theCriterionTestResultprocess(DeviceTypeCriterion deviceTypeCriterion) Process the givenDeviceTypeCriterionand return theCriterionTestResultprocess(HttpCriterion httpCriterion) Process the givenHttpCriterionthrough Client and return theCriterionTestResultprocess(IpmiCriterion ipmiCriterion) Process the givenIpmiCriterionthrough Client and return theCriterionTestResultprocess(ProcessCriterion processCriterion) Process the givenProcessCriterionthrough Client and return theCriterionTestResultprocess(ProductRequirementsCriterion productRequirementsCriterion) Process the givenProductRequirementsCriterionand return theCriterionTestResult.process(ServiceCriterion serviceCriterion) Process the givenServiceCriterionthrough Client and return theCriterionTestResultprocess(SnmpGetCriterion snmpGetCriterion) Process the givenSnmpGetCriterionthrough Client and return theCriterionTestResultprocess(SnmpGetNextCriterion snmpGetNextCriterion) Process the givenSnmpGetNextCriterionthrough Client and return theCriterionTestResultprocess(SqlCriterion sqlCriterion) Process the givenSqlCriterionthrough Client and return theCriterionTestResultprocess(WbemCriterion wbemCriterion) Process the givenWbemCriterionthrough Client and return theCriterionTestResultprocess(WmiCriterion wmiCriterion) Process the givenWmiCriterionthrough Client and return theCriterionTestResultprocessCriterionThroughExtension(Criterion criterion) Processes the givenCriterionby attempting to find a suitableIProtocolExtensionvia theExtensionManager.Test the given criterion and return the result.
-
Constructor Details
-
CriterionProcessor
public CriterionProcessor(ClientsExecutor clientsExecutor, TelemetryManager telemetryManager, String connectorId, ExtensionManager extensionManager) Constructor for the CriterionProcessor class.- Parameters:
clientsExecutor- The ClientsExecutor instance.telemetryManager- The TelemetryManager instance.connectorId- The connector ID.
-
-
Method Details
-
process
Process the givenDeviceTypeCriterionand return theCriterionTestResult- Parameters:
deviceTypeCriterion- The DeviceTypeCriterion to process.- Returns:
- New
CriterionTestResultinstance.
-
isDeviceKindIncluded
public boolean isDeviceKindIncluded(List<DeviceKind> deviceKindList, DeviceTypeCriterion deviceTypeCriterion) Return true if the deviceKind in the deviceKindList is included in the DeviceTypeCriterion detection.- Parameters:
deviceKindList- The list of DeviceKind values to check.deviceTypeCriterion- The DeviceTypeCriterion for detection.- Returns:
- True if the deviceKind in the deviceKindList is included; otherwise, false.
-
process
Process the givenHttpCriterionthrough Client and return theCriterionTestResult- Parameters:
httpCriterion- The HTTP criterion to process.- Returns:
- New
CriterionTestResultinstance.
-
process
Process the givenIpmiCriterionthrough Client and return theCriterionTestResult- Parameters:
ipmiCriterion- The IPMI criterion to process.- Returns:
- CriterionTestResult instance.
-
process
Process the givenCommandLineCriterionthrough Client and return theCriterionTestResult- Parameters:
commandLineCriterion- TheCommandLineCriterionto process.- Returns:
CriterionTestResultinstance.
-
process
Process the givenProcessCriterionthrough Client and return theCriterionTestResult- Parameters:
processCriterion- TheProcessCriterionto process.- Returns:
CriterionTestResultinstance.
-
process
Process the givenProductRequirementsCriterionand return theCriterionTestResult.- Parameters:
productRequirementsCriterion- TheProductRequirementsCriterionto process.- Returns:
CriterionTestResultinstance.
-
process
Process the givenServiceCriterionthrough Client and return theCriterionTestResult- Parameters:
serviceCriterion- TheServiceCriterionto process.- Returns:
CriterionTestResultinstance.
-
process
Process the givenSnmpGetCriterionthrough Client and return theCriterionTestResult- Parameters:
snmpGetCriterion- The SNMP Get criterion to process.- Returns:
- The result of the criterion test.
-
processCriterionThroughExtension
Processes the givenCriterionby attempting to find a suitableIProtocolExtensionvia theExtensionManager. If an extension is found, it processes the criterion accordingly; otherwise, it returns an emptyCriterionTestResult.- Parameters:
criterion- The criterion to be evaluated.- Returns:
- A
CriterionTestResultcontaining the outcome of the criterion processing, or an empty result if no suitable extension is found.
-
process
Process the givenSnmpGetNextCriterionthrough Client and return theCriterionTestResult- Parameters:
snmpGetNextCriterion- The SNMP GetNext criterion to process.- Returns:
- The result of the criterion test.
-
process
Process the givenWmiCriterionthrough Client and return theCriterionTestResult- Parameters:
wmiCriterion- The WMI criterion to process.- Returns:
- The result of the criterion test processing.
-
process
Process the givenWbemCriterionthrough Client and return theCriterionTestResult- Parameters:
wbemCriterion- The WBEM criterion to process.- Returns:
- The result of the criterion test processing.
-
process
Process the givenSqlCriterionthrough Client and return theCriterionTestResult- Parameters:
sqlCriterion- The SQL criterion to process.- Returns:
- The result of the criterion test processing.
-
test
Test the given criterion and return the result.- Parameters:
criterion- The criterion to test.- Returns:
- The result of the criterion test.
-