KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.api.client.wfservice;
2
3 import org.enhydra.shark.api.client.wfbase.BaseException;
4
5 import org.enhydra.shark.api.client.wfmodel.*;
6 import org.enhydra.shark.api.SharkTransaction;
7
8 /**
9  * Interface used to actually connect to shark engine, and to perform some
10  * administrative operations or to retrieve a WfResource object related
11  * to connected user, so it can perform its tasks.
12  * <p> The first method to be called by client application is the first method
13  * of this interface - connect(), and only if user authentication is OK,
14  * other methods can be used (otherwise, every method throws NotConnected
15  * exception).
16  *
17  * @author Sasa Bojanic
18  * @author Vladimir Puskas
19  */

20 public interface SharkConnection {
21
22    /**
23     * This is the first method to be called in order to communicate with the
24     * engine. If the login parameters are correct, user can use other
25     * methods of this interface to communicate with shark engine,
26     * and if not, he can't do anything.
27     *
28     * @param userId user id String.
29     * @param password user password.
30     * @param engineName engine name.
31     * @param scope scope.
32     *
33     * @throws BaseException If something unexpected happens.
34     * @throws ConnectFailed If authentication parameters are not correct.
35     *
36     */

37    void connect (String JavaDoc userId, String JavaDoc password,String JavaDoc engineName,String JavaDoc scope) throws BaseException, ConnectFailed;
38
39    /**
40     * This is the first method to be called in order to communicate with
41     * engine. If the login parameters are correct, user can use other
42     * methods of this interface to communicate with shark engine,
43     * and if not, he can't do anything.
44     *
45     * @param t SharkTransaction.
46     * @param userId user id String.
47     * @param password user password.
48     * @param engineName engine name.
49     * @param scope scope.
50     *
51     * @throws BaseException If something unexpected happens.
52     * @throws ConnectFailed If authentication parameters are not correct.
53     *
54     */

55    void connect (SharkTransaction t,String JavaDoc userId, String JavaDoc password,String JavaDoc engineName,String JavaDoc scope) throws BaseException, ConnectFailed;
56
57    /**
58     * Disconnects from shark engine.
59     *
60     * @throws BaseException If something unexpected happens.
61     * @throws NotConnected If user wasn't connected (the connect()
62     * wasn't called or authentication failed).
63     *
64     */

65    void disconnect () throws BaseException, NotConnected;
66
67    /**
68     * Disconnects from shark engine.
69     *
70     * @param t SharkTransaction.
71     * @throws BaseException If something unexpected happens.
72     * @throws NotConnected If user wasn't connected (the connect()
73     * wasn't called or authentication failed).
74     *
75     */

76    void disconnect (SharkTransaction t) throws BaseException, NotConnected;
77
78    /**
79     * Returns WfResource object belonging to the user that has been
80     * connected to shark through this interface. This will be the WfResource
81     * object that has the same username attribute as the one used in
82     * connect() method. After getting this object, client application can
83     * present user a list of its assignments that can be retrieved throug
84     * this WfResource object.
85     *
86     * @return WfResource object belonging to the user.
87     * @throws BaseException If something unexpected happens.
88     * @throws NotConnected If user wasn't connected (the connect()
89     * wasn't called or authentication failed).
90     *
91     */

92    WfResource getResourceObject () throws BaseException, NotConnected;
93
94    /**
95     * Returns WfResource object belonging to the user that has been
96     * connected to shark through this interface. This will be the WfResource
97     * object that has the same username attribute as the one used in
98     * connect() method. After getting this object, client application can
99     * present user a list of its assignments that can be retrieved throug
100     * this WfResource object.
101     *
102     * @param t SharkTransaction.
103     * @return WfResource object belonging to the user.
104     *
105     * @throws BaseException If something unexpected happens.
106     * @throws NotConnected If user wasn't connected (the connect()
107     * wasn't called or authentication failed).
108     *
109     */

110    WfResource getResourceObject (SharkTransaction t) throws BaseException, NotConnected, NotEnabled;
111
112    /**
113     * Creates a process based on its definition given by parameters.
114     *
115     * @param pkgId the package Id of XPDL process definition.
116     * @param pDefId the process definition Id of XPDL process definition.
117     * @return created WfProcess.
118     *
119     * @throws BaseException If something unexpected happens.
120     * @throws NotConnected If user wasn't connected (the connect()
121     * wasn't called or authentication failed).
122     * @exception NotEnabled When it is currently not allowed to create processes based
123     * on this definition.
124     *
125     */

126    WfProcess createProcess (String JavaDoc pkgId,String JavaDoc pDefId) throws BaseException, NotConnected, NotEnabled;
127
128    /**
129     * Creates a process based on its definition given by parameters.
130     *
131     * @param t SharkTransaction.
132     * @param pkgId the package Id of XPDL process definition.
133     * @param pDefId the process definition Id of XPDL process definition.
134     * @return created WfProcess.
135     *
136     * @throws BaseException If something unexpected happens.
137     * @throws NotConnected If user wasn't connected (the connect()
138     * wasn't called or authentication failed).
139     * @exception NotEnabled When it is currently not allowed to create processes based
140     * on this definition
141     *
142     */

143    WfProcess createProcess (SharkTransaction t,String JavaDoc pkgId,String JavaDoc pDefId) throws BaseException, NotConnected, NotEnabled;
144
145    /**
146     * Creates a process based on its definition given by parameters.
147     *
148     * @param r WfRequester object.
149     * @param pkgId the package Id of XPDL process definition.
150     * @param pDefId the process definition Id of XPDL process definition.
151     * @return created WfProcess.
152     *
153     * @throws BaseException If something unexpected happens.
154     * @throws NotConnected If user wasn't connected (the connect()
155     * wasn't called or authentication failed).
156     * @exception NotEnabled When it is currently not allowed to create processes based
157     * on this definition
158     */

159    WfProcess createProcess(WfRequester r, String JavaDoc pkgId,String JavaDoc pDefId)
160    throws BaseException, NotConnected, NotEnabled, InvalidRequester, RequesterRequired;
161
162    /**
163     * Creates a process based on its definition given by parameters.
164     *
165     * @param t SharkTransaction.
166     * @param r WfRequester object.
167     * @param pkgId the package Id of XPDL process definition.
168     * @param pDefId the process definition Id of XPDL process definition.
169     * @return created WfProcess.
170     *
171     * @throws BaseException If something unexpected happens.
172     * @throws NotConnected If user wasn't connected (the connect()
173     * wasn't called or authentication failed).
174     * @exception NotEnabled When it is currently not allowed to create processes based
175     * on this definition
176     */

177    WfProcess createProcess(SharkTransaction t, WfRequester r, String JavaDoc pkgId,String JavaDoc pDefId)
178    throws BaseException, NotConnected, NotEnabled, InvalidRequester, RequesterRequired;
179 }
180
181
Popular Tags