KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.enhydra.shark.api.client.wfservice;
2
3 import org.enhydra.shark.api.client.wfbase.BaseException;
4 import org.enhydra.shark.api.UserTransaction;
5
6 /**
7  * Interface used to perform some administrative operations concerning user
8  * groups and users.
9  * @author Sasa Bojanic
10  * @author Vladimir Puskas
11  * @author Tanja Jovanovic
12  */

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

22    void connect (String JavaDoc userId);
23
24    /**
25     * Returns Ids of all user groups.
26     *
27     * @return Array of user group Ids.
28     *
29     * @throws BaseException If something unexpected happens.
30     */

31    String JavaDoc[] getAllGroupnames () throws BaseException;
32
33    /**
34     * Returns Ids of user groups.
35     *
36     * @param t user transaction.
37     * @return Array of user group Ids.
38     *
39     * @throws BaseException If something unexpected happens.
40     *
41     */

42    String JavaDoc[] getAllGroupnames (UserTransaction t) throws BaseException;
43
44    /**
45     * Returns Ids of all users.
46     *
47     * @return Array of user Ids.
48     *
49     * @throws BaseException If something unexpected happens.
50     */

51    String JavaDoc[] getAllUsers () throws BaseException;
52
53    /**
54     * Returns Ids of all users.
55     *
56     * @param t user transaction.
57     * @return Array of user Ids.
58     *
59     * @throws BaseException If something unexpected happens.
60     */

61    String JavaDoc[] getAllUsers (UserTransaction t) throws BaseException;
62
63    /**
64     * Returns all usernames that belong to the given group.
65     *
66     * @param groupName name of the given group.
67     * @return Array of all usernames that belong to given group.
68     *
69     * @throws BaseException If something unexpected happens.
70     */

71    String JavaDoc[] getAllUsers (String JavaDoc groupName) throws BaseException;
72
73    /**
74     * Returns all usernames that belong to the given group.
75     *
76     * @param t user transaction.
77     * @param groupName name of the given group.
78     * @return Array of all usernames that belong to given group.
79     *
80     * @throws BaseException If something unexpected happens.
81     */

82    String JavaDoc[] getAllUsers (UserTransaction t, String JavaDoc groupName) throws BaseException;
83
84    /**
85     * Returns all users that belong to the given groups.
86     *
87     * @param groupNames names of the given groups.
88     * @return Array of all users that belong to given groups.
89     *
90     * @throws BaseException If something unexpected happens.
91     */

92    String JavaDoc[] getAllUsers (String JavaDoc[] groupNames) throws BaseException;
93
94    /**
95     * Returns all users that belong to the given groups.
96     *
97     * @param t user transaction.
98     * @param groupNames names of the given groups.
99     * @return Array of all users that belong to given groups.
100     *
101     * @throws BaseException If something unexpected happens.
102     */

103    String JavaDoc[] getAllUsers (UserTransaction t, String JavaDoc[] groupNames) throws BaseException;
104
105    /**
106     * Returns all users that are immediate children of the given group.
107     *
108     * @param groupName name of the given group.
109     * @return Array of all immediate (direct) users that belong to the given
110     * group.
111     *
112     * @throws BaseException If something unexpected happens.
113     */

114    String JavaDoc[] getAllImmediateUsers (String JavaDoc groupName) throws BaseException;
115
116    /**
117     * Returns all users that are immediate children of the given group.
118     *
119     * @param t user transaction.
120     * @param groupName name of the given group.
121     * @return Array of all immediate (direct) users that belong to the given
122     * group.
123     *
124     * @throws BaseException If something unexpected happens.
125     */

126    String JavaDoc[] getAllImmediateUsers (UserTransaction t, String JavaDoc groupName) throws BaseException;
127    
128    /**
129     * Returns all groups that belong to the given group.
130     *
131     * @param groupName name of the given group.
132     * @return Array of all groups that belong to the given group.
133     *
134     * @throws BaseException If something unexpected happens.
135     */

136    String JavaDoc[] getAllSubgroups (String JavaDoc groupName) throws BaseException;
137
138    /**
139     * Returns all groups that belong to the given group.
140     *
141     * @param t user transaction.
142     * @param groupName name of the given group.
143     * @return Array of all groups that belong to the given group.
144     *
145     * @throws BaseException If something unexpected happens.
146     */

147    String JavaDoc[] getAllSubgroups (UserTransaction t, String JavaDoc groupName) throws BaseException;
148
149    /**
150     * Returns all groups that belong to the given groups.
151     *
152     * @param groupNames names of the given groups.
153     * @return Array of all groups that belong to the given groups.
154     *
155     * @throws BaseException If something unexpected happens.
156     */

157    String JavaDoc[] getAllSubgroups (String JavaDoc[] groupNames) throws BaseException;
158
159    /**
160     * Returns all groups that belong to the given groups.
161     *
162     * @param t user transaction.
163     * @param groupNames names of the given groups.
164     * @return Array of all groups that belong to the given groups.
165     *
166     * @throws BaseException If something unexpected happens.
167     */

168    String JavaDoc[] getAllSubgroups (UserTransaction t, String JavaDoc[] groupNames) throws BaseException;
169
170    /**
171     * Returns all groups that are immediate children of the given group
172     * (which are on the first level bellow the level of the given group).
173     *
174     * @param groupName name of the given group.
175     * @return Array of all groups that are immediate children of the given group.
176     *
177     * @throws BaseException If something unexpected happens.
178     */

179    String JavaDoc[] getAllImmediateSubgroups (String JavaDoc groupName) throws BaseException;
180
181    /**
182     * Returns all groups that are immediate children of the given group
183     * (which are on the first level bellow the level of the given group).
184     *
185     * @param t user transaction.
186     * @param groupName name of the given group.
187     * @return Array of all groups that are immediate children of the given group.
188     *
189     * @throws BaseException If something unexpected happens.
190     */

191    String JavaDoc[] getAllImmediateSubgroups (UserTransaction t, String JavaDoc groupName) throws BaseException;
192
193    /**
194     * Creates a new user group.
195     *
196     * @param groupName name of the given group.
197     * @param description group description.
198     *
199     * @throws BaseException If something unexpected happens.
200     */

201    void createGroup (String JavaDoc groupName,String JavaDoc description) throws BaseException;
202
203    /**
204     * Creates a new user group.
205     *
206     * @param t user transaction.
207     * @param groupName name of the given group.
208     * @param description group description.
209     *
210     * @throws BaseException If something unexpected happens.
211     */

212    void createGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc description) throws BaseException;
213
214    /**
215     * Removes user group.
216     *
217     * @param groupName name of the given group.
218     *
219     * @throws BaseException If something unexpected happens.
220     */

221    void removeGroup (String JavaDoc groupName) throws BaseException;
222
223    /**
224     * Removes user group.
225     *
226     * @param t user transaction.
227     * @param groupName name of the given group.
228     *
229     * @throws BaseException If something unexpected happens.
230     */

231    void removeGroup (UserTransaction t, String JavaDoc groupName) throws BaseException;
232
233    /**
234     * Returns true if user group with given name exists.
235     *
236     * @param groupName name of the given group.
237     * @return true if user group exists, otherwise false.
238     *
239     * @throws BaseException If something unexpected happens.
240     */

241    boolean doesGroupExist (String JavaDoc groupName) throws BaseException;
242
243    /**
244     * Returns true if user group with given name exists.
245     *
246     * @param t user transaction.
247     * @param groupName name of the given group.
248     * @return true if user group exists, otherwise false.
249     *
250     * @throws BaseException If something unexpected happens.
251     */

252    boolean doesGroupExist (UserTransaction t, String JavaDoc groupName) throws BaseException;
253
254    /**
255     * Returns true if group <i>subgroupName</i> is subgroup of group <i>groupName</i>.
256     *
257     * @param groupName name of the given group.
258     * @param subgroupName name of the given subgroup.
259     * @return true if group <i>subgroupName</i> is subgroup of group <i>groupName</i>,
260     * otherwise false.
261     *
262     * @throws BaseException If something unexpected happens.
263     */

264    boolean doesGroupBelongToGroup (String JavaDoc groupName, String JavaDoc subgroupName) throws BaseException;
265
266    /**
267     * Returns true if group <i>subgroupName</i> is subgroup of group <i>groupName</i>.
268     *
269     * @param t user transaction.
270     * @param groupName name of the given group.
271     * @param subgroupName name of the given subgroup.
272     * @return true if group <i>subgroupName</i> is subgroup of group <i>groupName</i>,
273     * otherwise false.
274     *
275     * @throws BaseException If something unexpected happens.
276     */

277    boolean doesGroupBelongToGroup (UserTransaction t, String JavaDoc groupName, String JavaDoc subgroupName) throws BaseException;
278
279    /**
280     * Allows administrator to update data about group.
281     *
282     * @param groupName name of the given group.
283     * @param description group description.
284     *
285     * @throws BaseException If something unexpected happens.
286     */

287    void updateGroup (String JavaDoc groupName,String JavaDoc description) throws BaseException;
288
289    /**
290     * Allows administrator to update data about group.
291     *
292     * @param t user transaction.
293     * @param groupName name of the given group.
294     * @param description group description.
295     *
296     * @throws BaseException If something unexpected happens.
297     */

298    void updateGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc description) throws BaseException;
299
300    /**
301     * Adds an existing group <i>subgroupName</i> to the group <i>groupName</i>.
302     *
303     * @param groupName name of the given group.
304     * @param subgroupName name of the given subgroup to be added.
305     *
306     * @throws BaseException If something unexpected happens.
307     */

308    void addGroupToGroup (String JavaDoc groupName,String JavaDoc subgroupName) throws BaseException;
309
310    /**
311     * Adds an existing group <i>subgroupName</i> to the group <i>groupName</i>.
312     *
313     * @param t user transaction.
314     * @param groupName name of the given group.
315     * @param subgroupName name of the given subgroup to be added.
316     *
317     * @throws BaseException If something unexpected happens.
318     */

319    void addGroupToGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc subgroupName) throws BaseException;
320
321    /**
322     * Removes group <i>subgroupName</i> from the group <i>groupName</i>.
323     *
324     * @param groupName name of the given group.
325     * @param subgroupName name of the given subgroup to be removed.
326     *
327     * @throws BaseException If something unexpected happens.
328     */

329    void removeGroupFromGroup (String JavaDoc groupName,String JavaDoc subgroupName) throws BaseException;
330
331    /**
332     * Removes group <i>subgroupName</i> from the group <i>groupName</i>.
333     *
334     * @param t user transaction.
335     * @param groupName name of the given group.
336     * @param subgroupName name of the given subgroup to be removed.
337     *
338     * @throws BaseException If something unexpected happens.
339     */

340    void removeGroupFromGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc subgroupName) throws BaseException;
341
342    /**
343     * Deletes group <i>groupName</i> and all its child groups that don't belong
344     * to any other group except this one.
345     *
346     * @param groupName name of the given group.
347     *
348     * @throws BaseException If something unexpected happens.
349     */

350    void removeGroupTree (String JavaDoc groupName) throws BaseException;
351
352    /**
353     * Deletes group <i>groupName</i> and all its child groups that don't belong
354     * to any other group except this one.
355     *
356     * @param t user transaction.
357     * @param groupName name of the given group.
358     *
359     * @throws BaseException If something unexpected happens.
360     */

361    void removeGroupTree (UserTransaction t, String JavaDoc groupName) throws BaseException;
362    
363    /**
364     * Removes all users from group <i>group</i> that don't belong to any other
365     * group except this one.
366     *
367     * @param groupName name of the given group.
368     *
369     * @throws BaseException If something unexpected happens.
370     */

371    void removeUsersFromGroupTree (String JavaDoc groupName) throws BaseException;
372    
373    /**
374     * Removes all users from group <i>group</i> that don't belong to any other
375     * group except this one.
376     *
377     * @param t user transaction.
378     * @param groupName name of the given group.
379     *
380     * @throws BaseException If something unexpected happens.
381     */

382    void removeUsersFromGroupTree (UserTransaction t,String JavaDoc groupName) throws BaseException;
383    
384    /**
385     * Moves group <i>subgroupName</i> from the group <i>currentParentGroup</i> to
386     * group <i>newParentGroup</i>.
387     *
388     * @param currentParentGroup current group that contains group subgroupName.
389     * @param newParentGroup new group where group subgroupName will be moved to.
390     * @param subgroupName subgroup that will be moved.
391     *
392     * @throws BaseException If something unexpected happens.
393     */

394    void moveGroup (String JavaDoc currentParentGroup,String JavaDoc newParentGroup,String JavaDoc subgroupName) throws BaseException;
395
396
397    /**
398     * Moves group <i>subgroupName</i> from the group <i>currentParentGroup</i> to
399     * group <i>newParentGroup</i>.
400     *
401     * @param t user transaction.
402     * @param currentParentGroup current group that contains group subgroupName.
403     * @param newParentGroup new group where group subgroupName will be moved to.
404     * @param subgroupName subgroup that will be moved.
405     *
406     * @throws BaseException If something unexpected happens.
407     */

408    void moveGroup (UserTransaction t,String JavaDoc currentParentGroup,String JavaDoc newParentGroup,String JavaDoc subgroupName) throws BaseException;
409
410    /**
411     * Returns a group description.
412     *
413     * @param groupName name of the given group.
414     * @return Group description.
415     *
416     * @throws BaseException If something unexpected happens.
417     */

418    String JavaDoc getGroupDescription (String JavaDoc groupName) throws BaseException;
419
420    /**
421     * Returns a group description.
422     *
423     * @param t user transaction.
424     * @param groupName name of the given group.
425     * @return Group description.
426     *
427     * @throws BaseException If something unexpected happens.
428     */

429    String JavaDoc getGroupDescription (UserTransaction t, String JavaDoc groupName) throws BaseException;
430
431    /**
432     * Adds an existing user with a given username to the given group.
433     *
434     * @param groupName name of the given group.
435     * @param username username used to uniquely identify shark user.
436     *
437     * @throws BaseException If something unexpected happens.
438     */

439    void addUserToGroup (String JavaDoc groupName,String JavaDoc username) throws BaseException;
440
441    /**
442     * Adds an existing user with a given username to the given group.
443     *
444     * @param t user transaction.
445     * @param groupName name of the given group.
446     * @param username username used to uniquely identify shark user.
447     *
448     * @throws BaseException If something unexpected happens.
449     */

450    void addUserToGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc username) throws BaseException;
451
452    /**
453     * Removes the user from the group.
454     *
455     * @param groupName name of the given group.
456     * @param username username used to uniquely identify shark user.
457     *
458     * @throws BaseException If something unexpected happens.
459     */

460    void removeUserFromGroup (String JavaDoc groupName,String JavaDoc username) throws BaseException;
461
462    /**
463     * Removes the user from the group.
464     *
465     * @param t user transaction.
466     * @param groupName name of the given group.
467     * @param username username used to uniquely identify shark user.
468     *
469     * @throws BaseException If something unexpected happens.
470     */

471    void removeUserFromGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc username) throws BaseException;
472
473    /**
474     * Moves user <i>username</i> from the group <i>currentGroup</i> to group
475     * <i>newGroup</i>.
476     *
477     * @param currentGroup current group that contains the user.
478     * @param newGroup new group where the user will be moved to.
479     * @param username the user that will be moved.
480     *
481     * @throws BaseException If something unexpected happens.
482     */

483    void moveUser (String JavaDoc currentGroup,String JavaDoc newGroup,String JavaDoc username) throws BaseException;
484
485    /**
486     * Moves user <i>username</i> from the group <i>currentGroup</i> to group
487     * <i>newGroup</i>.
488     *
489     * @param t user transaction.
490     * @param currentGroup current group that contains the user.
491     * @param newGroup new group where the user will be moved to.
492     * @param username the user that will be moved.
493     *
494     * @throws BaseException If something unexpected happens.
495     */

496    void moveUser (UserTransaction t,String JavaDoc currentGroup,String JavaDoc newGroup,String JavaDoc username) throws BaseException;
497
498    /**
499     * Returns true if the given user belongs to the given group.
500     *
501     * @param groupName name of the given group.
502     * @param username username used to uniquely identify shark user.
503     * @return true if the given user belongs to the given group, otherwise
504     * false.
505     *
506     * @throws BaseException If something unexpected happens.
507     */

508    boolean doesUserBelongToGroup (String JavaDoc groupName,String JavaDoc username) throws BaseException;
509
510    /**
511     * Returns true if the given user belongs to the given group.
512     *
513     * @param t user transaction.
514     * @param groupName name of the given group.
515     * @param username username used to uniquely identify shark user.
516     * @return true if the given user belongs to the given group, otherwise
517     * false.
518     *
519     * @throws BaseException If something unexpected happens.
520     */

521    boolean doesUserBelongToGroup (UserTransaction t, String JavaDoc groupName,String JavaDoc username) throws BaseException;
522
523    /**
524     * Allows administrator to create new user. After its creation, the client
525     * application will always be able to log onto shark using username and
526     * password defined for the user.
527     *
528     * @param groupName groupName used to uniquely identify group -
529     * this parameter is mandatory.
530     * @param username username used to uniquely identify user -
531     * this parameter is mandatory.
532     * @param password password used to authenticate -
533     * this parameter is mandatory.
534     * @param firstName the user's first name.
535     * @param lastName the user's last name.
536     * @param emailAddress email address of the user.
537     *
538     * @throws BaseException If something unexpected happens (i.e the user with
539     * given username already exists).
540     */

541    void createUser (String JavaDoc groupName,String JavaDoc username, String JavaDoc password, String JavaDoc firstName, String JavaDoc lastName, String JavaDoc emailAddress) throws BaseException;
542
543    /**
544     * Allows administrator to create new user. After its creation, the client
545     * application will always be able to log onto shark using username and
546     * password defined for the user.
547     *
548     * @param t user transaction.
549     * @param groupName groupName used to uniquely identify group -
550     * this parameter is mandatory.
551     * @param username username used to uniquely identify user -
552     * this parameter is mandatory.
553     * @param password password used to authenticate -
554     * this parameter is mandatory.
555     * @param firstName the user's first name.
556     * @param lastName the user's last name.
557     * @param emailAddress email address of the user.
558     *
559     * @throws BaseException If something unexpected happens (i.e the user with
560     * given username already exists).
561     */

562    void createUser (UserTransaction t, String JavaDoc groupName,String JavaDoc username, String JavaDoc password, String JavaDoc firstName, String JavaDoc lastName, String JavaDoc emailAddress) throws BaseException;
563
564    /**
565     * Allows administrator to remove the user.
566     *
567     * @param username username used to uniquely identify user.
568     *
569     * @throws BaseException If something unexpected happens (i.e the user with
570     * given username does not exist, or this is a user that can't be removed).
571     */

572    void removeUser (String JavaDoc username) throws BaseException;
573
574    /**
575     * Allows administrator to remove the user.
576     *
577     * @param t user transaction.
578     * @param username username used to uniquely identify user.
579     *
580     * @throws BaseException If something unexpected happens (i.e the user with
581     * given username does not exist, or this is a user that can't be removed).
582     */

583    void removeUser (UserTransaction t, String JavaDoc username) throws BaseException;
584
585    /**
586     * Allows administrator to update data about user.
587     *
588     * @param username username used to uniquely identify user -
589     * this parameter is mandatory.
590     * @param firstName the user's first name.
591     * @param lastName the user's last name.
592     * @param emailAddress email address of the user.
593     *
594     * @throws BaseException If something unexpected happens (i.e the user with
595     * given username does not exist).
596     */

597    void updateUser (String JavaDoc username, String JavaDoc firstName, String JavaDoc lastName, String JavaDoc emailAddress) throws BaseException;
598
599    /**
600     * Allows administrator to update data about user.
601     *
602     * @param t user transaction.
603     * @param username username used to uniquely identify user -
604     * this parameter is mandatory.
605     * @param firstName the user's first name.
606     * @param lastName the user's last name.
607     * @param emailAddress email address of the user.
608     *
609     * @throws BaseException If something unexpected happens (i.e the user with
610     * given username does not exist).
611     */

612    void updateUser (UserTransaction t, String JavaDoc username, String JavaDoc firstName, String JavaDoc lastName, String JavaDoc emailAddress) throws BaseException;
613
614    /**
615     * Sets user password.
616     *
617     * @param username username of the shark user.
618     * @param password new password of the shark user.
619     *
620     * @throws BaseException If something unexpected happens.
621     */

622    void setPassword (String JavaDoc username,String JavaDoc password) throws BaseException;
623
624    /**
625     * Sets user password.
626     *
627     * @param t user transaction.
628     * @param username username of the shark user.
629     * @param password new password of the shark user.
630     *
631     * @throws BaseException If something unexpected happens.
632     */

633    void setPassword (UserTransaction t, String JavaDoc username,String JavaDoc password) throws BaseException;
634
635    /**
636     * Returns true if user with given username exists.
637     *
638     * @param username username of the shark user.
639     * @return true if the user with the given username exists, otherwise false.
640     *
641     * @throws BaseException If something unexpected happens.
642     */

643    boolean doesUserExist (String JavaDoc username) throws BaseException;
644
645    /**
646     * Returns true if user with given username exists.
647     *
648     * @param t user transaction.
649     * @param username username of the shark user.
650     * @return true if the user with the given username exists, otherwise false.
651     *
652     * @throws BaseException If something unexpected happens.
653     */

654    boolean doesUserExist (UserTransaction t, String JavaDoc username) throws BaseException;
655
656    /**
657     * Returns string representing the real name for the shark user with the
658     * given username (first and last name).
659     *
660     * @param username username of the shark user.
661     * @return Real name of the shark user.
662     *
663     * @throws BaseException If something unexpected happens.
664     */

665    String JavaDoc getUserRealName (String JavaDoc username) throws BaseException;
666
667    /**
668     * Returns string representing the real name for the shark user with the
669     * given username (first and last name).
670     *
671     * @param t user transaction.
672     * @param username username of the shark user.
673     * @return Real name of the shark user.
674     *
675     * @throws BaseException If something unexpected happens.
676     */

677    String JavaDoc getUserRealName (UserTransaction t, String JavaDoc username) throws BaseException;
678
679
680    /**
681     * Returns string representing user's first name.
682     *
683     * @param username username of the shark user.
684     * @return First name of the shark user.
685     *
686     * @throws BaseException If something unexpected happens.
687     */

688    String JavaDoc getUserFirstName (String JavaDoc username) throws BaseException;
689
690    /**
691     * Returns string representing user's first name.
692     *
693     * @param t user transaction.
694     * @param username username of the shark user.
695     * @return First name of the shark user.
696     *
697     * @throws BaseException If something unexpected happens.
698     */

699    String JavaDoc getUserFirstName (UserTransaction t,String JavaDoc username) throws BaseException;
700
701    /**
702     * Returns string representing user's last name.
703     *
704     * @param username username of the shark user.
705     * @return Last name of the shark user.
706     *
707     * @throws BaseException If something unexpected happens.
708     */

709    String JavaDoc getUserLastName (String JavaDoc username) throws BaseException;
710
711    /**
712     * Returns string representing user's last name.
713     *
714     * @param t user transaction.
715     * @param username username of the shark user.
716     * @return Last name of the shark user.
717     *
718     * @throws BaseException If something unexpected happens.
719     */

720    String JavaDoc getUserLastName (UserTransaction t,String JavaDoc username) throws BaseException;
721
722    /**
723     * Returns string representing email address for the user with the given
724     * username.
725     *
726     * @param username username of the shark user.
727     * @return Email of the shark user.
728     *
729     * @throws BaseException If something unexpected happens.
730     */

731    String JavaDoc getUserEMailAddress (String JavaDoc username) throws BaseException;
732
733    /**
734     * Returns string representing email address for the user with the given
735     * username.
736     *
737     * @param t user transaction.
738     * @param username username of the shark user.
739     * @return Email of the shark user.
740     *
741     * @throws BaseException If something unexpected happens.
742     */

743    String JavaDoc getUserEMailAddress (UserTransaction t, String JavaDoc username) throws BaseException;
744
745 }
746
Popular Tags