View Javadoc

1   /*
2    * REPOWEB, repository manager.
3    *
4    * Terms of license - http://opensource.org/licenses/apachepl.php
5    */
6   package org.repoweb.model;
7   import org.repoweb.pom.Project;
8   
9   /***
10   * A Maven repository.
11   */
12  public interface Repository {
13      /***
14       * Get alll groups of this repository.
15       *
16       * @return List of groups.
17       */
18      public GroupList getAllGroups();
19  
20  
21      /***
22       * Get a group from this repository.
23       *
24       * @param groupId group Id.
25       *
26       * @return One group.
27       *
28       * @exception org.repoweb.model.UnknownGroupIdException group Id does not exist in
29       *            the repo.
30       */
31      public Group getGroup(String groupId) throws UnknownGroupIdException;
32  
33  
34      /***
35       * Get one Artifact.
36       *
37       * @param groupId Group Id of the artifact (e.g. 'junit')
38       * @param typeId Artifact type (e.g. 'jar')
39       * @param filename Artifact file name (e.g. 'junit-3.8.1.jar')
40       *
41       * @return an Artifact.
42       * @exception org.repoweb.model.UnknownArtifactException artifact do not exist in
43       *            the repo.
44       */
45      public Artifact getArtifact(String groupId, String typeId, String filename)
46          throws UnknownArtifactException;
47  
48  
49      /***
50       * Search groups that have a groupId that match pattern.
51       *
52       * @param pattern pattern for search
53       *
54       * @return List of groups.
55       */
56      public GroupList findGroups(String pattern);
57  
58  
59      /***
60       * Search for Artifacts.
61       *
62       * @param groupId Group Id of the artifact (e.g. 'junit')
63       * @param typeId Artifact type (e.g. 'jar')
64       * @param filename Artifact file name (e.g. 'junit-3.8.1.jar')
65       *
66       * @return an Artifact.
67       */
68      public ArtifactList findArtifacts(String groupId, String typeId, String filename);
69  
70  
71      /***
72       * Search Artifacts that contains a class.
73       *
74       * @param fullClassName full qualified class name
75       *
76       * @return List of artifacts containing the searched class.
77       */
78      public ArtifactList findArtifactByClass(String fullClassName);
79  
80  
81      /***
82       * Build a new POM in the repository.
83       * @param project the bean of the POM.
84       * @throws BuildFailureException Failed to build the POM.
85       * @return the Artifact that represent the POM.
86       */
87      public Artifact buildPom(Project project) throws BuildFailureException;
88  }