001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999-2004 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer(s): Bruno Michel, Guillaume Riviere
022: *
023: * --------------------------------------------------------------------------
024: * $Id: JonasSecurityServiceImplMBean.java 4578 2004-04-09 09:58:27Z benoitf $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas.security;
027:
028: import java.security.NoSuchAlgorithmException;
029:
030: /**
031: * MBean interface for Security Service Management
032: * MBean type: Standard
033: * MBean model: Inheritance (JonasSecurityServiceImpl)
034: * @author Bruno Michel, Guillaume Riviere
035: * @author Florent Benoit : add MBean methods
036: */
037: public interface JonasSecurityServiceImplMBean {
038:
039: /**
040: * Encrypt a string with an algorithm
041: * @param string the string to encode
042: * @param algo algorithm to apply on the given string
043: * @return the encoded string
044: * @throws NoSuchAlgorithmException One reason could be a bad algorithm
045: */
046: String encryptPassword(String string, String algo)
047: throws NoSuchAlgorithmException;
048:
049: /**
050: * Add JResources with a given xml configuration
051: * @param xml xml representation of the resources to add
052: * @throws Exception if the resources can't be added
053: */
054: void addResources(String xml) throws Exception;
055:
056: /**
057: * Remove the Resource (memory, ldap, datasource,...)
058: * @param resourceName name of the resource
059: * @throws Exception if the resource name does not exist
060: */
061: void removeJResource(String resourceName) throws Exception;
062:
063: /**
064: * Check if the given algorithm is a valid algorithm
065: * @param algo algorithm to apply on the given string
066: * @return true if it is a valid algorithm
067: */
068: boolean isValidAlgorithm(String algo);
069:
070: /**
071: * Add a Memory resource
072: * @param name the name of the JResourceMemory to create
073: * @throws Exception if the resource can't be added
074: */
075: void addJResourceMemory(String name) throws Exception;
076:
077: /**
078: * Add a DS resource
079: * @param name the name of the JResourceDS to create
080: * @param dsName Name of the datasource resource to use.
081: * @param userTable Name of table which have the username/password
082: * @param userTableUsernameCol Column of the username of the user table
083: * @param userTablePasswordCol Column of the password of the user table
084: * @param roleTable Name of table which have the username/role
085: * @param roleTableUsernameCol Column of the username of the role table
086: * @param roleTableRolenameCol Column of the role of the role table
087: * @param algorithm Default algorithm. If specified, the default is not 'clear' password
088: * @throws Exception if the resource can't be added
089: */
090: void addJResourceDS(String name, String dsName, String userTable,
091: String userTableUsernameCol, String userTablePasswordCol,
092: String roleTable, String roleTableUsernameCol,
093: String roleTableRolenameCol, String algorithm)
094: throws Exception;
095:
096: /**
097: * Add a LDAP resource
098: * @param name the name of the JResourceLDAP to create
099: * @param initialContextFactory Initial context factory for the LDAp server
100: * @param providerUrl Url of the ldap server
101: * @param securityAuthentication Type of the authentication used during the authentication to the LDAP server
102: * @param securityPrincipal DN of the Principal(username). He can retrieve the information from the user
103: * @param securityCredentials Credential(password) of the principal
104: * @param securityProtocol Constant that holds the name of the environment property for specifying the security protocol to use.
105: * @param language Constant that holds the name of the environment property for specifying the preferred language to use with the service.
106: * @param referral Constant that holds the name of the environment property for specifying how referrals encountered by the service provider are to be processed.
107: * @param stateFactories Constant that holds the name of the environment property for specifying the list of state factories to use.
108: * @param authenticationMode Mode for validate the authentication (BIND_AUTHENTICATION_MODE or COMPARE_AUTHENTICATION_MODE)
109: * @param userPasswordAttribute Attribute in order to get the password from the ldap server
110: * @param userRolesAttribute Attribute in order to get the user role from the ldap server
111: * @param roleNameAttribute Attribute for the role name when performing a lookup on a role
112: * @param baseDN DN used for the lookup
113: * @param userDN DN used when searching the user DN. Override the baseDN if it is defined
114: * @param userSearchFilter Filter used when searching the user
115: * @param roleDN DN used when searching the role DN. Override the baseDN if it is defined
116: * @param roleSearchFilter Filter used when searching the role
117: * @param algorithm Default algorithm. If specified, the default is not 'clear' password
118: * @throws Exception if the resource can't be added
119: */
120: void addJResourceLDAP(String name, String initialContextFactory,
121: String providerUrl, String securityAuthentication,
122: String securityPrincipal, String securityCredentials,
123: String securityProtocol, String language, String referral,
124: String stateFactories, String authenticationMode,
125: String userPasswordAttribute, String userRolesAttribute,
126: String roleNameAttribute, String baseDN, String userDN,
127: String userSearchFilter, String roleDN,
128: String roleSearchFilter, String algorithm) throws Exception;
129:
130: }
|