KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > fr > jayasoft > ivy > DependencyResolver


1 /*
2  * This file is subject to the license found in LICENCE.TXT in the root directory of the project.
3  *
4  * #SNAPSHOT#
5  */

6 package fr.jayasoft.ivy;
7
8 import java.io.File JavaDoc;
9 import java.io.IOException JavaDoc;
10 import java.text.ParseException JavaDoc;
11 import java.util.Map JavaDoc;
12
13 import fr.jayasoft.ivy.report.DownloadReport;
14 import fr.jayasoft.ivy.resolver.ModuleEntry;
15 import fr.jayasoft.ivy.resolver.OrganisationEntry;
16 import fr.jayasoft.ivy.resolver.RevisionEntry;
17
18 /**
19  * @author x.hanin
20  *
21  */

22 public interface DependencyResolver {
23     String JavaDoc getName();
24     /**
25      * Should only be used by configurator
26      * @param name the new name of the resolver
27      */

28     void setName(String JavaDoc name);
29     /**
30      * Resolve a module by id, getting its module descriptor and
31      * resolving the revision if it's a latest one (i.e. a revision
32      * uniquely identifying the revision of a module in the current environment -
33      * If this revision is not able to identify uniquelely the revision of the module
34      * outside of the current environment, then the resolved revision must begin by ##)
35      * @throws ParseException
36      */

37     ResolvedModuleRevision getDependency(DependencyDescriptor dd, ResolveData data) throws ParseException JavaDoc;
38     DownloadReport download(Artifact[] artifacts, Ivy ivy, File JavaDoc cache, boolean useOrigin);
39     boolean exists(Artifact artifact);
40     void publish(Artifact artifact, File JavaDoc src, boolean overwrite) throws IOException JavaDoc;
41     
42     /**
43      * Reports last resolve failure as Messages
44      */

45     void reportFailure();
46     /**
47      * Reports last artifact download failure as Messages
48      * @param art
49      */

50     void reportFailure(Artifact art);
51     
52     // listing methods, enable to know what is available from this resolver
53
// the listing methods must only list entries directly
54
// available from them, no recursion is needed as long as sub resolvers
55
// are registered in ivy too.
56

57     /**
58      * List all the values the given token can take if other tokens are set
59      * as described in the otherTokenValues map.
60      *
61      * For instance, if token = "revision" and the map contains
62      * "organisation"->"foo"
63      * "module"->"bar"
64      *
65      * The results will be the list of revisions of the module bar from the org foo.
66      */

67     String JavaDoc[] listTokenValues(String JavaDoc token, Map JavaDoc otherTokenValues);
68     
69     OrganisationEntry[] listOrganisations();
70     ModuleEntry[] listModules(OrganisationEntry org);
71     RevisionEntry[] listRevisions(ModuleEntry module);
72     
73     void dumpConfig();
74 }
75
Popular Tags