Class ChainedLocalRepositoryManager
java.lang.Object
org.eclipse.aether.util.repository.ChainedLocalRepositoryManager
- All Implemented Interfaces:
LocalRepositoryManager
A local repository manager that chains multiple local repository managers: it directs all the write operations
to chain head, while uses tail for
find(RepositorySystemSession, LocalArtifactRequest)
and
find(RepositorySystemSession, LocalMetadataRequest)
methods only. Hence, tail is used in resolving
metadata and artifacts with or without (configurable) artifact availability tracking.
Implementation represents itself using the head local repository manager.
- Since:
- 1.9.2
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
When using chained local repository, should be the artifact availability ignored in tail.static final boolean
-
Constructor Summary
ConstructorDescriptionChainedLocalRepositoryManager
(LocalRepositoryManager head, List<LocalRepositoryManager> tail, boolean ignoreTailAvailability) ChainedLocalRepositoryManager
(LocalRepositoryManager head, List<LocalRepositoryManager> tail, RepositorySystemSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(RepositorySystemSession session, LocalArtifactRegistration request) Registers an installed or resolved artifact with the local repository.void
add
(RepositorySystemSession session, LocalMetadataRegistration request) Registers installed or resolved metadata with the local repository.find
(RepositorySystemSession session, LocalArtifactRequest request) Queries for the existence of an artifact in the local repository.find
(RepositorySystemSession session, LocalMetadataRequest request) Queries for the existence of metadata in the local repository.getPathForLocalArtifact
(Artifact artifact) Gets the relative path for a locally installed artifact.getPathForLocalMetadata
(Metadata metadata) Gets the relative path for locally installed metadata.getPathForRemoteArtifact
(Artifact artifact, RemoteRepository repository, String context) Gets the relative path for an artifact cached from a remote repository.getPathForRemoteMetadata
(Metadata metadata, RemoteRepository repository, String context) Gets the relative path for metadata cached from a remote repository.Gets the description of the local repository being managed.toString()
-
Field Details
-
CONFIG_PROP_IGNORE_TAIL_AVAILABILITY
When using chained local repository, should be the artifact availability ignored in tail.- See Also:
- Sourced from:
RepositorySystemSession.getConfigProperties()
- Value type:
Boolean
- Default value:
DEFAULT_IGNORE_TAIL_AVAILABILITY
-
DEFAULT_IGNORE_TAIL_AVAILABILITY
- See Also:
-
-
Constructor Details
-
ChainedLocalRepositoryManager
public ChainedLocalRepositoryManager(LocalRepositoryManager head, List<LocalRepositoryManager> tail, boolean ignoreTailAvailability) -
ChainedLocalRepositoryManager
public ChainedLocalRepositoryManager(LocalRepositoryManager head, List<LocalRepositoryManager> tail, RepositorySystemSession session)
-
-
Method Details
-
getRepository
Description copied from interface:LocalRepositoryManager
Gets the description of the local repository being managed.- Specified by:
getRepository
in interfaceLocalRepositoryManager
- Returns:
- The description of the local repository, never
null
.
-
getPathForLocalArtifact
Description copied from interface:LocalRepositoryManager
Gets the relative path for a locally installed artifact. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForLocalArtifact
in interfaceLocalRepositoryManager
- Parameters:
artifact
- The artifact for which to determine the path, must not benull
.- Returns:
- The path, relative to the local repository's base directory.
-
getPathForRemoteArtifact
public String getPathForRemoteArtifact(Artifact artifact, RemoteRepository repository, String context) Description copied from interface:LocalRepositoryManager
Gets the relative path for an artifact cached from a remote repository. Note that the artifact need not actually exist yet at the returned location, the path merely indicates where the artifact would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForRemoteArtifact
in interfaceLocalRepositoryManager
- Parameters:
artifact
- The artifact for which to determine the path, must not benull
.repository
- The source repository of the artifact, must not benull
.context
- The resolution context in which the artifact is being requested, may benull
.- Returns:
- The path, relative to the local repository's base directory.
-
getPathForLocalMetadata
Description copied from interface:LocalRepositoryManager
Gets the relative path for locally installed metadata. Note that the metadata need not actually exist yet at the returned location, the path merely indicates where the metadata would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForLocalMetadata
in interfaceLocalRepositoryManager
- Parameters:
metadata
- The metadata for which to determine the path, must not benull
.- Returns:
- The path, relative to the local repository's base directory.
-
getPathForRemoteMetadata
public String getPathForRemoteMetadata(Metadata metadata, RemoteRepository repository, String context) Description copied from interface:LocalRepositoryManager
Gets the relative path for metadata cached from a remote repository. Note that the metadata need not actually exist yet at the returned location, the path merely indicates where the metadata would eventually be stored. The path uses the forward slash as directory separator regardless of the underlying file system.- Specified by:
getPathForRemoteMetadata
in interfaceLocalRepositoryManager
- Parameters:
metadata
- The metadata for which to determine the path, must not benull
.repository
- The source repository of the metadata, must not benull
.context
- The resolution context in which the metadata is being requested, may benull
.- Returns:
- The path, relative to the local repository's base directory.
-
find
Description copied from interface:LocalRepositoryManager
Queries for the existence of an artifact in the local repository. The request could be satisfied by a locally installed artifact or a previously downloaded artifact.- Specified by:
find
in interfaceLocalRepositoryManager
- Parameters:
session
- The repository system session during which the request is made, must not benull
.request
- The artifact request, must not benull
.- Returns:
- The result of the request, never
null
.
-
add
Description copied from interface:LocalRepositoryManager
Registers an installed or resolved artifact with the local repository. Note that artifact registration is merely concerned about updating the local repository's internal state, not about actually installing the artifact or its accompanying metadata.- Specified by:
add
in interfaceLocalRepositoryManager
- Parameters:
session
- The repository system session during which the registration is made, must not benull
.request
- The registration request, must not benull
.
-
find
Description copied from interface:LocalRepositoryManager
Queries for the existence of metadata in the local repository. The request could be satisfied by locally installed or previously downloaded metadata.- Specified by:
find
in interfaceLocalRepositoryManager
- Parameters:
session
- The repository system session during which the request is made, must not benull
.request
- The metadata request, must not benull
.- Returns:
- The result of the request, never
null
.
-
add
Description copied from interface:LocalRepositoryManager
Registers installed or resolved metadata with the local repository. Note that metadata registration is merely concerned about updating the local repository's internal state, not about actually installing the metadata. However, this method MUST be called after the actual install to give the repository manager the opportunity to inspect the added metadata.- Specified by:
add
in interfaceLocalRepositoryManager
- Parameters:
session
- The repository system session during which the registration is made, must not benull
.request
- The registration request, must not benull
.
-
toString
-