KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > api > client > wfservice > RepositoryMgr


1 package org.enhydra.shark.api.client.wfservice;
2
3
4 import java.util.Map JavaDoc;
5
6 import org.enhydra.shark.api.client.wfbase.BaseException;
7
8 /**
9  * Interface used to manage shark's external repository.
10  * @author Sasa Bojanic
11  * @author Vladimir Puskas
12  */

13 public interface RepositoryMgr {
14
15    /**
16     * This method is used to let shark know who uses this API.
17     *
18     * @param userId String representing user Id.
19     *
20     */

21    void connect (String JavaDoc userId);
22
23    /**
24     * Returns an array of strings representing relative path to XPDL files in
25     * shark's external repository. The file paths are relative to the external
26     * repository folder.
27     *
28     * @return an array of relative paths for XPDLs in external repository.
29     *
30     * @throws BaseException If something unexpected happens.
31     * (wasn't called or authentication failed).
32     *
33     */

34    String JavaDoc[] getPackagePaths () throws BaseException;
35
36    /**
37     * Returns a Map which keys are paths of XPDL files in external repository,
38     * and relative to this repository, and values are the Ids of package defined
39     * within this XPDL files.
40     *
41     * @return Map whose keys are paths of XPDL files in external repository
42     * and values are the Ids of package defined within this XPDL files.
43     *
44     * @throws BaseException If something unexpected happens.
45     * (wasn't called or authentication failed).
46     *
47     */

48    Map JavaDoc getPackagePathToIdMapping () throws BaseException;
49
50    /**
51     * Returns the id of the package defined in XPDL file in external repository.
52     *
53     * @param relativePath path of package file, relative
54     * to the shark's external repository location.
55     * @return id of the package defined in XPDL file in external repository
56     * as String.
57     *
58     * @throws BaseException If something unexpected happens.
59     * (wasn't called or authentication failed).
60     *
61     */

62    String JavaDoc getPackageId(String JavaDoc relativePath) throws BaseException;
63
64    /**
65     * Uploads a package given as a byte array into shark external repository.
66     * It saves it in this repository as a file which path is given by a
67     * second parameter, and is relative to the location of external repository.
68     *
69     * @param pkgContent array of bytes representing XPDL package.
70     * @param relativePath path of newly uploaded package file, relative
71     * to the shark's external repository location.
72     *
73     * @throws BaseException If something unexpected happens.
74     * @throws RepositoryInvalid If package didn't pass shark's validation, and
75     * thus can't be uploaded.
76     *
77     */

78    void uploadPackage (byte[] pkgContent, String JavaDoc relativePath) throws BaseException, RepositoryInvalid;
79
80    /**
81     * Removes a package file, given by the path relative to the shark's
82     * external repository, from the shark's external repository.
83     *
84     * @param relativePath relative path of package file that need to be removed.
85     *
86     * @throws BaseException If something unexpected happens.
87     * @throws RepositoryInvalid If by removing this package, repository could
88     * become invalid (i.e. this package is referenced by some others).
89     *
90     */

91    void deletePackage (String JavaDoc relativePath) throws BaseException, RepositoryInvalid;
92
93 }
94
Popular Tags