Class AbstractArtifactRepository

    • Constructor Detail

      • AbstractArtifactRepository

        protected AbstractArtifactRepository​(IProvisioningAgent agent,
                                             java.lang.String name,
                                             java.lang.String type,
                                             java.lang.String version,
                                             java.net.URI location,
                                             java.lang.String description,
                                             java.lang.String provider,
                                             java.util.Map<java.lang.String,​java.lang.String> properties)
    • Method Detail

      • contains

        public abstract boolean contains​(IArtifactDescriptor descriptor)
        Description copied from interface: IArtifactRepository
        Returns true if this repository contains the given descriptor.
        Specified by:
        contains in interface IArtifactRepository
        Parameters:
        descriptor - the descriptor to query
        Returns:
        true if the given descriptor is already in this repository
      • contains

        public abstract boolean contains​(IArtifactKey key)
        Description copied from interface: IArtifactRepository
        Returns true if this repository contains the given artifact key.
        Specified by:
        contains in interface IArtifactRepository
        Parameters:
        key - the key to query
        Returns:
        true if the given key is already in this repository
      • getArtifact

        public abstract IStatus getArtifact​(IArtifactDescriptor descriptor,
                                            java.io.OutputStream destination,
                                            IProgressMonitor monitor)
        Description copied from interface: IArtifactRepository
        Writes to the given output stream the bytes represented by the artifact descriptor. Any processing steps defined by the descriptor will be applied to the artifact bytes before they are sent to the provided output stream.
        Specified by:
        getArtifact in interface IArtifactRepository
        Parameters:
        descriptor - the descriptor to transfer
        destination - the stream to write the final artifact output to
        monitor - a progress monitor, or null if progress reporting and cancellation are not desired
        Returns:
        the result of the artifact transfer
      • getArtifactDescriptors

        public abstract IArtifactDescriptor[] getArtifactDescriptors​(IArtifactKey key)
        Description copied from interface: IArtifactRepository
        Return the set of artifact descriptors describing the ways that this repository can supply the artifact associated with the given artifact key
        Specified by:
        getArtifactDescriptors in interface IArtifactRepository
        Parameters:
        key - the artifact key to lookup
        Returns:
        the descriptors associated with the given key
      • getArtifacts

        public abstract IStatus getArtifacts​(IArtifactRequest[] requests,
                                             IProgressMonitor monitor)
        Description copied from interface: IArtifactRepository
        Executes the given artifact requests on this byte server.
        Specified by:
        getArtifacts in interface IArtifactRepository
        Parameters:
        requests - The artifact requests
        monitor - A progress monitor use to track progress and cancel the operation.
        Returns:
        a status object that is OK if requests were processed successfully. Otherwise, a status indicating information, warnings, or errors that occurred while executing the artifact requests
      • addDescriptor

        public void addDescriptor​(IArtifactDescriptor descriptor,
                                  IProgressMonitor monitor)
        Description copied from interface: IArtifactRepository
        Add the given descriptor to the set of descriptors in this repository. This is a relatively low-level operation that should be used only when the actual related content is in this repository and the given descriptor accurately describes that content.
        Specified by:
        addDescriptor in interface IArtifactRepository
        Parameters:
        descriptor - the descriptor to add.
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • addDescriptors

        public void addDescriptors​(IArtifactDescriptor[] descriptors,
                                   IProgressMonitor monitor)
        Add the given artifact descriptors to this repository
        Specified by:
        addDescriptors in interface IArtifactRepository
        Parameters:
        descriptors - the artifact descriptors to add
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • removeDescriptor

        public void removeDescriptor​(IArtifactDescriptor descriptor,
                                     IProgressMonitor monitor)
        Remove the given descriptor and its corresponding content in this repository.
        Specified by:
        removeDescriptor in interface IArtifactRepository
        Parameters:
        descriptor - the descriptor to remove.
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • removeDescriptors

        public void removeDescriptors​(IArtifactDescriptor[] descriptors,
                                      IProgressMonitor monitor)
        Remove the given list of artifact descriptors and their corresponding content in this repository.
        Specified by:
        removeDescriptors in interface IArtifactRepository
        Parameters:
        descriptors - the list of descriptors to remove
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • removeDescriptor

        public void removeDescriptor​(IArtifactKey key,
                                     IProgressMonitor monitor)
        Remove the given key and all related content and descriptors from this repository.
        Specified by:
        removeDescriptor in interface IArtifactRepository
        Parameters:
        key - the key to remove.
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • removeDescriptors

        public void removeDescriptors​(IArtifactKey[] keys,
                                      IProgressMonitor monitor)
        Remove the given list of keys and all related content and descriptors from this repository.
        Specified by:
        removeDescriptors in interface IArtifactRepository
        Parameters:
        keys - The keys to remove.
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • removeAll

        public void removeAll​(IProgressMonitor monitor)
        Description copied from interface: IArtifactRepository
        Remove the all keys, descriptors, and contents from this repository.
        Specified by:
        removeAll in interface IArtifactRepository
        Parameters:
        monitor - A progress monitor use to track progress and cancel the operation. This may be a long running operation if another process holds the lock on this location
        Since:
        2.1
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • createArtifactKey

        public IArtifactKey createArtifactKey​(java.lang.String classifier,
                                              java.lang.String id,
                                              Version version)
        Description copied from interface: IArtifactRepository
        Create an instance of IArtifactKey
        Specified by:
        createArtifactKey in interface IArtifactRepository
        Parameters:
        classifier - The classifier for this artifact key.
        id - The id for this artifact key.
        version - The version for this artifact key.
        Returns:
        a new IArtifactKey
      • executeBatch

        public IStatus executeBatch​(IRunnableWithProgress runnable,
                                    IProgressMonitor monitor)
        Description copied from interface: IArtifactRepository
        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 IArtifactRepository
        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.