1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60 package org.astrogrid.community.client.policy.manager ;
61
62 import org.apache.commons.logging.Log ;
63 import org.apache.commons.logging.LogFactory ;
64
65 import java.rmi.RemoteException ;
66
67 import org.astrogrid.community.client.service.CommunityServiceCoreDelegate ;
68
69 import org.astrogrid.community.common.policy.data.AccountData ;
70 import org.astrogrid.community.common.policy.data.GroupData ;
71 import org.astrogrid.community.common.policy.data.ResourceData ;
72 import org.astrogrid.community.common.policy.data.PolicyPermission ;
73 import org.astrogrid.community.common.policy.data.GroupMemberData ;
74
75 import org.astrogrid.community.common.policy.manager.PolicyManager ;
76
77 import org.astrogrid.community.common.exception.CommunityPolicyException ;
78 import org.astrogrid.community.common.exception.CommunityServiceException ;
79 import org.astrogrid.community.common.exception.CommunityResourceException ;
80 import org.astrogrid.community.common.exception.CommunityIdentifierException ;
81
82
83 /***
84 * The core delegate for our PolicyManager service.
85 * This acts as a wrapper for a PolicyManager service, and converts RemoteExceptions into CommunityServiceException.
86 * @todo Refactor this as a number of smaller classes.
87 *
88 */
89 public class PolicyManagerCoreDelegate
90 extends CommunityServiceCoreDelegate
91 implements PolicyManager, PolicyManagerDelegate
92 {
93 /***
94 * Our debug logger.
95 *
96 */
97 private static Log log = LogFactory.getLog(PolicyManagerCoreDelegate.class);
98
99 /***
100 * Public constructor.
101 *
102 */
103 protected PolicyManagerCoreDelegate()
104 {
105 }
106
107 /***
108 * Our PolicyManager service.
109 *
110 */
111 private PolicyManager manager = null ;
112
113 /***
114 * Get a reference to our PolicyManager service.
115 *
116 */
117 protected PolicyManager getPolicyManager()
118 {
119 return this.manager ;
120 }
121
122 /***
123 * Set our our PolicyManager service.
124 *
125 */
126 protected void setPolicyManager(PolicyManager manager)
127 {
128 this.setCommunityService(manager) ;
129 this.manager = manager ;
130 }
131
132 /***
133 * Add a new Account, given the Account ident.
134 * @param ident The Account identifier.
135 * @return An AccountData for the Account.
136 * @throws CommunityIdentifierException If the identifier is not valid.
137 * @throws CommunityPolicyException If the identifier is already in the database.
138 * @throws CommunityServiceException If there is an internal error in the service.
139 *
140 */
141 public AccountData addAccount(String ident)
142 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
143 {
144
145
146 if (null != this.manager)
147 {
148
149
150 try {
151 return this.manager.addAccount(ident) ;
152 }
153
154
155 catch (RemoteException ouch)
156 {
157
158
159 policyException(ouch) ;
160 serviceException(ouch) ;
161 identifierException(ouch) ;
162
163
164 throw new CommunityServiceException(
165 "WebService call failed - " + ouch,
166 ouch
167 ) ;
168 }
169 }
170
171
172 else {
173 throw new CommunityServiceException(
174 "Service not initialised"
175 ) ;
176 }
177 }
178
179 /***
180 * Add a new Account, given the Account data.
181 * @param account The AccountData to add.
182 * @return A new AccountData for the Account.
183 * @throws CommunityIdentifierException If the identifier is not valid.
184 * @throws CommunityPolicyException If the identifier is already in the database.
185 * @throws CommunityServiceException If there is an internal error in the service.
186 *
187 */
188 public AccountData addAccount(AccountData account)
189 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
190 {
191
192
193 if (null != this.manager)
194 {
195
196
197 try {
198 return this.manager.addAccount(account) ;
199 }
200
201
202 catch (RemoteException ouch)
203 {
204
205
206 policyException(ouch) ;
207 serviceException(ouch) ;
208 identifierException(ouch) ;
209
210
211 throw new CommunityServiceException(
212 "WebService call failed - " + ouch,
213 ouch
214 ) ;
215 }
216 }
217
218
219 else {
220 throw new CommunityServiceException(
221 "Service not initialised"
222 ) ;
223 }
224 }
225
226 /***
227 * Request an Account details, given the Account ident.
228 * @param ident The Account identifier.
229 * @return An AccountData for the Account.
230 * @throws CommunityIdentifierException If the identifier is not valid.
231 * @throws CommunityPolicyException If the identifier is not in the database.
232 * @throws CommunityServiceException If there is an internal error in the service.
233 *
234 */
235 public AccountData getAccount(String ident)
236 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
237 {
238
239
240 if (null != this.manager)
241 {
242
243
244 try {
245 return this.manager.getAccount(ident) ;
246 }
247
248
249 catch (RemoteException ouch)
250 {
251
252
253 policyException(ouch) ;
254 serviceException(ouch) ;
255 identifierException(ouch) ;
256
257
258 throw new CommunityServiceException(
259 "WebService call failed - " + ouch,
260 ouch
261 ) ;
262 }
263 }
264
265
266 else {
267 throw new CommunityServiceException(
268 "Service not initialised"
269 ) ;
270 }
271 }
272
273 /***
274 * Update an Account.
275 * @param account The new AccountData to update.
276 * @return A new AccountData for the Account.
277 * @throws CommunityIdentifierException If the identifier is not valid.
278 * @throws CommunityPolicyException If the identifier is not in the database.
279 * @throws CommunityServiceException If there is an internal error in the service.
280 *
281 */
282 public AccountData setAccount(AccountData account)
283 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
284 {
285
286
287 if (null != this.manager)
288 {
289
290
291 try {
292 return this.manager.setAccount(account) ;
293 }
294
295
296 catch (RemoteException ouch)
297 {
298
299
300 policyException(ouch) ;
301 serviceException(ouch) ;
302 identifierException(ouch) ;
303
304
305 throw new CommunityServiceException(
306 "WebService call failed - " + ouch,
307 ouch
308 ) ;
309 }
310 }
311
312
313 else {
314 throw new CommunityServiceException(
315 "Service not initialised"
316 ) ;
317 }
318 }
319
320 /***
321 * Delete an Account.
322 * @param ident The Account identifier.
323 * @return The AccountData for the old Account.
324 * @throws CommunityIdentifierException If the identifier is not valid.
325 * @throws CommunityPolicyException If the identifier is not in the database.
326 * @throws CommunityServiceException If there is an internal error in the service.
327 *
328 */
329 public AccountData delAccount(String ident)
330 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
331 {
332
333
334 if (null != this.manager)
335 {
336
337
338 try {
339 return this.manager.delAccount(ident) ;
340 }
341
342
343 catch (RemoteException ouch)
344 {
345
346
347 policyException(ouch) ;
348 serviceException(ouch) ;
349 identifierException(ouch) ;
350
351
352 throw new CommunityServiceException(
353 "WebService call failed - " + ouch,
354 ouch
355 ) ;
356 }
357 }
358
359
360 else {
361 throw new CommunityServiceException(
362 "Service not initialised"
363 ) ;
364 }
365 }
366
367 /***
368 * Request a list of local Accounts.
369 * @return An array of AccountData objects.
370 * @throws CommunityServiceException If there is an internal error in the service.
371 *
372 */
373 public Object[] getLocalAccounts()
374 throws CommunityServiceException
375 {
376
377
378 if (null != this.manager)
379 {
380
381
382 try {
383 return this.manager.getLocalAccounts() ;
384 }
385
386
387 catch (RemoteException ouch)
388 {
389
390
391 serviceException(ouch) ;
392
393
394 throw new CommunityServiceException(
395 "WebService call failed - " + ouch,
396 ouch
397 ) ;
398 }
399 }
400
401
402 else {
403 throw new CommunityServiceException(
404 "Service not initialised"
405 ) ;
406 }
407 }
408
409 /***
410 * Add a new Group.
411 * @param ident The Group identifier.
412 * @return A GroupData for the Group.
413 * @throws CommunityIdentifierException If the identifier is not valid.
414 * @throws CommunityPolicyException If the identifier is already in the database.
415 * @throws CommunityServiceException If there is an internal error in the service.
416 *
417 */
418 public GroupData addGroup(String ident)
419 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
420 {
421
422
423 if (null != this.manager)
424 {
425
426
427 try {
428 return this.manager.addGroup(ident) ;
429 }
430
431
432 catch (RemoteException ouch)
433 {
434
435
436 policyException(ouch) ;
437 serviceException(ouch) ;
438 identifierException(ouch) ;
439
440
441 throw new CommunityServiceException(
442 "WebService call failed - " + ouch,
443 ouch
444 ) ;
445 }
446 }
447
448
449 else {
450 throw new CommunityServiceException(
451 "Service not initialised"
452 ) ;
453 }
454 }
455
456 /***
457 * Add a new Group.
458 * @param group The GroupData to add.
459 * @return A new GroupData for the Group.
460 * @throws CommunityIdentifierException If the identifier is not valid.
461 * @throws CommunityPolicyException If the identifier is already in the database.
462 * @throws CommunityServiceException If there is an internal error in the service.
463 *
464 */
465 public GroupData addGroup(GroupData data)
466 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
467 {
468
469
470 if (null != this.manager)
471 {
472
473
474 try {
475 return this.manager.addGroup(data) ;
476 }
477
478
479 catch (RemoteException ouch)
480 {
481
482
483 policyException(ouch) ;
484 serviceException(ouch) ;
485 identifierException(ouch) ;
486
487
488 throw new CommunityServiceException(
489 "WebService call failed - " + ouch,
490 ouch
491 ) ;
492 }
493 }
494
495
496 else {
497 throw new CommunityServiceException(
498 "Service not initialised"
499 ) ;
500 }
501 }
502
503 /***
504 * Request a Group details.
505 * @param ident The Group identifier.
506 * @return A GroupData for the Group.
507 * @throws CommunityIdentifierException If the identifier is not valid.
508 * @throws CommunityPolicyException If the identifier is not in the database.
509 * @throws CommunityServiceException If there is an internal error in the service.
510 *
511 */
512 public GroupData getGroup(String ident)
513 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
514 {
515
516
517 if (null != this.manager)
518 {
519
520
521 try {
522 return this.manager.getGroup(ident) ;
523 }
524
525
526 catch (RemoteException ouch)
527 {
528
529
530 policyException(ouch) ;
531 serviceException(ouch) ;
532 identifierException(ouch) ;
533
534
535 throw new CommunityServiceException(
536 "WebService call failed - " + ouch,
537 ouch
538 ) ;
539 }
540 }
541
542
543 else {
544 throw new CommunityServiceException(
545 "Service not initialised"
546 ) ;
547 }
548 }
549
550 /***
551 * Update a Group.
552 * @param data The new GroupData to update.
553 * @return A new GroupData for the Group.
554 * @throws CommunityIdentifierException If the identifier is not valid.
555 * @throws CommunityPolicyException If the identifier is not in the database.
556 * @throws CommunityServiceException If there is an internal error in the service.
557 *
558 */
559 public GroupData setGroup(GroupData data)
560 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
561 {
562
563
564 if (null != this.manager)
565 {
566
567
568 try {
569 return this.manager.setGroup(data) ;
570 }
571
572
573 catch (RemoteException ouch)
574 {
575
576
577 policyException(ouch) ;
578 serviceException(ouch) ;
579 identifierException(ouch) ;
580
581
582 throw new CommunityServiceException(
583 "WebService call failed - " + ouch,
584 ouch
585 ) ;
586 }
587 }
588
589
590 else {
591 throw new CommunityServiceException(
592 "Service not initialised"
593 ) ;
594 }
595 }
596
597 /***
598 * Delete a Group.
599 * @param ident The Group identifier.
600 * @return The GroupData for the old Group.
601 * @throws CommunityIdentifierException If the identifier is not valid.
602 * @throws CommunityPolicyException If the identifier is not in the database.
603 * @throws CommunityServiceException If there is an internal error in the service.
604 *
605 */
606 public GroupData delGroup(String ident)
607 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
608 {
609
610
611 if (null != this.manager)
612 {
613
614
615 try {
616 return this.manager.delGroup(ident) ;
617 }
618
619
620 catch (RemoteException ouch)
621 {
622
623
624 policyException(ouch) ;
625 serviceException(ouch) ;
626 identifierException(ouch) ;
627
628
629 throw new CommunityServiceException(
630 "WebService call failed - " + ouch,
631 ouch
632 ) ;
633 }
634 }
635
636
637 else {
638 throw new CommunityServiceException(
639 "Service not initialised"
640 ) ;
641 }
642 }
643
644 /***
645 * Request a list of local Groups.
646 * @return An array of GroupData objects.
647 * @throws CommunityServiceException If there is an internal error in the service.
648 *
649 */
650 public Object[] getLocalGroups()
651 throws CommunityServiceException
652 {
653
654
655 if (null != this.manager)
656 {
657
658
659 try {
660 return this.manager.getLocalGroups() ;
661 }
662
663
664 catch (RemoteException ouch)
665 {
666
667
668 serviceException(ouch) ;
669
670
671 throw new CommunityServiceException(
672 "WebService call failed - " + ouch,
673 ouch
674 ) ;
675 }
676 }
677
678
679 else {
680 throw new CommunityServiceException(
681 "Service not initialised"
682 ) ;
683 }
684 }
685
686 /***
687 * Request a list of local Groups that an Account belongs to, given the Account ident.
688 * @param account The Account ifentifier.
689 * @return An array of GroupData objects.
690 * @throws CommunityServiceException If there is an internal error in the service.
691 *
692 */
693 public Object[] getLocalAccountGroups(String account)
694 throws CommunityServiceException, CommunityIdentifierException
695 {
696
697
698 if (null != this.manager)
699 {
700
701
702 try {
703 return this.manager.getLocalAccountGroups(account) ;
704 }
705
706
707 catch (RemoteException ouch)
708 {
709
710
711 serviceException(ouch) ;
712 identifierException(ouch) ;
713
714
715 throw new CommunityServiceException(
716 "WebService call failed - " + ouch,
717 ouch
718 ) ;
719 }
720 }
721
722
723 else {
724 throw new CommunityServiceException(
725 "Service not initialised"
726 ) ;
727 }
728 }
729
730 /***
731 * Register a new Resource.
732 * @return A new ResourceData object to represent the resource.
733 * @throws CommunityServiceException If there is an internal error in the service.
734 *
735 */
736 public ResourceData addResource()
737 throws CommunityServiceException
738 {
739
740
741 if (null != this.manager)
742 {
743
744
745 try {
746 return this.manager.addResource() ;
747 }
748
749
750 catch (RemoteException ouch)
751 {
752
753
754 serviceException(ouch) ;
755
756
757 throw new CommunityServiceException(
758 "WebService call failed - " + ouch,
759 ouch
760 ) ;
761 }
762 }
763
764
765 else {
766 throw new CommunityServiceException(
767 "Service not initialised"
768 ) ;
769 }
770 }
771
772 /***
773 * Request the details for a Resource.
774 * @param The resource identifier.
775 * @return The requested ResourceData object.
776 * @throws CommunityResourceException If unable to locate the resource.
777 * @throws CommunityServiceException If there is an internal error in the service.
778 * @throws CommunityIdentifierException If the resource identifier is not valid.
779 *
780 */
781 public ResourceData getResource(String ident)
782 throws CommunityIdentifierException, CommunityResourceException, CommunityServiceException
783 {
784
785
786 if (null != this.manager)
787 {
788
789
790 try {
791 return this.manager.getResource(ident) ;
792 }
793
794
795 catch (RemoteException ouch)
796 {
797
798
799 serviceException(ouch) ;
800 resourceException(ouch) ;
801 identifierException(ouch) ;
802
803
804 throw new CommunityServiceException(
805 "WebService call failed - " + ouch,
806 ouch
807 ) ;
808 }
809 }
810
811
812 else {
813 throw new CommunityServiceException(
814 "Service not initialised"
815 ) ;
816 }
817 }
818
819 /***
820 * Request the details for a Resource.
821 * @param The resource identifier.
822 * @return The requested ResourceData object.
823 * @throws CommunityResourceException If unable to locate the resource.
824 * @throws CommunityServiceException If there is an internal error in the service.
825 * @throws CommunityIdentifierException If the resource identifier is not valid.
826 *
827 */
828 public Object[] getResources()
829 {
830
831
832 if (null != this.manager)
833 {
834
835
836 try {
837 return this.manager.getResources() ;
838 }
839
840
841 catch (RemoteException ouch)
842 {
843
844
845
846
847
848 }
849 }
850 return null;
851 }
852
853
854 /***
855 * Update the details for a Resource.
856 * @param The ResourceData to update.
857 * @return The updated ResourceData.
858 * @throws CommunityResourceException If unable to locate the resource.
859 * @throws CommunityServiceException If there is an internal error in the service.
860 * @throws CommunityIdentifierException If the resource identifier is not valid.
861 *
862 */
863 public ResourceData setResource(ResourceData resource)
864 throws CommunityIdentifierException, CommunityResourceException, CommunityServiceException
865 {
866
867
868 if (null != this.manager)
869 {
870
871
872 try {
873 return this.manager.setResource(resource) ;
874 }
875
876
877 catch (RemoteException ouch)
878 {
879
880
881 serviceException(ouch) ;
882 resourceException(ouch) ;
883 identifierException(ouch) ;
884
885
886 throw new CommunityServiceException(
887 "WebService call failed - " + ouch,
888 ouch
889 ) ;
890 }
891 }
892
893
894 else {
895 throw new CommunityServiceException(
896 "Service not initialised"
897 ) ;
898 }
899 }
900
901 /***
902 * Delete a Resource.
903 * @param The resource identifier.
904 * @return The original ResourceData.
905 * @throws CommunityResourceException If unable to locate the resource.
906 * @throws CommunityServiceException If there is an internal error in the service.
907 * @throws CommunityIdentifierException If the identifier is not valid.
908 *
909 */
910 public ResourceData delResource(String ident)
911 throws CommunityIdentifierException, CommunityResourceException, CommunityServiceException
912 {
913
914
915 if (null != this.manager)
916 {
917
918
919 try {
920 return this.manager.delResource(ident) ;
921 }
922
923
924 catch (RemoteException ouch)
925 {
926
927
928 serviceException(ouch) ;
929 resourceException(ouch) ;
930 identifierException(ouch) ;
931
932
933 throw new CommunityServiceException(
934 "WebService call failed - " + ouch,
935 ouch
936 ) ;
937 }
938 }
939
940
941 else {
942 throw new CommunityServiceException(
943 "Service not initialised"
944 ) ;
945 }
946 }
947
948 /***
949 * Create a new PolicyPermission.
950 * @todo Better Exception handling.
951 *
952 */
953 public PolicyPermission addPermission(String resource, String group, String action)
954 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
955 {
956 PolicyPermission result = null ;
957
958
959 if (null != this.manager)
960 {
961
962
963 try {
964 result = this.manager.addPermission(resource, group, action) ;
965 }
966
967
968 catch (RemoteException ouch)
969 {
970
971
972
973 }
974 }
975 return result ;
976 }
977
978 /***
979 * Request a PolicyPermission.
980 * @todo Better Exception handling.
981 *
982 */
983 public PolicyPermission getPermission(String resource, String group, String action)
984 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
985 {
986 PolicyPermission result = null ;
987
988
989 if (null != this.manager)
990 {
991
992
993 try {
994 result = this.manager.getPermission(resource, group, action) ;
995 }
996
997
998 catch (RemoteException ouch)
999 {
1000
1001
1002
1003 }
1004 }
1005 return result ;
1006 }
1007
1008 /***
1009 * Request a PolicyPermission.
1010 * @todo Better Exception handling.
1011 *
1012 */
1013 public Object[] getPermissions()
1014 {
1015 Object[] result = null ;
1016
1017
1018 if (null != this.manager)
1019 {
1020
1021
1022 try {
1023 result = this.manager.getPermissions();
1024 }
1025
1026
1027 catch (RemoteException ouch)
1028 {
1029
1030
1031
1032 }
1033 }
1034 return result ;
1035 }
1036
1037
1038 /***
1039 * Update a PolicyPermission.
1040 * @todo Better Exception handling.
1041 *
1042 */
1043 public PolicyPermission setPermission(PolicyPermission permission)
1044 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
1045 {
1046 PolicyPermission result = null ;
1047
1048
1049 if (null != this.manager)
1050 {
1051
1052
1053 try {
1054 result = this.manager.setPermission(permission) ;
1055 }
1056
1057
1058 catch (RemoteException ouch)
1059 {
1060
1061
1062
1063 }
1064 }
1065 return result ;
1066 }
1067
1068 /***
1069 * Delete a PolicyPermission.
1070 * @todo Better Exception handling.
1071 *
1072 */
1073 public boolean delPermission(String resource, String group, String action)
1074 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
1075 {
1076 boolean result = false ;
1077
1078
1079 if (null != this.manager)
1080 {
1081
1082
1083 try {
1084 result = this.manager.delPermission(resource, group, action) ;
1085 }
1086
1087
1088 catch (RemoteException ouch)
1089 {
1090
1091
1092
1093 }
1094 }
1095 return result ;
1096 }
1097
1098 /***
1099 * Add an Account to a Group.
1100 * The group must be local, but Account can be local or remote.
1101 * @param account The Account identifier.
1102 * @param group The Group identifier.
1103 * @return An GroupMemberData to confirm the membership.
1104 * @throws CommunityIdentifierException If one of the identifiers is not valid.
1105 * @throws CommunityPolicyException If one the identifiers is not in the database.
1106 * @throws CommunityServiceException If there is an internal error in the service.
1107 *
1108 */
1109 public GroupMemberData addGroupMember(String account, String group)
1110 throws CommunityServiceException, CommunityIdentifierException, CommunityPolicyException
1111 {
1112
1113
1114 if (null != this.manager)
1115 {
1116
1117
1118 try {
1119 return this.manager.addGroupMember(account, group) ;
1120 }
1121
1122
1123 catch (RemoteException ouch)
1124 {
1125
1126
1127 policyException(ouch) ;
1128 serviceException(ouch) ;
1129 identifierException(ouch) ;
1130
1131
1132 throw new CommunityServiceException(
1133 "WebService call failed - " + ouch,
1134 ouch
1135 ) ;
1136 }
1137 }
1138
1139
1140 else {
1141 throw new CommunityServiceException(
1142 "Service not initialised"
1143 ) ;
1144 }
1145 }
1146
1147 /***
1148 * Remove an Account from a Group.
1149 * The group must be local, but Account can be local or remote.
1150 * @param account The Account identifier.
1151 * @param group The Group identifier.
1152 * @return A GroupMemberData to confirm the membership.
1153 * @throws CommunityIdentifierException If one of the identifiers is not valid.
1154 * @throws CommunityPolicyException If one the identifiers is not in the database.
1155 * @throws CommunityServiceException If there is an internal error in the service.
1156 *
1157 */
1158 public GroupMemberData delGroupMember(String account, String group)
1159 throws CommunityServiceException, CommunityPolicyException, CommunityIdentifierException
1160 {
1161
1162
1163 if (null != this.manager)
1164 {
1165
1166
1167 try {
1168 return this.manager.delGroupMember(account, group) ;
1169 }
1170
1171
1172 catch (RemoteException ouch)
1173 {
1174
1175
1176 policyException(ouch) ;
1177 serviceException(ouch) ;
1178 identifierException(ouch) ;
1179
1180
1181 throw new CommunityServiceException(
1182 "WebService call failed - " + ouch,
1183 ouch
1184 ) ;
1185 }
1186 }
1187
1188
1189 else {
1190 throw new CommunityServiceException(
1191 "Service not initialised"
1192 ) ;
1193 }
1194 }
1195
1196 /***
1197 * Request a list of Group members.
1198 * The group must be local.
1199 * @param group The Group identifier.
1200 * @return An array of GroupMemberData objects..
1201 * @throws CommunityIdentifierException If one of the identifiers is not valid.
1202 * @throws CommunityPolicyException If one the identifiers is not in the database.
1203 * @throws CommunityServiceException If there is an internal error in the service.
1204 *
1205 */
1206 public Object[] getGroupMembers(String group)
1207 throws CommunityServiceException, CommunityPolicyException, CommunityIdentifierException
1208 {
1209
1210
1211 if (null != this.manager)
1212 {
1213
1214
1215 try {
1216 return this.manager.getGroupMembers(group) ;
1217 }
1218
1219
1220 catch (RemoteException ouch)
1221 {
1222
1223
1224 policyException(ouch) ;
1225 serviceException(ouch) ;
1226 identifierException(ouch) ;
1227
1228
1229 throw new CommunityServiceException(
1230 "WebService call failed - " + ouch,
1231 ouch
1232 ) ;
1233 }
1234 }
1235
1236
1237 else {
1238 throw new CommunityServiceException(
1239 "Service not initialised"
1240 ) ;
1241 }
1242 }
1243
1244 /***
1245 * Request a list of Group members.
1246 * The group must be local.
1247 * @param group The Group identifier.
1248 * @return An array of GroupMemberData objects..
1249 * @throws CommunityIdentifierException If one of the identifiers is not valid.
1250 * @throws CommunityPolicyException If one the identifiers is not in the database.
1251 * @throws CommunityServiceException If there is an internal error in the service.
1252 *
1253 */
1254 public GroupMemberData getGroupMember(String account, String group)
1255 throws CommunityServiceException, CommunityPolicyException, CommunityIdentifierException
1256 {
1257
1258
1259 if (null != this.manager)
1260 {
1261
1262
1263 try {
1264 return this.manager.getGroupMember(account,group) ;
1265 }
1266
1267
1268 catch (RemoteException ouch)
1269 {
1270
1271
1272 policyException(ouch) ;
1273 serviceException(ouch) ;
1274 identifierException(ouch) ;
1275
1276
1277 throw new CommunityServiceException(
1278 "WebService call failed - " + ouch,
1279 ouch
1280 ) ;
1281 }
1282 }
1283
1284
1285 else {
1286 throw new CommunityServiceException(
1287 "Service not initialised"
1288 ) ;
1289 }
1290 }
1291
1292 /***
1293 * Request a list of Group members.
1294 * The group must be local.
1295 * @param group The Group identifier.
1296 * @return An array of GroupMemberData objects..
1297 * @throws CommunityIdentifierException If one of the identifiers is not valid.
1298 * @throws CommunityPolicyException If one the identifiers is not in the database.
1299 * @throws CommunityServiceException If there is an internal error in the service.
1300 *
1301 */
1302 public Object[] getGroupMembers()
1303 throws CommunityServiceException, CommunityPolicyException, CommunityIdentifierException
1304 {
1305
1306
1307 if (null != this.manager)
1308 {
1309
1310
1311 try {
1312 return this.manager.getGroupMembers() ;
1313 }
1314
1315
1316 catch (RemoteException ouch)
1317 {
1318
1319
1320 policyException(ouch) ;
1321 serviceException(ouch) ;
1322 identifierException(ouch) ;
1323
1324
1325 throw new CommunityServiceException(
1326 "WebService call failed - " + ouch,
1327 ouch
1328 ) ;
1329 }
1330 }
1331
1332
1333 else {
1334 throw new CommunityServiceException(
1335 "Service not initialised"
1336 ) ;
1337 }
1338 }
1339
1340
1341 }