public class NexusIndex extends java.lang.Object implements IIndex, IMutableIndex
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DETAILS_DISABLED
Repository index is disabled.
|
static java.lang.String |
DETAILS_FULL
Both artifact and classname indexes are used.
|
static java.lang.String |
DETAILS_MIN
Only artifact index information is used.
|
private java.lang.String |
indexDetails |
private NexusIndexManager |
indexManager |
private IRepository |
repository |
NOT_AVAILABLE, NOT_PRESENT, PRESENT, SEARCH_ALL, SEARCH_ARCHETYPE, SEARCH_ARTIFACT, SEARCH_GROUP, SEARCH_JARS, SEARCH_JAVADOCS, SEARCH_PACKAGING, SEARCH_PARENTS, SEARCH_PLUGIN, SEARCH_SHA1, SEARCH_SOURCES, SEARCH_TESTS
Constructor and Description |
---|
NexusIndex(NexusIndexManager indexManager,
IRepository repository,
java.lang.String indexDetails) |
Modifier and Type | Method and Description |
---|---|
void |
addArtifact(java.io.File pomFile,
ArtifactKey artifactKey) |
private void |
addQueryFromSearchExpressionCollection(org.apache.lucene.search.BooleanQuery.Builder query,
org.apache.maven.index.Field field,
java.util.Collection<SearchExpression> sec) |
java.util.Collection<IndexedArtifact> |
find(java.util.Collection<SearchExpression> groupId,
java.util.Collection<SearchExpression> artifactId,
java.util.Collection<SearchExpression> version,
java.util.Collection<SearchExpression> packaging)
Performs a search for artifacts with given parameters.
|
java.util.Collection<IndexedArtifact> |
find(SearchExpression groupId,
SearchExpression artifactId,
SearchExpression version,
SearchExpression packaging)
Performs a search for artifacts with given parameters.
|
java.lang.String |
getIndexDetails() |
IndexedArtifactFile |
getIndexedArtifactFile(ArtifactKey artifact) |
IRepository |
getRepository() |
java.lang.String |
getRepositoryUrl() |
IndexedArtifactGroup[] |
getRootIndexedArtifactGroups() |
IndexedArtifactFile |
identify(java.io.File file) |
boolean |
isEnabled() |
boolean |
isUpdating() |
void |
removeArtifact(java.io.File pomFile,
ArtifactKey artifactKey) |
void |
scheduleIndexUpdate(boolean force) |
java.util.Map<java.lang.String,IndexedArtifact> |
search(SearchExpression term,
java.lang.String searchType)
Convenience method to search in all indexes enabled for repositories defined in settings.xml.
|
java.util.Map<java.lang.String,IndexedArtifact> |
search(SearchExpression term,
java.lang.String searchType,
int classifier)
Convenience method to search in all indexes enabled for repositories defined in settings.xml.
|
void |
setIndexDetails(java.lang.String details) |
void |
updateIndex(boolean force,
org.eclipse.core.runtime.IProgressMonitor monitor) |
private java.util.Collection<SearchExpression> |
wrapIfNotNull(SearchExpression se)
Method wrapping one SearchExpression into a collection, if it is not null.
|
public static final java.lang.String DETAILS_DISABLED
public static final java.lang.String DETAILS_MIN
public static final java.lang.String DETAILS_FULL
private final NexusIndexManager indexManager
private final IRepository repository
private final java.lang.String indexDetails
NexusIndex(NexusIndexManager indexManager, IRepository repository, java.lang.String indexDetails)
public java.lang.String getRepositoryUrl()
public java.lang.String getIndexDetails()
public void addArtifact(java.io.File pomFile, ArtifactKey artifactKey)
addArtifact
in interface IMutableIndex
public void removeArtifact(java.io.File pomFile, ArtifactKey artifactKey)
removeArtifact
in interface IMutableIndex
public java.util.Collection<IndexedArtifact> find(SearchExpression groupId, SearchExpression artifactId, SearchExpression version, SearchExpression packaging) throws org.eclipse.core.runtime.CoreException
IIndex
private java.util.Collection<SearchExpression> wrapIfNotNull(SearchExpression se)
sex
- public java.util.Collection<IndexedArtifact> find(java.util.Collection<SearchExpression> groupId, java.util.Collection<SearchExpression> artifactId, java.util.Collection<SearchExpression> version, java.util.Collection<SearchExpression> packaging) throws org.eclipse.core.runtime.CoreException
IIndex
IIndex.find(SearchExpression, SearchExpression, SearchExpression, SearchExpression)
, but here you are able
to pass in multiple values for all searches. All elements of collections will form an "OR" of one query.private void addQueryFromSearchExpressionCollection(org.apache.lucene.search.BooleanQuery.Builder query, org.apache.maven.index.Field field, java.util.Collection<SearchExpression> sec)
public IndexedArtifactFile getIndexedArtifactFile(ArtifactKey artifact) throws org.eclipse.core.runtime.CoreException
getIndexedArtifactFile
in interface IIndex
org.eclipse.core.runtime.CoreException
public IndexedArtifactFile identify(java.io.File file) throws org.eclipse.core.runtime.CoreException
public void updateIndex(boolean force, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
updateIndex
in interface IMutableIndex
org.eclipse.core.runtime.CoreException
public void scheduleIndexUpdate(boolean force)
public IndexedArtifactGroup[] getRootIndexedArtifactGroups() throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public boolean isUpdating()
public IRepository getRepository()
public boolean isEnabled()
public void setIndexDetails(java.lang.String details) throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public java.util.Map<java.lang.String,IndexedArtifact> search(SearchExpression term, java.lang.String searchType) throws org.eclipse.core.runtime.CoreException
IIndex
public java.util.Map<java.lang.String,IndexedArtifact> search(SearchExpression term, java.lang.String searchType, int classifier) throws org.eclipse.core.runtime.CoreException
IIndex