Class BaseProcessor


  • public abstract class BaseProcessor
    extends Object
    A base of a processor. It takes care about the existing providers and operators and their invocation. It manages a repository where the resulting artifacts are stored.
    Author:
    burgetr
    • Constructor Detail

      • BaseProcessor

        public BaseProcessor()
        Creates the processor and configures to use a default (in-memory) artifact repository.
      • BaseProcessor

        public BaseProcessor​(ArtifactRepository repository)
        Creates the processor and configures it to use the given artifact repository.
        Parameters:
        repository - the artifact repository to be used by the processor
    • Method Detail

      • createServiceManager

        protected ServiceManager createServiceManager()
        Creates the default instance of service manager.
        Returns:
      • getRepository

        public ArtifactRepository getRepository()
        Gets the currently used artifact repository.
        Returns:
        the artifact repository used
      • setRepository

        public void setRepository​(ArtifactRepository repository)
        Sets the artifact repository to be used.
        Parameters:
        repository -
      • getServiceManager

        public ServiceManager getServiceManager()
        Gets the used instance of service manager for accessing the artifact services.
        Returns:
        a service manager instance
      • setServiceManager

        public void setServiceManager​(ServiceManager serviceManager)
        Configures the processor to use a custom service manager.
        Parameters:
        serviceManager - the service manager to use
      • getArtifactServices

        public Map<String,​ArtifactService> getArtifactServices()
        Gets all the available artifact services used by the processor.
        Returns:
        a map that maps service identifiers to the service implementations.
      • getArtifactProviders

        public Map<String,​ArtifactService> getArtifactProviders​(org.eclipse.rdf4j.model.IRI artifactType)
        Gets the available artifact proiders of the given type used by the processor.
        Parameters:
        artifactType - the type of the artifact
        Returns:
        a map that maps service identifiers to the service implementations.
      • getOperators

        public Map<String,​AreaTreeOperator> getOperators()
        Gets all the available area tree operators used by the processor.
        Returns:
        a map that maps service identifiers to the operator implementations.
      • processArtifact

        public Artifact processArtifact​(Artifact input,
                                        ArtifactService provider,
                                        Map<String,​Object> params)
                                 throws ServiceException
        Processes an input artifact and creates a new artifact by invoking an artifact service and its configuration.
        Parameters:
        input - the input artifact or null if the provider service does not require and input artifact
        provider - the provider service to invoke
        params - the provider service configuration to use
        Returns:
        the new artifact obtained from the provider
        Throws:
        ServiceException