Class AbstractMetadataRepository

    • Constructor Detail

      • AbstractMetadataRepository

        public AbstractMetadataRepository​(IProvisioningAgent agent)
        Creates a new metadata repository that uses the provided agent.
        Parameters:
        agent - the provisioning agent to be used by this repository
      • AbstractMetadataRepository

        protected AbstractMetadataRepository​(IProvisioningAgent agent,
                                             String name,
                                             String type,
                                             String version,
                                             URI location,
                                             String description,
                                             String provider,
                                             Map<String,​String> properties)
        Creates a new metadata repository with the provided repository information
        Parameters:
        agent - the provisioning agent to be used by this repository
        name - the repository name
        type - the repository type
        version - the repository version
        location - the repository location
        description - the repository description
        provider - the repository provider
        properties - the repository properties
    • Method Detail

      • initialize

        public abstract void initialize​(AbstractMetadataRepository.RepositoryState state)
        Initializes this class based on the provided previously persisted state
        Parameters:
        state - the persisted repository state
      • addReferences

        public void addReferences​(Collection<? extends IRepositoryReference> references)
        Description copied from interface: IMetadataRepository

        Adds references to another repository to this repository. When a repository is loaded by IMetadataRepositoryManager, its references are automatically added to the repository manager's set of known repositories.

        Note that this method does not add the contents of the given repositories to this repository, but merely adds the location of other repositories to the metadata of this repository.

        Specified by:
        addReferences in interface IMetadataRepository
        Parameters:
        references - The references to add
      • removeInstallableUnits

        public boolean removeInstallableUnits​(Collection<IInstallableUnit> installableUnits)
        Description copied from interface: IMetadataRepository
        Removes all installable units in the given collection from this repository.
        Specified by:
        removeInstallableUnits in interface IMetadataRepository
        Parameters:
        installableUnits - the installable units to remove
        Returns:
        true if any units were actually removed, and false otherwise
      • executeBatch

        public IStatus executeBatch​(IRunnableWithProgress runnable,
                                    IProgressMonitor monitor)
        Description copied from interface: IMetadataRepository
        Executes a runnable against this repository. It is up to the repository implementor to determine what "batch process" means, for example, it may mean that the repository index is not stored until after the runnable completes. The runnable should not execute anything in a separate thread.
        Specified by:
        executeBatch in interface IMetadataRepository
        Parameters:
        runnable - The runnable to execute
        monitor - A progress monitor that will be passed to the runnable
        Returns:
        The result of running the runnable. Any exceptions thrown during the execution will be returned in the status.