01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999-2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or 1any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * Initial developer: Florent Benoit
22: * --------------------------------------------------------------------------
23: * $Id: JResourceMemoryMBean.java 4804 2004-05-25 15:13:29Z benoitf $
24: * --------------------------------------------------------------------------
25: */package org.objectweb.jonas.security.realm.factory;
26:
27: /**
28: * Define the methods for the MBean
29: * @author Florent Benoit
30: */
31: public interface JResourceMemoryMBean extends JResourceMBean {
32:
33: /**
34: * Add a user with a given principal and credential
35: * @param username the name of the user
36: * @param password password of the user
37: * @throws Exception if the user already exists
38: */
39: void addUser(String username, String password) throws Exception;
40:
41: /**
42: * Add a group with a given name
43: * @param groupname the name of the group
44: * @throws Exception if the group already exists
45: */
46: void addGroup(String groupname) throws Exception;
47:
48: /**
49: * Add a role with a given name
50: * @param rolename the name of the role
51: * @throws Exception if the role already exists
52: */
53: void addRole(String rolename) throws Exception;
54:
55: /**
56: * Remove a user with a given principal and credential
57: * @param username the name of the user
58: * @throws Exception if the user was not found
59: */
60: void removeUser(String username) throws Exception;
61:
62: /**
63: * Remove a group with a given name
64: * @param groupname the name of the group
65: * @throws Exception if the group was not found
66: */
67: void removeGroup(String groupname) throws Exception;
68:
69: /**
70: * Remove a role with a given name
71: * @param rolename the name of the role
72: * @throws Exception if the role was not found
73: */
74: void removeRole(String rolename) throws Exception;
75:
76: /**
77: * Get the roles
78: * @return the array of the roles
79: */
80: String[] listRoles();
81:
82: /**
83: * Get the groups
84: * @return the array of the groups
85: */
86: String[] listGroups();
87:
88: }
|