You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ep...@apache.org on 2006/06/15 12:50:19 UTC
svn commit: r414549 -
/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/
Author: epunzalan
Date: Thu Jun 15 03:50:19 2006
New Revision: 414549
URL: http://svn.apache.org/viewvc?rev=414549&view=rev
Log:
Updated some javadocs
Modified:
maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java
maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java
maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java
maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java
maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java
Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java?rev=414549&r1=414548&r2=414549&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/AbstractRepositoryIndex.java Thu Jun 15 03:50:19 2006
@@ -200,6 +200,9 @@
deleteDocuments( Collections.singletonList( term ) );
}
+ /**
+ * @see RepositoryIndex#deleteDocuments(java.util.List)
+ */
public void deleteDocuments( List termList )
throws RepositoryIndexException, IOException
{
@@ -228,11 +231,7 @@
}
/**
- * Opens the lucene index and add all the lucene documents inside the list into the index.
- * Closes the index at the end.
- *
- * @param docList List of Lucene Documents
- * @throws RepositoryIndexException when an error occurred during the indexing of the documents
+ * @see RepositoryIndex#addDocuments(java.util.List)
*/
public void addDocuments( List docList )
throws RepositoryIndexException
Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java?rev=414549&r1=414548&r2=414549&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/ArtifactRepositoryIndex.java Thu Jun 15 03:50:19 2006
@@ -62,24 +62,12 @@
}
/**
- * Checks if the artifact has already been indexed and deletes it if it is.
+ * Indexes the artifacts found within the specified list. Deletes existing indices for the same artifacts first,
+ * before proceeding on adding them into the index.
*
- * @param artifact the object to be indexed.
+ * @param artifactList
* @throws RepositoryIndexException
*/
- private void deleteIfIndexed( Artifact artifact )
- throws RepositoryIndexException
- {
- try
- {
- deleteDocument( FLD_ID, ARTIFACT + ":" + artifact.getId() );
- }
- catch ( IOException e )
- {
- throw new RepositoryIndexException( "Failed to delete a document", e );
- }
- }
-
public void indexArtifacts( List artifactList )
throws RepositoryIndexException
{
@@ -95,6 +83,12 @@
addDocuments( getDocumentList( artifactList ) );
}
+ /**
+ * Creates a list of Lucene Term object used in index deletion
+ *
+ * @param artifactList
+ * @return List of Term object
+ */
private List getTermList( List artifactList )
{
List list = new ArrayList();
@@ -109,6 +103,13 @@
return list;
}
+ /**
+ * Creates a list of Lucene documents, used for index additions
+ *
+ * @param artifactList
+ * @return
+ * @throws RepositoryIndexException
+ */
private List getDocumentList( List artifactList )
throws RepositoryIndexException
{
@@ -136,6 +137,13 @@
indexArtifacts( Collections.singletonList( artifact ) );
}
+ /**
+ * Creates a Lucene Document from an artifact; used for index additions
+ *
+ * @param artifact
+ * @return
+ * @throws RepositoryIndexException
+ */
private Document createDocument( Artifact artifact )
throws RepositoryIndexException
{
Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java?rev=414549&r1=414548&r2=414549&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/EclipseRepositoryIndex.java Thu Jun 15 03:50:19 2006
@@ -88,6 +88,12 @@
return new EclipseIndexAnalyzer( new SimpleAnalyzer() );
}
+ /**
+ * Indexes the artifacts inside the provided list
+ *
+ * @param artifactList
+ * @throws RepositoryIndexException
+ */
public void indexArtifacts( List artifactList )
throws RepositoryIndexException
{
@@ -124,6 +130,13 @@
}
}
+ /**
+ * Creates a Lucene Document from an artifact; used for index additions
+ *
+ * @param artifact
+ * @return
+ * @throws RepositoryIndexException
+ */
private Document createDocument( Artifact artifact )
throws RepositoryIndexException
{
Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java?rev=414549&r1=414548&r2=414549&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/MetadataRepositoryIndex.java Thu Jun 15 03:50:19 2006
@@ -51,7 +51,7 @@
}
/**
- * Index the contents of the specified RepositoryMetadata paramter object
+ * Index the contents of the specified RepositoryMetadata parameter object
*
* @param repoMetadata the metadata object to be indexed
* @throws RepositoryIndexException
@@ -62,6 +62,13 @@
indexMetadata( Collections.singletonList( repoMetadata ) );
}
+ /**
+ * Index the metadata found within the provided list. Deletes existing entries in the index first before
+ * proceeding with the index additions.
+ *
+ * @param metadataList
+ * @throws RepositoryIndexException
+ */
public void indexMetadata( List metadataList )
throws RepositoryIndexException
{
@@ -77,6 +84,12 @@
addDocuments( getDocumentList( metadataList ) );
}
+ /**
+ * Creates a list of Lucene Term object used in index deletion
+ *
+ * @param metadataList
+ * @return List of Term object
+ */
private List getTermList( List metadataList )
{
List terms = new ArrayList();
@@ -91,6 +104,12 @@
return terms;
}
+ /**
+ * Creates a list of Lucene documents
+ *
+ * @param metadataList
+ * @return List of Lucene Documents
+ */
private List getDocumentList( List metadataList )
{
List docs = new ArrayList();
@@ -105,6 +124,12 @@
return docs;
}
+ /**
+ * Creates a Lucene Document from a RepositoryMetadata; used for index additions
+ *
+ * @param repoMetadata
+ * @return Lucene Document
+ */
private Document createDocument( RepositoryMetadata repoMetadata )
{
//get lastUpdated from Versioning (specified in Metadata object)
@@ -171,18 +196,5 @@
doc.add( Field.Keyword( FLD_PLUGINS_REPORT, "" ) );
doc.add( Field.Keyword( FLD_PLUGINS_ALL, "" ) );
return doc;
- }
-
- private void deleteIfIndexed( RepositoryMetadata repoMetadata )
- throws RepositoryIndexException
- {
- try
- {
- deleteDocument( FLD_ID, (String) repoMetadata.getKey() );
- }
- catch ( IOException e )
- {
- throw new RepositoryIndexException( "Failed to delete document", e );
- }
}
}
Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java?rev=414549&r1=414548&r2=414549&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/PomRepositoryIndex.java Thu Jun 15 03:50:19 2006
@@ -68,19 +68,6 @@
this.artifactFactory = artifactFactory;
}
- private void deleteIfIndexed( Model pom )
- throws RepositoryIndexException
- {
- try
- {
- deleteDocument( FLD_ID, POM + ":" + pom.getId() );
- }
- catch ( IOException e )
- {
- throw new RepositoryIndexException( "Failed to delete document", e );
- }
- }
-
/**
* Method to create the index fields for a Model object into the index
*
@@ -93,6 +80,12 @@
indexPoms( Collections.singletonList( pom ) );
}
+ /**
+ * Index the Models within the supplied List. Deletes existing index values before adding them to the list.
+ *
+ * @param pomList
+ * @throws RepositoryIndexException
+ */
public void indexPoms( List pomList )
throws RepositoryIndexException
{
@@ -108,6 +101,12 @@
addDocuments( getDocumentList( pomList ) );
}
+ /**
+ * Creates a list of Lucene Term object used in index deletion
+ *
+ * @param pomList
+ * @return List of Term object
+ */
private List getTermList( List pomList )
{
List terms = new ArrayList();
@@ -122,6 +121,13 @@
return terms;
}
+ /**
+ * Creates a list of Lucene documents
+ *
+ * @param pomList
+ * @return
+ * @throws RepositoryIndexException
+ */
private List getDocumentList( List pomList )
throws RepositoryIndexException
{
@@ -137,6 +143,13 @@
return docs;
}
+ /**
+ * Creates a Lucene Document from a Model; used for index additions
+ *
+ * @param pom
+ * @return
+ * @throws RepositoryIndexException
+ */
private Document createDocument( Model pom )
throws RepositoryIndexException
{
Modified: maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java
URL: http://svn.apache.org/viewvc/maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java?rev=414549&r1=414548&r2=414549&view=diff
==============================================================================
--- maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java (original)
+++ maven/repository-manager/trunk/maven-repository-indexer/src/main/java/org/apache/maven/repository/indexing/RepositoryIndex.java Thu Jun 15 03:50:19 2006
@@ -120,9 +120,23 @@
public void validate()
throws RepositoryIndexException, IOException;
+ /**
+ * Opens the lucene index and add all the lucene documents inside the list into the index.
+ * Closes the index at the end.
+ *
+ * @param docList List of Lucene Documents
+ * @throws RepositoryIndexException when an error occurred during the indexing of the documents
+ */
public void addDocuments( List docList )
throws RepositoryIndexException;
+ /**
+ * Delete from the index matching the list of lucene Terms
+ *
+ * @param termList List of Lucene Term
+ * @throws RepositoryIndexException
+ * @throws IOException
+ */
public void deleteDocuments( List termList )
throws RepositoryIndexException, IOException;
}