blob: 14282ec284710f9a82d73833029fadf80d65c46f [file] [log] [blame]
Stuart McCullochd00f9712009-07-13 10:06:47 +00001package aQute.bnd.service;
2
3import java.io.*;
4import java.util.*;
5
6import aQute.lib.osgi.*;
7import aQute.libg.version.*;
8
9public interface RepositoryPlugin {
10 /**
11 * Return a URL to a matching version of the given bundle.
12 *
13 * @param bsn
14 * Bundle-SymbolicName of the searched bundle
15 * @param range
16 * Version range for this bundle,"latest" if you only want the
17 * latest, or null when you want all.
18 * @return A list of URLs sorted on version, lowest version is at index 0.
19 * null is returned when no files with the given bsn ould be found.
20 * @throws Exception
21 * when anything goes wrong
22 */
23 File[] get(String bsn, String range) throws Exception;
24
25 /**
26 * Answer if this repository can be used to store files.
27 *
28 * @return true if writable
29 */
30 boolean canWrite();
31
32 /**
33 * Put a JAR file in the repository.
34 *
35 * @param jar
36 * @throws Exception
37 */
38 File put(Jar jar) throws Exception;
39
40 /**
41 * Return a list of bsns that are present in the repository.
42 *
43 * @param regex if not null, match against the bsn and if matches, return otherwise skip
44 * @return A list of bsns that match the regex parameter or all if regex is null
45 */
46 List<String> list(String regex);
47
48 /**
49 * Return a list of versions.
50 */
51
52 List<Version> versions(String bsn);
53
54 /**
55 * @return The name of the repository
56 */
57 String getName();
58
59}