@Service(value="archivaIndexManager#maven") public class MavenIndexManager extends Object implements ArchivaIndexManager
DEFAULT_INDEX_PATH, DEFAULT_PACKED_INDEX_PATH
Constructor and Description |
---|
MavenIndexManager() |
Modifier and Type | Method and Description |
---|---|
void |
addArtifactsToIndex(ArchivaIndexingContext context,
Collection<URI> artifactReference)
Adds a list of artifacts to the index.
|
ArchivaIndexingContext |
createContext(Repository repository)
Creates the indexing context for the given repository.
|
static org.apache.maven.index.context.IndexingContext |
getMvnContext(ArchivaIndexingContext context) |
ArchivaIndexingContext |
mergeContexts(Repository destinationRepo,
List<ArchivaIndexingContext> contexts,
boolean packIndex)
Merges a list of contexts into a single one.
|
ArchivaIndexingContext |
move(ArchivaIndexingContext context,
Repository repo)
Moves the context to a new directory.
|
void |
pack(ArchivaIndexingContext context)
Compresses the index to a more dense packed format.
|
void |
removeArtifactsFromIndex(ArchivaIndexingContext context,
Collection<URI> artifactReference)
Removes a list of artifacts from the index.
|
ArchivaIndexingContext |
reset(ArchivaIndexingContext context)
Reinitializes the index.
|
void |
scan(ArchivaIndexingContext context)
Rescans the whole repository, this index is associated to.
|
boolean |
supportsRepository(RepositoryType type)
Returns true, if this manager is able to apply the index actions for the given repository type.
|
void |
update(ArchivaIndexingContext context,
boolean fullUpdate)
Updates the index from the remote url.
|
void |
updateLocalIndexPath(Repository repo)
Updates the local path where the index is stored using the repository information.
|
public MavenIndexManager()
public static org.apache.maven.index.context.IndexingContext getMvnContext(ArchivaIndexingContext context) throws UnsupportedBaseContextException
UnsupportedBaseContextException
public void pack(ArchivaIndexingContext context) throws IndexUpdateFailedException
ArchivaIndexManager
pack
in interface ArchivaIndexManager
IndexUpdateFailedException
public void scan(ArchivaIndexingContext context) throws IndexUpdateFailedException
ArchivaIndexManager
scan
in interface ArchivaIndexManager
IndexUpdateFailedException
public void update(ArchivaIndexingContext context, boolean fullUpdate) throws IndexUpdateFailedException
ArchivaIndexManager
update
in interface ArchivaIndexManager
IndexUpdateFailedException
public void addArtifactsToIndex(ArchivaIndexingContext context, Collection<URI> artifactReference) throws IndexUpdateFailedException
ArchivaIndexManager
addArtifactsToIndex
in interface ArchivaIndexManager
IndexUpdateFailedException
public void removeArtifactsFromIndex(ArchivaIndexingContext context, Collection<URI> artifactReference) throws IndexUpdateFailedException
ArchivaIndexManager
removeArtifactsFromIndex
in interface ArchivaIndexManager
IndexUpdateFailedException
public boolean supportsRepository(RepositoryType type)
ArchivaIndexManager
supportsRepository
in interface ArchivaIndexManager
public ArchivaIndexingContext createContext(Repository repository) throws IndexCreationFailedException
ArchivaIndexManager
createContext
in interface ArchivaIndexManager
repository
- the repository for which the index context should be createdIndexCreationFailedException
public ArchivaIndexingContext reset(ArchivaIndexingContext context) throws IndexUpdateFailedException
ArchivaIndexManager
reset
in interface ArchivaIndexManager
IndexUpdateFailedException
public ArchivaIndexingContext move(ArchivaIndexingContext context, Repository repo) throws IndexCreationFailedException
ArchivaIndexManager
move
in interface ArchivaIndexManager
context
- The current contextrepo
- The repositoryIndexCreationFailedException
public void updateLocalIndexPath(Repository repo)
ArchivaIndexManager
updateLocalIndexPath
in interface ArchivaIndexManager
public ArchivaIndexingContext mergeContexts(Repository destinationRepo, List<ArchivaIndexingContext> contexts, boolean packIndex) throws UnsupportedOperationException, IndexCreationFailedException, IllegalArgumentException
ArchivaIndexManager
mergeContexts
in interface ArchivaIndexManager
destinationRepo
- The destination repositorycontexts
- The contexts of the indexes that should be merged.packIndex
- True, if the merged index should be packed, otherwise false.UnsupportedOperationException
- if the underlying implementation does not allow to merge indexing contextsIndexCreationFailedException
IllegalArgumentException
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.