]> source.dussan.org Git - archiva.git/blob
14aba23e5a013c11111289a29eb4365540aec6b6
[archiva.git] /
1 package org.apache.maven.repository.indexing;
2
3 /*
4  * Copyright 2001-2005 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 import org.apache.maven.artifact.factory.ArtifactFactory;
21 import org.apache.maven.artifact.repository.ArtifactRepository;
22 import org.apache.maven.repository.digest.Digester;
23
24 /**
25  * @author Edwin Punzalan
26  * @plexus.component role="org.apache.maven.repository.indexing.RepositoryIndexingFactory"
27  */
28 public class DefaultRepositoryIndexingFactory
29     implements RepositoryIndexingFactory
30 {
31     /**
32      * @plexus.requirement
33      */
34     private Digester digester;
35
36     /**
37      * @plexus.requirement
38      */
39     private ArtifactFactory artifactFactory;
40
41     /**
42      * @see RepositoryIndexingFactory#createArtifactRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
43      */
44     public ArtifactRepositoryIndex createArtifactRepositoryIndex( String indexPath, ArtifactRepository repository )
45         throws RepositoryIndexException
46     {
47         return new ArtifactRepositoryIndex( indexPath, repository, digester );
48     }
49
50     /**
51      * @see RepositoryIndexingFactory#createPomRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
52      */
53     public PomRepositoryIndex createPomRepositoryIndex( String indexPath, ArtifactRepository repository )
54         throws RepositoryIndexException
55     {
56         return new PomRepositoryIndex( indexPath, repository, digester, artifactFactory );
57     }
58
59     /**
60      * @see RepositoryIndexingFactory#createMetadataRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
61      */
62     public MetadataRepositoryIndex createMetadataRepositoryIndex( String indexPath, ArtifactRepository repository )
63         throws RepositoryIndexException
64     {
65         return new MetadataRepositoryIndex( indexPath, repository );
66     }
67
68     /*
69      * @see RepositoryIndexingFactory#createGeneralRepositoryIndexSearcher(RepositoryIndex)
70      */
71     public GeneralRepositoryIndexSearcher createGeneralRepositoryIndexSearcher( RepositoryIndex index )
72     {
73         return new GeneralRepositoryIndexSearcher( index, artifactFactory );
74     }
75
76     /**
77      * @see RepositoryIndexingFactory#createDefaultRepositoryIndexSearcher(RepositoryIndex)
78      */
79     public DefaultRepositoryIndexSearcher createDefaultRepositoryIndexSearcher( RepositoryIndex index )
80     {
81         return new DefaultRepositoryIndexSearcher( index, artifactFactory );
82     }
83
84 }