KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mr > kernel > security > impl > management > jmx > SecurityManagementJMX


1 package org.mr.kernel.security.impl.management.jmx;
2
3 import org.mr.kernel.security.*;
4 import org.mr.MantaAgent;
5 import org.apache.commons.logging.Log;
6 import org.apache.commons.logging.LogFactory;
7
8 import javax.management.*;
9 import javax.jms.JMSSecurityException JavaDoc;
10
11 import org.mr.kernel.security.impl.management.*;
12 import org.mr.kernel.security.authorization.PermissionFactory;
13 import org.mr.kernel.security.authorization.permissions.MantaPermission;
14
15 import java.util.Collection JavaDoc;
16
17 /**
18  * The managed obect that is used to perform security management actions.
19  *
20  * @author Shirley Sasson
21  * @version 1.0
22  * @since May 22, 2006
23  */

24 public class SecurityManagementJMX extends StandardMBean implements SecurityManagementJMXMBean, SecurityConfigurationPaths, SecurityConstants {
25
26     private MantaAuthentication _authentication;
27     private ACLManagement _management;
28     private Log _logger;
29
30     /**
31      * Constructs a SecurityManagementJMX with the ACLManagement instance given.
32      * It creates a new instance of MantaAuthentication interface, according to the configuration.
33      * It uses the instance of ACLManagement interface given as parameter.
34      *
35      * @param management the instance of ACLManagement interface to use for management
36      * @throws NotCompliantMBeanException if the SecurityManagementJMXMBean does not follow JMX design patterns for Management
37      * Interfaces, or if this does not implement the specified interface.
38      */

39     public SecurityManagementJMX(ACLManagement management) throws NotCompliantMBeanException {
40         super(SecurityManagementJMXMBean.class);
41
42         String JavaDoc authenticationImplementationClass = MantaAgent.getInstance().getSingletonRepository().getConfigManager().getStringProperty(AUTHENTICATION_IMPLEMENTING_CLASS);
43
44         try {
45             if (authenticationImplementationClass != null)
46                 _authentication = (MantaAuthentication) Class.forName(authenticationImplementationClass).newInstance();
47
48             _management = management;
49         }
50         catch (Exception JavaDoc e){
51             if (getLogger().isErrorEnabled())
52                 getLogger().error("[SecurityManagementJMX] Error in constructor. " + e.getMessage());
53             throw new NotCompliantMBeanException(e.getMessage());
54         }
55     }
56
57     /**
58      * Creates a new user principal.
59      *
60      * @param authenticationUsername the authentication username
61      * @param authenticationPassword the authentication password
62      * @param newUsername username for new user
63      * @param newUserGroup group of new user
64      * @param newUserPassword password for new user
65      * @param newUserGIDNumber GID for new user
66      * @param newUserUIDNumber UID for new user
67      * @param newUserSurname surname for new user
68      * @param newUserCommonName common name for new user
69      * @throws PrincipalAlreadyExistsException if a user with this username already exists
70      * @throws PrincipalNotFoundException if a group with the name specified in newUserGroup doesn't exist
71      * @throws MantaSecurityException if an error occured
72      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
73      */

74     public void createUserPrincipal(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc newUsername, String JavaDoc newUserGroup, String JavaDoc newUserPassword, int newUserGIDNumber, int newUserUIDNumber, String JavaDoc newUserSurname, String JavaDoc newUserCommonName) throws PrincipalAlreadyExistsException, PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
75         SessionID sessionID = null;
76         try {
77             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
78             UserPrincipal user = new UserPrincipal(newUsername);
79             user.setProperty(PROPERTY_USER_UID, newUsername);
80             user.setProperty(PROPERTY_USER_GROUP, newUserGroup);
81             user.setProperty(PROPERTY_USER_PASSWORD, newUserPassword);
82             user.setProperty(PROPERTY_USER_GID_NUMBER, newUserGIDNumber+"");
83             user.setProperty(PROPERTY_USER_UID_NUMBER, newUserUIDNumber+"");
84             user.setProperty(PROPERTY_USER_SURNAME, newUserSurname);
85             user.setProperty(PROPERTY_USER_COMMON_NAME, newUserCommonName);
86             _management.createPrincipal(sessionID, user);
87         }
88         finally {
89             if (sessionID != null)
90                 _authentication.logout(sessionID);
91         }
92     }
93
94     /**
95      * Creates a new group principal.
96      *
97      * @param authenticationUsername the authentication username
98      * @param authenticationPassword the authentication password
99      * @param newGroupName name of new group
100      * @throws PrincipalAlreadyExistsException if a group with this name already exists
101      * @throws MantaSecurityException if an error occured
102      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
103      */

104     public void createGroupPrincipal(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc newGroupName) throws PrincipalAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc {
105         SessionID sessionID = null;
106         try {
107             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
108             GroupPrincipal group = new GroupPrincipal(newGroupName);
109             try {
110                 _management.createPrincipal(sessionID, group);
111             }
112             catch (PrincipalNotFoundException e) {}
113         }
114         finally {
115             if (sessionID != null)
116                 _authentication.logout(sessionID);
117         }
118     }
119
120     /**
121      * Renames a user principal.
122      *
123      * @param authenticationUsername the authentication username
124      * @param authenticationPassword the authentication password
125      * @param oldUsername username to rename
126      * @param newUsername new username
127      * @throws PrincipalNotFoundException if the username to rename is not found
128      * @throws PrincipalAlreadyExistsException if the new username specified already exists
129      * @throws MantaSecurityException if an error occured
130      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
131      */

132     public void renameUserPrincipal(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc oldUsername, String JavaDoc newUsername) throws PrincipalNotFoundException, PrincipalAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc {
133         SessionID sessionID = null;
134         try {
135             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
136             UserPrincipal user = new UserPrincipal(oldUsername);
137             _management.renamePrincipal(sessionID, user, newUsername);
138         }
139         finally {
140             if (sessionID != null)
141                 _authentication.logout(sessionID);
142         }
143     }
144
145     /**
146      * Renames a group principal.
147      *
148      * @param authenticationUsername the authentication username
149      * @param authenticationPassword the authentication password
150      * @param oldGroupName name of group to rename
151      * @param newGroupName new group name
152      * @throws PrincipalNotFoundException if the group to rename is not found
153      * @throws PrincipalAlreadyExistsException if the new group name specified already exists
154      * @throws MantaSecurityException if an error occured
155      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
156      */

157     public void renameGroupPrincipal(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc oldGroupName, String JavaDoc newGroupName) throws PrincipalNotFoundException, PrincipalAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc {
158         SessionID sessionID = null;
159         try {
160             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
161             GroupPrincipal group = new GroupPrincipal(oldGroupName);
162             _management.renamePrincipal(sessionID, group, newGroupName);
163         }
164         finally {
165             if (sessionID != null)
166                 _authentication.logout(sessionID);
167         }
168     }
169
170     /**
171      * Sets a group of a user.
172      *
173      * @param authenticationUsername the authentication username
174      * @param authenticationPassword the authentication password
175      * @param username username to set the group for
176      * @param groupName new name of group for user
177      * @throws PrincipalNotFoundException if the user name or the group doesn't exist
178      * @throws MantaSecurityException if an error occured
179      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
180      */

181     public void setUserGroup(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc username, String JavaDoc groupName) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
182         SessionID sessionID = null;
183         try {
184             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
185             UserPrincipal user = new UserPrincipal(username);
186             _management.setUserGroup(sessionID, user, groupName);
187         }
188         finally {
189             if (sessionID != null)
190                 _authentication.logout(sessionID);
191         }
192     }
193
194     /**
195      * Sets a password of a user.
196      *
197      * @param authenticationUsername the authentication username
198      * @param authenticationPassword the authentication password
199      * @param username username to set the group for
200      * @param password new password for user
201      * @throws PrincipalNotFoundException if the user doesn't exist
202      * @throws MantaSecurityException if an error occured
203      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
204      */

205     public void setUserPassword(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc username, String JavaDoc password) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
206         SessionID sessionID = null;
207         try {
208             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
209             UserPrincipal user = new UserPrincipal(username);
210             _management.setUserPassword(sessionID, user, password);
211         }
212         finally {
213             if (sessionID != null)
214                 _authentication.logout(sessionID);
215         }
216     }
217
218     /**
219      * Creates a new permission for a user principal.
220      *
221      * @param authenticationUsername the authentication username
222      * @param authenticationPassword the authentication password
223      * @param permissionName name of permission to add
224      * @param permissionParam String parameter for permission
225      * @param username username to add the permission for
226      * @throws PrincipalNotFoundException if username specified isn't found
227      * @throws PermissionAlreadyExistsException is permission to add already exists
228      * @throws MantaSecurityException if an error occured
229      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
230      */

231     public void createPermissionForUser(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc permissionName, String JavaDoc permissionParam, String JavaDoc username) throws PrincipalNotFoundException, PermissionAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc {
232         SessionID sessionID = null;
233         try {
234             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
235             MantaPermission p = PermissionFactory.getInstance().getPermission(permissionName, permissionParam);
236             UserPrincipal user = new UserPrincipal(username);
237             _management.createPermission(sessionID, p, user);
238         }
239         finally {
240             if (sessionID != null)
241                 _authentication.logout(sessionID);
242         }
243     }
244
245     /**
246      * Creates a new permission for a group principal.
247      *
248      * @param authenticationUsername the authentication username
249      * @param authenticationPassword the authentication password
250      * @param permissionName name of permission to add
251      * @param permissionParam String parameter for permission
252      * @param groupName name of group to add the permission for
253      * @throws PrincipalNotFoundException if group name specified isn't found
254      * @throws PermissionAlreadyExistsException is permission to add already exists
255      * @throws MantaSecurityException if an error occured
256      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
257      */

258     public void createPermissionForGroup(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc permissionName, String JavaDoc permissionParam, String JavaDoc groupName) throws PrincipalNotFoundException, PermissionAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc {
259         SessionID sessionID = null;
260         try {
261             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
262             MantaPermission p = PermissionFactory.getInstance().getPermission(permissionName, permissionParam);
263             GroupPrincipal group = new GroupPrincipal(groupName);
264             _management.createPermission(sessionID, p, group);
265         }
266         finally {
267             if (sessionID != null)
268                 _authentication.logout(sessionID);
269         }
270     }
271
272     /**
273      * Returns the list of all permissions for a specific user principal.
274      *
275      * @param authenticationUsername the authentication username
276      * @param authenticationPassword the authentication password
277      * @param username the username for whom to retrieve the list of permissions
278      * @return a collection of all permissions for a the user specified
279      * @throws PrincipalNotFoundException if the username specified doesn't exist
280      * @throws MantaSecurityException if an error occured
281      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
282      */

283     public Collection JavaDoc getPermissionsForUser(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc username) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
284         SessionID sessionID = null;
285         try {
286             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
287             UserPrincipal user = new UserPrincipal(username);
288             return _management.getPermissionsForPrincipal(sessionID, user);
289         }
290         finally {
291             if (sessionID != null)
292                 _authentication.logout(sessionID);
293         }
294     }
295
296     /**
297      * Returns the list of all permissions for a specific group principal.
298      *
299      * @param authenticationUsername the authentication username
300      * @param authenticationPassword the authentication password
301      * @param groupName the group for which to retrieve the list of permissions
302      * @return a collection of all permissions for a the group specified
303      * @throws PrincipalNotFoundException if the group specified doesn't exist
304      * @throws MantaSecurityException if an error occured
305      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
306      */

307     public Collection JavaDoc getPermissionsForGroup(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc groupName) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
308         SessionID sessionID = null;
309         try {
310             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
311             GroupPrincipal group = new GroupPrincipal(groupName);
312             return _management.getPermissionsForPrincipal(sessionID, group);
313         }
314         finally {
315             if (sessionID != null)
316                 _authentication.logout(sessionID);
317         }
318     }
319
320     /**
321      * Deletes a user principal.
322      *
323      * @param authenticationUsername the authentication username
324      * @param authenticationPassword the authentication password
325      * @param username the username to delete
326      * @throws PrincipalNotFoundException if this user is not found
327      * @throws MantaSecurityException if an error occured
328      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
329      */

330     public void deleteUser(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc username) throws PrincipalNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
331         SessionID sessionID = null;
332         try {
333             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
334             UserPrincipal user = new UserPrincipal(username);
335             _management.deletePrincipal(sessionID, user);
336         }
337         catch (GroupNotEmptyException e){}
338         finally {
339             if (sessionID != null)
340                 _authentication.logout(sessionID);
341         }
342     }
343
344     /**
345      * Deletes a group principal.
346      *
347      * @param authenticationUsername the authentication username
348      * @param authenticationPassword the authentication password
349      * @param groupName the name of the group to delete
350      * @throws PrincipalNotFoundException if this user is not found
351      * @throws GroupNotEmptyException if the group to delete has users related to it and so cannot be deleted
352      * @throws MantaSecurityException if an error occured
353      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
354      */

355     public void deleteGroup(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc groupName) throws PrincipalNotFoundException, GroupNotEmptyException, MantaSecurityException, JMSSecurityException JavaDoc {
356         SessionID sessionID = null;
357         try {
358             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
359             GroupPrincipal group = new GroupPrincipal(groupName);
360             _management.deletePrincipal(sessionID, group);
361         }
362         finally {
363             if (sessionID != null)
364                 _authentication.logout(sessionID);
365         }
366     }
367
368     /**
369      * Deletes a permission for user principal.
370      *
371      * @param authenticationUsername the authentication username
372      * @param authenticationPassword the authentication password
373      * @param permissionName the permission to delete
374      * @param permissionParam String permission param
375      * @param username the username for whom the permission relates to
376      * @throws PermissionNotFoundException if this permission is not found
377      * @throws MantaSecurityException if an error occured
378      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
379      */

380     public void deletePermissionForUser(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc permissionName, String JavaDoc permissionParam, String JavaDoc username) throws PermissionNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
381         SessionID sessionID = null;
382         try {
383             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
384             UserPrincipal user = new UserPrincipal(username);
385             MantaPermission p = PermissionFactory.getInstance().getPermission(permissionName, permissionParam);
386             _management.deletePermission(sessionID, p, user);
387         }
388         finally {
389             if (sessionID != null)
390                 _authentication.logout(sessionID);
391         }
392     }
393
394     /**
395      * Deletes a permission for group principal.
396      *
397      * @param authenticationUsername the authentication username
398      * @param authenticationPassword the authentication password
399      * @param permissionName the permission to delete
400      * @param permissionParam String permission param
401      * @param groupName the name of the group for which the permission relates to
402      * @throws PermissionNotFoundException if this permission is not found
403      * @throws MantaSecurityException if an error occured
404      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
405      */

406     public void deletePermissionForGroup(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc permissionName, String JavaDoc permissionParam, String JavaDoc groupName) throws PermissionNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
407         SessionID sessionID = null;
408         try {
409             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
410             GroupPrincipal group = new GroupPrincipal(groupName);
411             MantaPermission p = PermissionFactory.getInstance().getPermission(permissionName, permissionParam);
412             _management.deletePermission(sessionID, p, group);
413         }
414         finally {
415             if (sessionID != null)
416                 _authentication.logout(sessionID);
417         }
418     }
419
420     /**
421      * Creates a new white list entry.
422      *
423      * @param authenticationUsername the authentication username
424      * @param authenticationPassword the authentication password
425      * @param whiteListEntry the white list entry to add
426      * @throws WhiteListEntryAlreadyExistsException if this white list entry already exists
427      * @throws MantaSecurityException if an error occured
428      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
429      */

430     public void createWhiteListEntry(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc whiteListEntry) throws WhiteListEntryAlreadyExistsException, MantaSecurityException, JMSSecurityException JavaDoc {
431         SessionID sessionID = null;
432         try {
433             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
434             _management.createWhiteListEntry(sessionID, whiteListEntry);
435         }
436         finally {
437             if (sessionID != null)
438                 _authentication.logout(sessionID);
439         }
440     }
441
442     /**
443      * Deletes a white list entry.
444      *
445      * @param authenticationUsername the authentication username
446      * @param authenticationPassword the authentication password
447      * @param whiteListEntry the white list entry to delete
448      * @throws WhiteListEntryNotFoundException if this white list entry is not found
449      * @throws MantaSecurityException if an error occured
450      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
451      */

452     public void deleteWhiteListEntry(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword, String JavaDoc whiteListEntry) throws WhiteListEntryNotFoundException, MantaSecurityException, JMSSecurityException JavaDoc {
453         SessionID sessionID = null;
454         try {
455             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
456             _management.deleteWhiteListEntry(sessionID, whiteListEntry);
457         }
458         finally {
459             if (sessionID != null)
460                 _authentication.logout(sessionID);
461         }
462     }
463
464     /**
465      * Returns the list of all users.
466      *
467      * @param authenticationUsername the authentication username
468      * @param authenticationPassword the authentication password
469      * @return a list of all users
470      * @throws MantaSecurityException if an error occured
471      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
472      */

473     public Collection JavaDoc getUsers(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword) throws MantaSecurityException, JMSSecurityException JavaDoc {
474         SessionID sessionID = null;
475         try {
476             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
477             return _management.getUsers(sessionID);
478         }
479         finally {
480             if (sessionID != null)
481                 _authentication.logout(sessionID);
482         }
483     }
484
485     /**
486      * Returns the list of all groups.
487      *
488      * @param authenticationUsername the authentication username
489      * @param authenticationPassword the authentication password
490      * @return a list of all groups
491      * @throws MantaSecurityException if an error occured
492      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
493      */

494     public Collection JavaDoc getGroups(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword) throws MantaSecurityException, JMSSecurityException JavaDoc {
495         SessionID sessionID = null;
496         try {
497             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
498             return _management.getGroups(sessionID);
499         }
500         finally {
501             if (sessionID != null)
502                 _authentication.logout(sessionID);
503         }
504     }
505
506     /**
507      * Returns the list of all white list entries.
508      *
509      * @param authenticationUsername the authentication username
510      * @param authenticationPassword the authentication password
511      * @return a list of all white list entries
512      * @throws MantaSecurityException if an error occured
513      * @throws JMSSecurityException if action is unauthorized for the username specified in authenticationUsername
514      */

515     public Collection JavaDoc getWhiteList(String JavaDoc authenticationUsername, String JavaDoc authenticationPassword) throws MantaSecurityException, JMSSecurityException JavaDoc {
516         SessionID sessionID = null;
517         try {
518             sessionID = _authentication.authenticate(authenticationUsername, authenticationPassword);
519             return _management.getWhiteList(sessionID);
520         }
521         finally {
522             if (sessionID != null)
523                 _authentication.logout(sessionID);
524         }
525     }
526
527
528     /**
529      * Returns the description that will be used in the MBeanInfo returned by this MBean.
530      *
531      * @param mBeanInfo the default MBeanInfo derived by reflection
532      * @return the description for the new MBeanInfo
533      */

534     public String JavaDoc getDescription(MBeanInfo mBeanInfo) {
535         return "Used to manage security authentication and authorization.";
536     }
537
538
539     /**
540      * Returns the name that will be used for the sequence MBeanParameterInfo of the MBeanOperationInfo returned by this MBean.
541      *
542      * @param mBeanOperationInfo the default MBeanOperationInfo derived by reflection
543      * @param mBeanParameterInfo the default MBeanParameterInfo derived by reflection.
544      * @param i the sequence number of the parameter considered
545      * @return the name to use for the given MBeanParameterInfo
546      */

547     public String JavaDoc getParameterName(MBeanOperationInfo mBeanOperationInfo, MBeanParameterInfo mBeanParameterInfo, int i) {
548         if (i==0)
549             return " Authentication username";
550         else if (i==1)
551             return " Authentication password";
552
553         else if (mBeanOperationInfo.getName().equals("deletePermissionForGroup")){
554             if (i==2)
555                 return " Permission name";
556             else if (i==3)
557                 return " Permission parameter";
558             else if (i==4)
559                 return " Group name";
560         }
561         else if (mBeanOperationInfo.getName().equals("deletePermissionForUser")){
562             if (i==2)
563                 return " Permission name";
564             else if (i==3)
565                 return " Permission parameter";
566             else if (i==4)
567                 return " Username";
568         }
569         else if (mBeanOperationInfo.getName().equals("getPermissionsForGroup")){
570             if (i==2)
571                 return " Group name";
572         }
573         else if (mBeanOperationInfo.getName().equals("getPermissionsForUser")){
574             if (i==2)
575                 return " Username";
576         }
577         else if (mBeanOperationInfo.getName().equals("createPermissionForGroup")){
578             if (i==2)
579                 return " Permission name";
580             else if (i==3)
581                 return " Permission parameter";
582             else if (i==4)
583                 return " Group name";
584         }
585         else if (mBeanOperationInfo.getName().equals("createPermissionForUser")){
586             if (i==2)
587                 return " Permission name";
588             else if (i==3)
589                 return " Permission parameter";
590             else if (i==4)
591                 return " Username";
592         }
593         else if (mBeanOperationInfo.getName().equals("renameGroupPrincipal")){
594             if (i==2)
595                 return " Old group name";
596             else if (i==3)
597                 return " New group name";
598         }
599         else if (mBeanOperationInfo.getName().equals("renameUserPrincipal")){
600             if (i==2)
601                 return " Old username";
602             else if (i==3)
603                 return " New username";
604         }
605         else if (mBeanOperationInfo.getName().equals("deleteGroup")){
606             if (i==2)
607                 return " Group name";
608         }
609         else if (mBeanOperationInfo.getName().equals("deleteUser")){
610             if (i==2)
611                 return " Username";
612         }
613         else if (mBeanOperationInfo.getName().equals("createGroupPrincipal")){
614             if (i==2)
615                 return " Group name";
616         }
617         else if (mBeanOperationInfo.getName().equals("createUserPrincipal")){
618             if (i==2)
619                 return " UID for user";
620             else if (i==3)
621                 return " Group name for user";
622             else if (i==4)
623                 return " Password for new user";
624             else if (i==5)
625                 return " GID number for new user";
626             else if (i==6)
627                 return " UID number for new user";
628             else if (i==7)
629                 return " Surname for new user";
630             else if (i==8)
631                 return " Common name for new user";
632         }
633         else if (mBeanOperationInfo.getName().equals("getWhiteList")){}
634         else if (mBeanOperationInfo.getName().equals("getGroups")){}
635         else if (mBeanOperationInfo.getName().equals("deleteWhiteListEntry")){}
636         else if (mBeanOperationInfo.getName().equals("createWhiteListEntry")){}
637         else if (mBeanOperationInfo.getName().equals("setUserPassword")){}
638         else if (mBeanOperationInfo.getName().equals("setUserGroup")){}
639         else if (mBeanOperationInfo.getName().equals("getUsers")){}
640         return "";
641     }
642
643     /**
644      * Returns the instance of the logger for this class
645      *
646      * @return the instance of the logger
647      */

648     public Log getLogger(){
649         if (_logger == null){
650             _logger = LogFactory.getLog(getClass().getName());
651         }
652         return _logger;
653     }
654 }
655
Popular Tags