org.apache.maven.index.creator
Class MinimalArtifactInfoIndexCreator

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.index.creator.AbstractIndexCreator
          extended by org.apache.maven.index.creator.MinimalArtifactInfoIndexCreator
All Implemented Interfaces:
IndexCreator, LegacyDocumentUpdater, org.codehaus.plexus.logging.LogEnabled

@Component(role=IndexCreator.class,
           hint="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 @see MavenArchetypeArtifactInfoIndexCreator).

Author:
cstamas

Field Summary
static IndexerField FLD_ARTIFACT_ID
           
static IndexerField FLD_ARTIFACT_ID_KW
           
static IndexerField FLD_CLASSIFIER
           
static IndexerField FLD_DESCRIPTION
           
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 String ID
           
 
Constructor Summary
MinimalArtifactInfoIndexCreator()
           
 
Method Summary
 Collection<IndexerField> getIndexerFields()
          Returns the indexer fields that this IndexCreator introduces to index.
 void populateArtifactInfo(ArtifactContext ac)
          Populate an ArtifactContext with information about corresponding artifact.
 String toString()
           
 boolean updateArtifactInfo(org.apache.lucene.document.Document doc, ArtifactInfo ai)
          Update an ArtifactInfo from given Lucene Document.
 void updateDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
          Update Lucene Document from a given ArtifactInfo.
 void updateLegacyDocument(ArtifactInfo ai, org.apache.lucene.document.Document doc)
          Update a legacy Lucene Document from the ArtifactInfo.
 
Methods inherited from class org.apache.maven.index.creator.AbstractIndexCreator
bos, getCreatorDependencies, getId, sob
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final 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_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
Constructor Detail

MinimalArtifactInfoIndexCreator

public MinimalArtifactInfoIndexCreator()
Method Detail

populateArtifactInfo

public void populateArtifactInfo(ArtifactContext ac)
Description copied from interface: IndexCreator
Populate an ArtifactContext with information about corresponding artifact.

Specified by:
populateArtifactInfo in interface IndexCreator

updateDocument

public void updateDocument(ArtifactInfo ai,
                           org.apache.lucene.document.Document doc)
Description copied from interface: IndexCreator
Update Lucene Document from a given ArtifactInfo.

Specified by:
updateDocument in interface IndexCreator

updateLegacyDocument

public void updateLegacyDocument(ArtifactInfo ai,
                                 org.apache.lucene.document.Document doc)
Description copied from interface: LegacyDocumentUpdater
Update a legacy Lucene Document from the ArtifactInfo.

Specified by:
updateLegacyDocument in interface LegacyDocumentUpdater

updateArtifactInfo

public boolean updateArtifactInfo(org.apache.lucene.document.Document doc,
                                  ArtifactInfo ai)
Description copied from interface: IndexCreator
Update an ArtifactInfo from given Lucene Document.

Specified by:
updateArtifactInfo in interface IndexCreator
Returns:
true is artifact info has been updated

toString

public String toString()
Overrides:
toString in class Object

getIndexerFields

public Collection<IndexerField> getIndexerFields()
Description copied from interface: IndexCreator
Returns the indexer fields that this IndexCreator introduces to index.

Specified by:
getIndexerFields in interface IndexCreator
Returns:


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.