All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.linuxforhealth.api.InputDataExtractor Maven / Gradle / Ivy

/*
 * (C) Copyright IBM Corp. 2020
 *
 * SPDX-License-Identifier: Apache-2.0
 */
package io.github.linuxforhealth.api;

import java.util.Map;

/**
 * Represents class that encapsulates how to extract information from a particular source.
 * 
 *
 * @author pbhallam
 */
public interface InputDataExtractor {

  /**
   * Extract the single value from the input for the given specification.
   * 
   * @param spec - List of specifications example: PID.3
   * @param contextValues - Map of key value pair
   * @return {@link EvaluationResult}
   */
  EvaluationResult extractValueForSpec(Specification spec,
      Map contextValues);

  /**
   * Extract the multiple values from the input for the given specification.
   * 
   * @param specs - List of specifications example: PID.3
   * @param contextValues - Map of key value pair
   * @return {@link EvaluationResult}
   */
  EvaluationResult extractMultipleValuesForSpec(Specification specs,
      Map contextValues);

  /**
   * Evaluate JEXL Expression that handles extracting data from this data source.
   * 
   * @param expression - example:
   * @param contextValues - Map of key value pair
   * @return {@link EvaluationResult}
   */
  EvaluationResult evaluateJexlExpression(String expression,
      Map contextValues);


  /**
   * Return the name /identifier of this resource Example: for ADT_A01 message, return the message
   * type.
   * 
   * @return String
   */
  String getName();

  /**
   * Return the unique identifier of this resource Example: for a ADT_A01 message, return the
   * message id.
   * 
   * @return String
   */
  String getId();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy