Interface IArtifactRepositoryManager

    • Field Detail

      • SERVICE_NAME

        static final String SERVICE_NAME
        The name used for obtaining a reference to the metadata repository manager service
      • NO_ARTIFACT_REQUEST

        static final IArtifactRequest[] NO_ARTIFACT_REQUEST
        A convenience constant representing an empty set of artifact requests.
      • TYPE_SIMPLE_REPOSITORY

        static final String TYPE_SIMPLE_REPOSITORY
        Repository type for a simple repository based on a URL or local file system location.
        See Also:
        Constant Field Values
      • TYPE_COMPOSITE_REPOSITORY

        static final String TYPE_COMPOSITE_REPOSITORY
        Repository type for a composite repository based on a URL or local file system location.
        See Also:
        Constant Field Values
    • Method Detail

      • createMirrorRequest

        IArtifactRequest createMirrorRequest​(IArtifactKey key,
                                             IArtifactRepository destination,
                                             Map<String,​String> destinationDescriptorProperties,
                                             Map<String,​String> destinationRepositoryProperties)
        Return a new request to mirror the given artifact into the destination repository.
        Parameters:
        key - the artifact to mirror
        destination - the destination where the artifact will be mirrored
        destinationDescriptorProperties - additional properties for use in creating the repository's ArtifactDescriptor, or null to indicate no additional properties are needed
        destinationRepositoryProperties - additional repository specific properties for use in creating the repositor's ArtifactDescriptor, , or null to indicate no additional properties are needed
        Returns:
        the newly created request object
      • createMirrorRequest

        IArtifactRequest createMirrorRequest​(IArtifactKey key,
                                             IArtifactRepository destination,
                                             Map<String,​String> destinationDescriptorProperties,
                                             Map<String,​String> destinationRepositoryProperties,
                                             String downloadStatsParameters)
        Return a new request to mirror the given artifact into the destination repository.
        Parameters:
        key - the artifact to mirror
        destination - the destination where the artifact will be mirrored
        destinationDescriptorProperties - additional properties for use in creating the repository's ArtifactDescriptor, or null to indicate no additional properties are needed
        destinationRepositoryProperties - additional repository specific properties for use in creating the repositor's ArtifactDescriptor, , or null to indicate no additional properties are needed
        downloadStatsParameters - additional customizable parameters for downloading statistics , or null to indicate no additional customizable stats parameters
        Returns:
        the newly created request object
        Since:
        2.2
        See Also:
        createMirrorRequest(IArtifactKey, IArtifactRepository, Map, Map)
      • createRepository

        IArtifactRepository createRepository​(URI location,
                                             String name,
                                             String type,
                                             Map<String,​String> properties)
                                      throws ProvisionException
        Creates and returns a new empty artifact repository of the given type at the given location.

        The resulting repository is added to the list of repositories tracked by the repository manager. Clients must make a subsequent call to IRepositoryManager.removeRepository(URI) if they do not want the repository manager to remember the repository for subsequent load attempts.

        Parameters:
        location - the absolute location for the new repository
        name - the name of the new repository
        type - the kind of repository to create
        properties - the properties to set on the repository
        Returns:
        the newly created repository
        Throws:
        ProvisionException - if the repository could not be created. Reasons include:
        • The repository type is unknown.
        • There was an error writing to the given repository location.
        • A repository already exists at that location.
      • loadRepository

        IArtifactRepository loadRepository​(URI location,
                                           IProgressMonitor monitor)
                                    throws ProvisionException
        Loads the repository at the given location. The location is expected to contain data that describes a valid artifact repository of a known type. If this manager already knows a repository at the given location then that repository is returned.

        The resulting repository is added to the list of repositories tracked by the repository manager. Clients must make a subsequent call to IRepositoryManager.removeRepository(URI) if they do not want the repository manager to remember the repository for subsequent load attempts.

        Parameters:
        location - the absolute location in which to look for a repository description
        monitor - a progress monitor, or null if progress reporting is not desired
        Returns:
        a repository object for the given location
        Throws:
        ProvisionException - if the repository could not be created. Reasons include:
        • There is no existing repository at that location.
        • The repository at that location could not be read.
      • loadRepository

        IArtifactRepository loadRepository​(URI location,
                                           int flags,
                                           IProgressMonitor monitor)
                                    throws ProvisionException
        Loads the repository at the given location. The location is expected to contain data that describes a valid artifact repository of a known type. If this manager already knows a repository at the given location then that repository is returned.

        The resulting repository is added to the list of repositories tracked by the repository manager. Clients must make a subsequent call to IRepositoryManager.removeRepository(URI) if they do not want the repository manager to remember the repository for subsequent load attempts.

        The flags passed in should be taken as a hint for the type of repository to load. If the manager cannot load a repository that satisfies these hints, it can fail fast.

        Parameters:
        location - the absolute location in which to look for a repository description
        flags - - bit-wise or of flags to consider when loading the repository (currently only IRepositoryManager.REPOSITORY_HINT_MODIFIABLE is supported)
        monitor - a progress monitor, or null if progress reporting is not desired
        Returns:
        a repository object for the given location
        Throws:
        ProvisionException - if the repository could not be created. Reasons include:
        • There is no existing repository at that location.
        • The repository at that location could not be read.
        See Also:
        IRepositoryManager.REPOSITORY_HINT_MODIFIABLE
      • refreshRepository

        IArtifactRepository refreshRepository​(URI location,
                                              IProgressMonitor monitor)
                                       throws ProvisionException
        Refreshes the repository corresponding to the given URL. This method discards any cached state held by the repository manager and reloads the repository contents. The provided repository location must already be known to the repository manager.
        Parameters:
        location - The absolute location of the repository to refresh
        monitor - a progress monitor, or null if progress reporting is not desired
        Returns:
        The refreshed metadata repository
        Throws:
        ProvisionException - if the repository could not be created. Reasons include:
        • The location is not known to the repository manager.
        • There is no existing repository at that location.
        • The repository at that location could not be read.