This project has retired. For details please refer to its Attic page.
MetadataResolver xref
View Javadoc
1   package org.apache.archiva.metadata.repository;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import org.apache.archiva.metadata.model.ArtifactMetadata;
23  import org.apache.archiva.metadata.model.ProjectVersionMetadata;
24  import org.apache.archiva.metadata.model.ProjectVersionReference;
25  import org.apache.archiva.repository.Repository;
26  import org.apache.archiva.repository.RepositoryType;
27  
28  import java.util.Arrays;
29  import java.util.Collection;
30  import java.util.List;
31  
32  public interface MetadataResolver
33  {
34      default List<RepositoryType> supportsRepositoryTypes() {
35          return Arrays.asList( RepositoryType.MAVEN );
36      }
37  
38      ProjectVersionMetadata resolveProjectVersion( RepositorySession session, String repoId, String namespace,
39                                                    String projectId, String projectVersion )
40          throws MetadataResolutionException;
41  
42      /**
43       * Retrieve project references from the metadata repository. Note that this is not built into the content model for
44       * a project version as a reference may be present (due to reverse-lookup of dependencies) before the actual
45       * project is, and we want to avoid adding a stub model to the content repository.
46       *
47       * @param repoId         the repository ID to look within
48       * @param namespace      the namespace of the project to get references to
49       * @param projectId      the identifier of the project to get references to
50       * @param projectVersion the version of the project to get references to
51       * @return a list of project references
52       */
53      Collection<ProjectVersionReference> resolveProjectReferences( RepositorySession session, String repoId,
54                                                                    String namespace, String projectId,
55                                                                    String projectVersion )
56          throws MetadataResolutionException;
57  
58      Collection<String> resolveRootNamespaces( RepositorySession session, String repoId )
59          throws MetadataResolutionException;
60  
61      Collection<String> resolveNamespaces( RepositorySession session, String repoId, String namespace )
62          throws MetadataResolutionException;
63  
64      Collection<String> resolveProjects( RepositorySession session, String repoId, String namespace )
65          throws MetadataResolutionException;
66  
67      Collection<String> resolveProjectVersions( RepositorySession session, String repoId, String namespace,
68                                                 String projectId )
69          throws MetadataResolutionException;
70  
71      Collection<ArtifactMetadata> resolveArtifacts( RepositorySession session, String repoId, String namespace,
72                                                     String projectId, String projectVersion )
73          throws MetadataResolutionException;
74  }