KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.corba.poa;
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 David Forslund
11  */

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