]> source.dussan.org Git - archiva.git/blob
8d38b715a02cca6724a13f6a3f16828745ff3227
[archiva.git] /
1 package org.apache.maven.repository.indexing;
2
3 /*
4  * Copyright 2005-2006 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  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 import org.apache.maven.artifact.factory.ArtifactFactory;
20 import org.apache.maven.artifact.repository.ArtifactRepository;
21 import org.apache.maven.repository.digest.Digester;
22
23 /**
24  * @author Edwin Punzalan
25  * @plexus.component role="org.apache.maven.repository.indexing.RepositoryIndexingFactory"
26  */
27 public class DefaultRepositoryIndexingFactory
28     implements RepositoryIndexingFactory
29 {
30     /**
31      * @plexus.requirement
32      */
33     private Digester digester;
34
35     /**
36      * @plexus.requirement
37      */
38     private ArtifactFactory artifactFactory;
39
40     /**
41      * @see RepositoryIndexingFactory#createArtifactRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
42      */
43     public ArtifactRepositoryIndex createArtifactRepositoryIndex( String indexPath, ArtifactRepository repository )
44         throws RepositoryIndexException
45     {
46         return new ArtifactRepositoryIndex( indexPath, repository, digester );
47     }
48
49     /**
50      * @see RepositoryIndexingFactory#createPomRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
51      */
52     public PomRepositoryIndex createPomRepositoryIndex( String indexPath, ArtifactRepository repository )
53         throws RepositoryIndexException
54     {
55         return new PomRepositoryIndex( indexPath, repository, digester, artifactFactory );
56     }
57
58     /**
59      * @see RepositoryIndexingFactory#createMetadataRepositoryIndex(String, org.apache.maven.artifact.repository.ArtifactRepository)
60      */
61     public MetadataRepositoryIndex createMetadataRepositoryIndex( String indexPath, ArtifactRepository repository )
62         throws RepositoryIndexException
63     {
64         return new MetadataRepositoryIndex( indexPath, repository );
65     }
66
67     /*
68      * @see RepositoryIndexingFactory#createRepositoryIndexSearchLayer(RepositoryIndex)
69      */
70     public RepositoryIndexSearchLayer createRepositoryIndexSearchLayer( RepositoryIndex index )
71     {
72         return new RepositoryIndexSearchLayer( index, artifactFactory );
73     }
74
75     /**
76      * @see RepositoryIndexingFactory#createDefaultRepositoryIndexSearcher(RepositoryIndex)
77      */
78     public DefaultRepositoryIndexSearcher createDefaultRepositoryIndexSearcher( RepositoryIndex index )
79     {
80         return new DefaultRepositoryIndexSearcher( index, artifactFactory );
81     }
82
83 }