Class Knowledge


  • public class Knowledge
    extends Object
    A singleton class that manages the discovery and validation of model knowledge from various RegistrationProviders.
    Author:
    Luca Frosini (ISTI - CNR)
    • Field Detail

      • logger

        public static org.slf4j.Logger logger
        The logger for this class.
      • allKnowledge

        protected ModelKnowledge allKnowledge
        The aggregated knowledge from all registered models.
      • modelKnowledges

        protected Map<String,​ModelKnowledge> modelKnowledges
        A map of model knowledge, keyed by model name.
      • registrationProviders

        protected Map<String,​RegistrationProvider> registrationProviders
        A map of registration providers, keyed by model name.
    • Method Detail

      • getInstance

        public static Knowledge getInstance()
                                     throws Exception
        Returns the singleton instance of the Knowledge class.
        Returns:
        The singleton instance.
        Throws:
        Exception - if an error occurs during discovery.
      • getInstance

        public static Knowledge getInstance​(boolean forceRediscover)
                                     throws Exception
        Returns the singleton instance of the Knowledge class, with an option to force re-discovery.
        Parameters:
        forceRediscover - true to force re-discovery of all models.
        Returns:
        The singleton instance.
        Throws:
        Exception - if an error occurs during discovery.
      • getAllKnowledge

        public ModelKnowledge getAllKnowledge()
        Returns the aggregated knowledge from all registered models.
        Returns:
        The ModelKnowledge for all models.
      • getModelKnowledge

        public ModelKnowledge getModelKnowledge​(String modelName)
        Returns the knowledge for a specific model by name.
        Parameters:
        modelName - The name of the model.
        Returns:
        The ModelKnowledge for the specified model.
      • validateModelKnowledge

        public void validateModelKnowledge​(String modelName)
                                    throws Exception
        Validates the discovered knowledge for a specific model by name.
        Parameters:
        modelName - The name of the model to validate.
        Throws:
        Exception - if the validation fails.