Package org.apache.maven.index.creator
Class MinimalArtifactInfoIndexCreator
- java.lang.Object
-
- org.apache.maven.index.creator.AbstractIndexCreator
-
- org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator
-
- All Implemented Interfaces:
IndexCreator
,LegacyDocumentUpdater
@Singleton @Named("min") public class MinimalArtifactInfoIndexCreator extends AbstractIndexCreator implements LegacyDocumentUpdater
A minimal index creator used to provide basic information about Maven artifact. This creator will create the index fast, will not open any file to be fastest as possible but it has some drawbacks: The information gathered by this creator are sometimes based on "best-effort" only, and does not reflect the reality (ie. maven archetype packaging @seeMavenArchetypeArtifactInfoIndexCreator
).
-
-
Field Summary
Fields Modifier and Type Field Description static IndexerField
FLD_ARTIFACT_ID
static IndexerField
FLD_ARTIFACT_ID_KW
static IndexerField
FLD_CLASSIFIER
static IndexerField
FLD_DESCRIPTION
static IndexerField
FLD_EXTENSION
static IndexerField
FLD_GROUP_ID
static IndexerField
FLD_GROUP_ID_KW
static IndexerField
FLD_INFO
Info: packaging, lastModified, size, sourcesExists, javadocExists, signatureExists.static IndexerField
FLD_LAST_MODIFIED
static IndexerField
FLD_NAME
static IndexerField
FLD_PACKAGING
static IndexerField
FLD_SHA1
static IndexerField
FLD_VERSION
static IndexerField
FLD_VERSION_KW
static java.lang.String
ID
private Locator
jl
private Locator
sha1l
private Locator
sigl
private Locator
sl
-
Constructor Summary
Constructors Constructor Description MinimalArtifactInfoIndexCreator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
getExtension(java.io.File artifact, Gav gav)
java.util.Collection<IndexerField>
getIndexerFields()
Returns the indexer fields that this IndexCreator introduces to index.void
populateArtifactInfo(ArtifactContext ac)
Populate anArtifactContext
with information about corresponding artifact.java.lang.String
toString()
boolean
updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo ai)
Update anArtifactInfo
from given LuceneDocument
.void
updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Update LuceneDocument
from a givenArtifactInfo
.void
updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Update a legacy LuceneDocument
from theArtifactInfo
.-
Methods inherited from class org.apache.maven.index.creator.AbstractIndexCreator
bos, getCreatorDependencies, getId, getLogger, sob
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
FLD_INFO
public static final IndexerField FLD_INFO
Info: packaging, lastModified, size, sourcesExists, javadocExists, signatureExists. Stored, not indexed.
-
FLD_GROUP_ID_KW
public static final IndexerField FLD_GROUP_ID_KW
-
FLD_GROUP_ID
public static final IndexerField FLD_GROUP_ID
-
FLD_ARTIFACT_ID_KW
public static final IndexerField FLD_ARTIFACT_ID_KW
-
FLD_ARTIFACT_ID
public static final IndexerField FLD_ARTIFACT_ID
-
FLD_VERSION_KW
public static final IndexerField FLD_VERSION_KW
-
FLD_VERSION
public static final IndexerField FLD_VERSION
-
FLD_PACKAGING
public static final IndexerField FLD_PACKAGING
-
FLD_EXTENSION
public static final IndexerField FLD_EXTENSION
-
FLD_CLASSIFIER
public static final IndexerField FLD_CLASSIFIER
-
FLD_NAME
public static final IndexerField FLD_NAME
-
FLD_DESCRIPTION
public static final IndexerField FLD_DESCRIPTION
-
FLD_LAST_MODIFIED
public static final IndexerField FLD_LAST_MODIFIED
-
FLD_SHA1
public static final IndexerField FLD_SHA1
-
jl
private Locator jl
-
sl
private Locator sl
-
sigl
private Locator sigl
-
sha1l
private Locator sha1l
-
-
Method Detail
-
populateArtifactInfo
public void populateArtifactInfo(ArtifactContext ac)
Description copied from interface:IndexCreator
Populate anArtifactContext
with information about corresponding artifact.- Specified by:
populateArtifactInfo
in interfaceIndexCreator
-
getExtension
private java.lang.String getExtension(java.io.File artifact, Gav gav)
-
updateDocument
public void updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:IndexCreator
Update LuceneDocument
from a givenArtifactInfo
.- Specified by:
updateDocument
in interfaceIndexCreator
-
updateLegacyDocument
public void updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
Description copied from interface:LegacyDocumentUpdater
Update a legacy LuceneDocument
from theArtifactInfo
.- Specified by:
updateLegacyDocument
in interfaceLegacyDocumentUpdater
-
updateArtifactInfo
public boolean updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo ai)
Description copied from interface:IndexCreator
Update anArtifactInfo
from given LuceneDocument
.- Specified by:
updateArtifactInfo
in interfaceIndexCreator
- Returns:
- true is artifact info has been updated
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getIndexerFields
public java.util.Collection<IndexerField> getIndexerFields()
Description copied from interface:IndexCreator
Returns the indexer fields that this IndexCreator introduces to index.- Specified by:
getIndexerFields
in interfaceIndexCreator
- Returns:
-
-