KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corba > AdminMiscCORBA


1 package org.enhydra.shark.corba;
2
3 import org.omg.WfBase.*;
4 import org.enhydra.shark.corba.WorkflowService.*;
5
6
7 /**
8  * The client interface through which client accesses the engine objects, and
9  * performs the various actions on engine.
10  * @author Sasa Bojanic
11  */

12 public class AdminMiscCORBA extends _AdminMiscImplBase {
13    private SharkCORBAServer myServer;
14
15    private String JavaDoc userId;
16    private boolean connected=false;
17
18    org.enhydra.shark.api.client.wfservice.AdminMisc myAdminMisc;
19
20    AdminMiscCORBA (SharkCORBAServer server,org.enhydra.shark.api.client.wfservice.AdminMisc am) {
21       this.myServer=server;
22       this.myAdminMisc=am;
23    }
24
25    public void connect(String JavaDoc userId, String JavaDoc password, String JavaDoc engineName, String JavaDoc scope) throws BaseException, ConnectFailed {
26       this.userId=userId;
27
28       try {
29          if (!myServer.validateUser(userId,password)) {
30             throw new ConnectFailed("Connection failed, invalid username or password");
31          }
32          connected=true;
33          myAdminMisc.connect(userId);
34       } catch (ConnectFailed cf) {
35          throw cf;
36       } catch (Exception JavaDoc ex) {
37          throw new BaseException();
38       }
39    }
40
41    public void disconnect() throws BaseException, NotConnected {
42       if (!connected) {
43          throw new NotConnected("The connection is not established...");
44       }
45       connected=false;
46       this._orb().disconnect(this);
47    }
48
49    public NameValue[] getPackageExtendedAttributeNameValuePairs (String JavaDoc pkgId) throws BaseException, NotConnected {
50       if (!connected) {
51          throw new NotConnected("The connection is not established...");
52       }
53       try {
54          return SharkCORBAUtilities
55             .makeCORBANameValueArray(myServer.getBoundORB(),
56                                      myAdminMisc.getPackageExtendedAttributeNameValuePairs(pkgId));
57       } catch (Exception JavaDoc e) {
58          throw new BaseException();
59       }
60    }
61
62    public String JavaDoc[] getPackageExtendedAttributeNames(String JavaDoc pkgId) throws BaseException, NotConnected {
63       if (!connected) {
64          throw new NotConnected("The connection is not established...");
65       }
66       try {
67          return myAdminMisc.getPackageExtendedAttributeNames(pkgId);
68       } catch (Exception JavaDoc e) {
69          throw new BaseException();
70       }
71    }
72
73    public String JavaDoc getPackageExtendedAttributeValue(String JavaDoc pkgId,String JavaDoc extAttrName) throws BaseException, NotConnected {
74       if (!connected) {
75          throw new NotConnected("The connection is not established...");
76       }
77       try {
78          return myAdminMisc.getPackageExtendedAttributeValue(pkgId,extAttrName);
79       } catch (Exception JavaDoc e) {
80          throw new BaseException();
81       }
82    }
83
84    public NameValue[] getProcessDefinitionExtendedAttributeNameValuePairs (String JavaDoc mgrName) throws BaseException, NotConnected {
85       if (!connected) {
86          throw new NotConnected("The connection is not established...");
87       }
88       try {
89          return SharkCORBAUtilities
90             .makeCORBANameValueArray(myServer.getBoundORB(),
91                                      myAdminMisc.getProcessDefinitionExtendedAttributeNameValuePairs(mgrName));
92       } catch (Exception JavaDoc e) {
93          throw new BaseException();
94       }
95    }
96
97    public String JavaDoc[] getProcessDefinitionExtendedAttributeNames(String JavaDoc mgrName) throws BaseException, NotConnected {
98       if (!connected) {
99          throw new NotConnected("The connection is not established...");
100       }
101       try {
102          return myAdminMisc.getProcessDefinitionExtendedAttributeNames(mgrName);
103       } catch (Exception JavaDoc e) {
104          throw new BaseException();
105       }
106    }
107
108    public String JavaDoc getProcessDefinitionExtendedAttributeValue(String JavaDoc mgrName,String JavaDoc extAttrName) throws BaseException, NotConnected {
109       if (!connected) {
110          throw new NotConnected("The connection is not established...");
111       }
112       try {
113          return myAdminMisc.getProcessDefinitionExtendedAttributeValue(mgrName,extAttrName);
114       } catch (Exception JavaDoc e) {
115          throw new BaseException();
116       }
117    }
118
119    public NameValue[] getProcessExtendedAttributeNameValuePairs (String JavaDoc procId) throws BaseException, NotConnected {
120       if (!connected) {
121          throw new NotConnected("The connection is not established...");
122       }
123       try {
124          return SharkCORBAUtilities
125             .makeCORBANameValueArray(myServer.getBoundORB(),
126                                      myAdminMisc.getProcessExtendedAttributeNameValuePairs(procId));
127       } catch (Exception JavaDoc e) {
128          throw new BaseException();
129       }
130    }
131
132    public String JavaDoc[] getProcessExtendedAttributeNames(String JavaDoc procId) throws BaseException, NotConnected {
133       if (!connected) {
134          throw new NotConnected("The connection is not established...");
135       }
136       try {
137          return myAdminMisc.getProcessExtendedAttributeNames(procId);
138       } catch (Exception JavaDoc e) {
139          throw new BaseException();
140       }
141    }
142
143    public String JavaDoc getProcessExtendedAttributeValue(String JavaDoc procId,String JavaDoc extAttrName) throws BaseException, NotConnected {
144       if (!connected) {
145          throw new NotConnected("The connection is not established...");
146       }
147       try {
148          return myAdminMisc.getProcessExtendedAttributeValue(procId,extAttrName);
149       } catch (Exception JavaDoc e) {
150          throw new BaseException();
151       }
152    }
153
154    public String JavaDoc getActivitiesExtendedAttributes (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
155       if (!connected) {
156          throw new NotConnected("The connection is not established...");
157       }
158       try {
159          return myAdminMisc.getActivitiesExtendedAttributes(procId,actId);
160       } catch (Exception JavaDoc e) {
161          throw new BaseException();
162       }
163    }
164
165    public NameValue[] getActivitiesExtendedAttributeNameValuePairs (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
166       if (!connected) {
167          throw new NotConnected("The connection is not established...");
168       }
169       try {
170          return SharkCORBAUtilities
171             .makeCORBANameValueArray(myServer.getBoundORB(),
172                                      myAdminMisc.getActivitiesExtendedAttributeNameValuePairs(procId,actId));
173       } catch (Exception JavaDoc e) {
174          throw new BaseException();
175       }
176    }
177
178    public String JavaDoc[] getActivitiesExtendedAttributeNames(String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
179       if (!connected) {
180          throw new NotConnected("The connection is not established...");
181       }
182       try {
183          return myAdminMisc.getActivitiesExtendedAttributeNames(procId,actId);
184       } catch (Exception JavaDoc e) {
185          throw new BaseException();
186       }
187    }
188
189    public String JavaDoc getActivitiesExtendedAttributeValue(String JavaDoc procId,String JavaDoc actId,String JavaDoc extAttrName) throws BaseException, NotConnected {
190       if (!connected) {
191          throw new NotConnected("The connection is not established...");
192       }
193       try {
194          return myAdminMisc.getActivitiesExtendedAttributeValue(procId,actId,extAttrName);
195       } catch (Exception JavaDoc e) {
196          throw new BaseException();
197       }
198    }
199
200    public NameValue[] getDefVariableExtendedAttributeNameValuePairs (String JavaDoc mgrName,String JavaDoc variableId) throws BaseException, NotConnected {
201       if (!connected) {
202          throw new NotConnected("The connection is not established...");
203       }
204       try {
205          return SharkCORBAUtilities
206             .makeCORBANameValueArray(myServer.getBoundORB(),
207                                      myAdminMisc.getDefVariableExtendedAttributeNameValuePairs(mgrName,variableId));
208       } catch (Exception JavaDoc e) {
209          throw new BaseException();
210       }
211    }
212
213    public String JavaDoc[] getDefVariableExtendedAttributeNames(String JavaDoc mgrName,String JavaDoc variableId) throws BaseException, NotConnected {
214       if (!connected) {
215          throw new NotConnected("The connection is not established...");
216       }
217       try {
218          return myAdminMisc.getDefVariableExtendedAttributeNames(mgrName,variableId);
219       } catch (Exception JavaDoc e) {
220          throw new BaseException();
221       }
222    }
223
224    public String JavaDoc getDefVariableExtendedAttributeValue(String JavaDoc mgrName,String JavaDoc variableId,String JavaDoc extAttrName) throws BaseException, NotConnected {
225       if (!connected) {
226          throw new NotConnected("The connection is not established...");
227       }
228       try {
229          return myAdminMisc.getDefVariableExtendedAttributeValue(mgrName,variableId,extAttrName);
230       } catch (Exception JavaDoc e) {
231          throw new BaseException();
232       }
233    }
234
235    public NameValue[] getVariableExtendedAttributeNameValuePairs (String JavaDoc procId,String JavaDoc variableId) throws BaseException, NotConnected {
236       if (!connected) {
237          throw new NotConnected("The connection is not established...");
238       }
239       try {
240          return SharkCORBAUtilities
241             .makeCORBANameValueArray(myServer.getBoundORB(),
242                                      myAdminMisc.getVariableExtendedAttributeNameValuePairs(procId,variableId));
243       } catch (Exception JavaDoc e) {
244          throw new BaseException();
245       }
246    }
247
248    public String JavaDoc[] getVariableExtendedAttributeNames(String JavaDoc procId,String JavaDoc variableId) throws BaseException, NotConnected {
249       if (!connected) {
250          throw new NotConnected("The connection is not established...");
251       }
252       try {
253          return myAdminMisc.getVariableExtendedAttributeNames(procId,variableId);
254       } catch (Exception JavaDoc e) {
255          throw new BaseException();
256       }
257    }
258
259    public String JavaDoc getVariableExtendedAttributeValue(String JavaDoc procId,String JavaDoc variableId,String JavaDoc extAttrName) throws BaseException, NotConnected {
260       if (!connected) {
261          throw new NotConnected("The connection is not established...");
262       }
263       try {
264          return myAdminMisc.getVariableExtendedAttributeValue(procId,variableId,extAttrName);
265       } catch (Exception JavaDoc e) {
266          throw new BaseException();
267       }
268    }
269
270    public NameValue[] getParticipantExtendedAttributeNameValuePairs (String JavaDoc pkgId,String JavaDoc pDefId,String JavaDoc participantId) throws BaseException, NotConnected {
271       if (!connected) {
272          throw new NotConnected("The connection is not established...");
273       }
274       try {
275          return SharkCORBAUtilities
276             .makeCORBANameValueArray(myServer.getBoundORB(),
277                                      myAdminMisc.getParticipantExtendedAttributeNameValuePairs(pkgId,pDefId,participantId));
278       } catch (Exception JavaDoc e) {
279          throw new BaseException();
280       }
281    }
282
283    public String JavaDoc[] getParticipantExtendedAttributeNames(String JavaDoc pkgId,String JavaDoc pDefId,String JavaDoc participantId) throws BaseException, NotConnected {
284       if (!connected) {
285          throw new NotConnected("The connection is not established...");
286       }
287       try {
288          return myAdminMisc.getParticipantExtendedAttributeNames(pkgId,pDefId,participantId);
289       } catch (Exception JavaDoc e) {
290          throw new BaseException();
291       }
292    }
293
294    public String JavaDoc getParticipantExtendedAttributeValue(String JavaDoc pkgId,String JavaDoc pDefId,String JavaDoc participantId,String JavaDoc extAttrName) throws BaseException, NotConnected {
295       if (!connected) {
296          throw new NotConnected("The connection is not established...");
297       }
298       try {
299          return myAdminMisc.getParticipantExtendedAttributeValue(pkgId,pDefId,participantId,extAttrName);
300       } catch (Exception JavaDoc e) {
301          throw new BaseException();
302       }
303    }
304
305    public NameValue[] getApplicationExtendedAttributeNameValuePairs (String JavaDoc pkgId,String JavaDoc pDefId,String JavaDoc applicationId) throws BaseException, NotConnected {
306       if (!connected) {
307          throw new NotConnected("The connection is not established...");
308       }
309       try {
310          return SharkCORBAUtilities
311             .makeCORBANameValueArray(myServer.getBoundORB(),
312                                      myAdminMisc.getApplicationExtendedAttributeNameValuePairs(pkgId,pDefId,applicationId));
313       } catch (Exception JavaDoc e) {
314          throw new BaseException();
315       }
316    }
317
318    public String JavaDoc[] getApplicationExtendedAttributeNames(String JavaDoc pkgId,String JavaDoc pDefId,String JavaDoc applicationId) throws BaseException, NotConnected {
319       if (!connected) {
320          throw new NotConnected("The connection is not established...");
321       }
322       try {
323          return myAdminMisc.getApplicationExtendedAttributeNames(pkgId,pDefId,applicationId);
324       } catch (Exception JavaDoc e) {
325          throw new BaseException();
326       }
327    }
328
329    public String JavaDoc getApplicationExtendedAttributeValue(String JavaDoc pkgId,String JavaDoc pDefId,String JavaDoc applicationId,String JavaDoc extAttrName) throws BaseException, NotConnected {
330       if (!connected) {
331          throw new NotConnected("The connection is not established...");
332       }
333       try {
334          return myAdminMisc.getApplicationExtendedAttributeValue(pkgId,pDefId,applicationId,extAttrName);
335       } catch (Exception JavaDoc e) {
336          throw new BaseException();
337       }
338    }
339
340    public String JavaDoc getBlockActivityId (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
341       if (!connected) {
342          throw new NotConnected("The connection is not established...");
343       }
344       try {
345          return myAdminMisc.getBlockActivityId(procId,actId);
346       } catch (Exception JavaDoc e) {
347          throw new BaseException();
348       }
349    }
350
351    public String JavaDoc getActivityDefinitionId (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
352       if (!connected) {
353          throw new NotConnected("The connection is not established...");
354       }
355       try {
356          return myAdminMisc.getActivityDefinitionId(procId,actId);
357       } catch (Exception JavaDoc ex) {
358          throw new BaseException();
359       }
360    }
361
362    public String JavaDoc getProcessDefinitionId (String JavaDoc procId) throws BaseException, NotConnected {
363       if (!connected) {
364          throw new NotConnected("The connection is not established...");
365       }
366       try {
367          return myAdminMisc.getProcessDefinitionId(procId);
368       } catch (Exception JavaDoc e) {
369          throw new BaseException();
370       }
371    }
372
373    public String JavaDoc getDefVariableName (String JavaDoc mgrName,String JavaDoc variableId) throws BaseException, NotConnected {
374       if (!connected) {
375          throw new NotConnected("The connection is not established...");
376       }
377       try {
378          return myAdminMisc.getDefVariableName(mgrName,variableId);
379       } catch (Exception JavaDoc e) {
380          throw new BaseException();
381       }
382    }
383
384    public String JavaDoc getDefVariableDescription (String JavaDoc mgrName,String JavaDoc variableId) throws BaseException, NotConnected {
385       if (!connected) {
386          throw new NotConnected("The connection is not established...");
387       }
388       try {
389          return myAdminMisc.getDefVariableDescription(mgrName,variableId);
390       } catch (Exception JavaDoc e) {
391          throw new BaseException();
392       }
393    }
394
395    public String JavaDoc getDefVariableJavaClassName (String JavaDoc mgrName,String JavaDoc variableId) throws BaseException, NotConnected {
396       if (!connected) {
397          throw new NotConnected("The connection is not established...");
398       }
399       try {
400          return myAdminMisc.getDefVariableJavaClassName(mgrName,variableId);
401       } catch (Exception JavaDoc e) {
402          throw new BaseException();
403       }
404    }
405
406    public String JavaDoc getVariableName (String JavaDoc procId,String JavaDoc variableId) throws BaseException, NotConnected {
407       if (!connected) {
408          throw new NotConnected("The connection is not established...");
409       }
410       try {
411          return myAdminMisc.getVariableName(procId,variableId);
412       } catch (Exception JavaDoc e) {
413          throw new BaseException();
414       }
415    }
416
417    public String JavaDoc getVariableDescription (String JavaDoc procId,String JavaDoc variableId) throws BaseException, NotConnected {
418       if (!connected) {
419          throw new NotConnected("The connection is not established...");
420       }
421       try {
422          return myAdminMisc.getVariableDescription(procId,variableId);
423       } catch (Exception JavaDoc e) {
424          throw new BaseException();
425       }
426    }
427
428    public String JavaDoc getVariableJavaClassName (String JavaDoc procId,String JavaDoc variableId) throws BaseException, NotConnected {
429       if (!connected) {
430          throw new NotConnected("The connection is not established...");
431       }
432       try {
433          return myAdminMisc.getVariableJavaClassName(procId,variableId);
434       } catch (Exception JavaDoc e) {
435          throw new BaseException();
436       }
437    }
438
439    public String JavaDoc getParticipantName (String JavaDoc pkgId, String JavaDoc pDefId, String JavaDoc participantId) throws BaseException, NotConnected {
440       if (!connected) {
441          throw new NotConnected("The connection is not established...");
442       }
443       try {
444          if (pDefId!=null && pDefId.equals("")) {
445             pDefId=null;
446          }
447          return myAdminMisc.getParticipantName(pkgId,pDefId,participantId);
448       } catch (Exception JavaDoc e) {
449          throw new BaseException();
450       }
451    }
452
453    public String JavaDoc getApplicationName (String JavaDoc pkgId, String JavaDoc pDefId, String JavaDoc applicationId) throws BaseException, NotConnected {
454       if (!connected) {
455          throw new NotConnected("The connection is not established...");
456       }
457       try {
458          if (pDefId!=null && pDefId.equals("")) {
459             pDefId=null;
460          }
461          return myAdminMisc.getParticipantName(pkgId,pDefId,applicationId);
462       } catch (Exception JavaDoc e) {
463          throw new BaseException();
464       }
465    }
466
467    public String JavaDoc getProcessMgrPkgId (String JavaDoc name) throws BaseException, NotConnected {
468       if (!connected) {
469          throw new NotConnected("The connection is not established...");
470       }
471       try {
472          return myAdminMisc.getProcessMgrPkgId(name);
473       } catch (Exception JavaDoc e) {
474          throw new BaseException();
475       }
476    }
477
478    public String JavaDoc getProcessMgrProcDefId (String JavaDoc name) throws BaseException, NotConnected {
479       if (!connected) {
480          throw new NotConnected("The connection is not established...");
481       }
482       try {
483          return myAdminMisc.getProcessMgrProcDefId(name);
484       } catch (Exception JavaDoc e) {
485          throw new BaseException();
486       }
487    }
488
489    public String JavaDoc getProcessMgrProcDefName (String JavaDoc name) throws BaseException, NotConnected {
490       if (!connected) {
491          throw new NotConnected("The connection is not established...");
492       }
493       try {
494          return myAdminMisc.getProcessMgrProcDefName(name);
495       } catch (Exception JavaDoc e) {
496          throw new BaseException();
497       }
498    }
499
500    public String JavaDoc getProcessRequesterUsername (String JavaDoc procId) throws BaseException, NotConnected {
501       if (!connected) {
502          throw new NotConnected("The connection is not established...");
503       }
504       try {
505          return myAdminMisc.getProcessRequesterUsername(procId);
506       } catch (Exception JavaDoc e) {
507          throw new BaseException();
508       }
509    }
510
511    public String JavaDoc getActivityResourceUsername(String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
512       if (!connected) {
513          throw new NotConnected("The connection is not established...");
514       }
515       try {
516          return myAdminMisc.getActivityResourceUsername(procId,actId);
517       } catch (Exception JavaDoc e) {
518          throw new BaseException();
519       }
520    }
521
522    public long getProcessCreatedTime (String JavaDoc procId) throws BaseException, NotConnected {
523       if (!connected) {
524          throw new NotConnected("The connection is not established...");
525       }
526       try {
527          return myAdminMisc.getProcessCreatedTime(procId);
528       } catch (Exception JavaDoc e) {
529          throw new BaseException();
530       }
531    }
532
533    public long getProcessStartedTime (String JavaDoc procId) throws BaseException, NotConnected {
534       if (!connected) {
535          throw new NotConnected("The connection is not established...");
536       }
537       try {
538          return myAdminMisc.getProcessStartedTime(procId);
539       } catch (Exception JavaDoc e) {
540          throw new BaseException();
541       }
542    }
543
544    public long getProcessFinishTime (String JavaDoc procId) throws BaseException, NotConnected {
545       if (!connected) {
546          throw new NotConnected("The connection is not established...");
547       }
548       try {
549          return myAdminMisc.getProcessFinishTime(procId);
550       } catch (Exception JavaDoc e) {
551          throw new BaseException();
552       }
553    }
554
555    public long getActivityCreatedTime (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
556       if (!connected) {
557          throw new NotConnected("The connection is not established...");
558       }
559       try {
560          return myAdminMisc.getActivityCreatedTime(procId,actId);
561       } catch (Exception JavaDoc e) {
562          throw new BaseException();
563       }
564    }
565
566    public long getActivityStartedTime (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
567       if (!connected) {
568          throw new NotConnected("The connection is not established...");
569       }
570       try {
571          return myAdminMisc.getActivityStartedTime(procId,actId);
572       } catch (Exception JavaDoc e) {
573          throw new BaseException();
574       }
575    }
576
577    public long getActivityFinishTime (String JavaDoc procId,String JavaDoc actId) throws BaseException, NotConnected {
578       if (!connected) {
579          throw new NotConnected("The connection is not established...");
580       }
581       try {
582          return myAdminMisc.getActivityFinishTime(procId,actId);
583       } catch (Exception JavaDoc e) {
584          throw new BaseException();
585       }
586    }
587 }
588
Popular Tags