KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > security > JonasSecurityServiceImplMBean


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999-2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any 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(s): Bruno Michel, Guillaume Riviere
22  *
23  * --------------------------------------------------------------------------
24  * $Id: JonasSecurityServiceImplMBean.java,v 1.6 2004/04/09 09:58:27 benoitf Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas.security;
28
29 import java.security.NoSuchAlgorithmException JavaDoc;
30
31 /**
32  * MBean interface for Security Service Management
33  * MBean type: Standard
34  * MBean model: Inheritance (JonasSecurityServiceImpl)
35  * @author Bruno Michel, Guillaume Riviere
36  * @author Florent Benoit : add MBean methods
37  */

38 public interface JonasSecurityServiceImplMBean {
39
40     /**
41      * Encrypt a string with an algorithm
42      * @param string the string to encode
43      * @param algo algorithm to apply on the given string
44      * @return the encoded string
45      * @throws NoSuchAlgorithmException One reason could be a bad algorithm
46      */

47     String JavaDoc encryptPassword(String JavaDoc string, String JavaDoc algo) throws NoSuchAlgorithmException JavaDoc;
48
49
50     /**
51      * Add JResources with a given xml configuration
52      * @param xml xml representation of the resources to add
53      * @throws Exception if the resources can't be added
54      */

55     void addResources(String JavaDoc xml) throws Exception JavaDoc;
56
57     /**
58      * Remove the Resource (memory, ldap, datasource,...)
59      * @param resourceName name of the resource
60      * @throws Exception if the resource name does not exist
61      */

62     void removeJResource(String JavaDoc resourceName) throws Exception JavaDoc;
63
64     /**
65      * Check if the given algorithm is a valid algorithm
66      * @param algo algorithm to apply on the given string
67      * @return true if it is a valid algorithm
68      */

69     boolean isValidAlgorithm(String JavaDoc algo);
70
71     /**
72      * Add a Memory resource
73      * @param name the name of the JResourceMemory to create
74      * @throws Exception if the resource can't be added
75      */

76     void addJResourceMemory(String JavaDoc name) throws Exception JavaDoc;
77
78     /**
79      * Add a DS resource
80      * @param name the name of the JResourceDS to create
81      * @param dsName Name of the datasource resource to use.
82      * @param userTable Name of table which have the username/password
83      * @param userTableUsernameCol Column of the username of the user table
84      * @param userTablePasswordCol Column of the password of the user table
85      * @param roleTable Name of table which have the username/role
86      * @param roleTableUsernameCol Column of the username of the role table
87      * @param roleTableRolenameCol Column of the role of the role table
88      * @param algorithm Default algorithm. If specified, the default is not 'clear' password
89      * @throws Exception if the resource can't be added
90      */

91     void addJResourceDS(String JavaDoc name,
92                         String JavaDoc dsName,
93                         String JavaDoc userTable,
94                         String JavaDoc userTableUsernameCol,
95                         String JavaDoc userTablePasswordCol,
96                         String JavaDoc roleTable,
97                         String JavaDoc roleTableUsernameCol,
98                         String JavaDoc roleTableRolenameCol,
99                         String JavaDoc algorithm) throws Exception JavaDoc;
100
101
102     /**
103      * Add a LDAP resource
104      * @param name the name of the JResourceLDAP to create
105      * @param initialContextFactory Initial context factory for the LDAp server
106      * @param providerUrl Url of the ldap server
107      * @param securityAuthentication Type of the authentication used during the authentication to the LDAP server
108      * @param securityPrincipal DN of the Principal(username). He can retrieve the information from the user
109      * @param securityCredentials Credential(password) of the principal
110      * @param securityProtocol Constant that holds the name of the environment property for specifying the security protocol to use.
111      * @param language Constant that holds the name of the environment property for specifying the preferred language to use with the service.
112      * @param referral Constant that holds the name of the environment property for specifying how referrals encountered by the service provider are to be processed.
113      * @param stateFactories Constant that holds the name of the environment property for specifying the list of state factories to use.
114      * @param authenticationMode Mode for validate the authentication (BIND_AUTHENTICATION_MODE or COMPARE_AUTHENTICATION_MODE)
115      * @param userPasswordAttribute Attribute in order to get the password from the ldap server
116      * @param userRolesAttribute Attribute in order to get the user role from the ldap server
117      * @param roleNameAttribute Attribute for the role name when performing a lookup on a role
118      * @param baseDN DN used for the lookup
119      * @param userDN DN used when searching the user DN. Override the baseDN if it is defined
120      * @param userSearchFilter Filter used when searching the user
121      * @param roleDN DN used when searching the role DN. Override the baseDN if it is defined
122      * @param roleSearchFilter Filter used when searching the role
123      * @param algorithm Default algorithm. If specified, the default is not 'clear' password
124      * @throws Exception if the resource can't be added
125      */

126     void addJResourceLDAP(String JavaDoc name,
127                           String JavaDoc initialContextFactory,
128                           String JavaDoc providerUrl,
129                           String JavaDoc securityAuthentication,
130                           String JavaDoc securityPrincipal,
131                           String JavaDoc securityCredentials,
132                           String JavaDoc securityProtocol,
133                           String JavaDoc language,
134                           String JavaDoc referral,
135                           String JavaDoc stateFactories,
136                           String JavaDoc authenticationMode,
137                           String JavaDoc userPasswordAttribute,
138                           String JavaDoc userRolesAttribute,
139                           String JavaDoc roleNameAttribute,
140                           String JavaDoc baseDN,
141                           String JavaDoc userDN,
142                           String JavaDoc userSearchFilter,
143                           String JavaDoc roleDN,
144                           String JavaDoc roleSearchFilter,
145                           String JavaDoc algorithm) throws Exception JavaDoc;
146
147 }
148
Popular Tags