|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.ow2.jonas.lib.reconfig.ReconfigEmitter org.ow2.jonas.lib.service.AbsServiceImpl org.ow2.jonas.security.internal.JonasSecurityServiceImpl
public class JonasSecurityServiceImpl
Security Service implementation?
Field Summary | |
---|---|
protected static String |
CONFIG_FILE
Relative path of the realm configuration file. |
static String |
REMOTE_RESOUCE
Name of resource. |
Fields inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
Constructor Summary | |
---|---|
JonasSecurityServiceImpl()
|
Method Summary | |
---|---|
void |
addJResourceDS(String name,
String dsName,
String userTable,
String userTableUsernameCol,
String userTablePasswordCol,
String roleTable,
String roleTableUsernameCol,
String roleTableRolenameCol,
String algorithm)
Add a DS resource. |
void |
addJResourceLDAP(String name,
String initialContextFactory,
String providerUrl,
String securityAuthentication,
String securityPrincipal,
String securityCredentials,
String securityProtocol,
String language,
String referral,
String stateFactories,
String authenticationMode,
String userPasswordAttribute,
String userRolesAttribute,
String roleNameAttribute,
String baseDN,
String userDN,
String userSearchFilter,
String roleDN,
String roleSearchFilter,
String algorithm)
Add a LDAP resource. |
void |
addJResourceMemory(String name)
Add a Memory resource. |
void |
addResources(String xml)
Add JResources with a given xml configuration. |
void |
bindResource(String name,
JResource jResource)
Bind the given resource with the given name and register with a new MBean. |
void |
doStart()
Start the Service Initialization of the service is already done. |
void |
doStop()
Stop the Service. |
String |
encryptPassword(String string,
String algo)
Encrypt a string with an algorithm. |
protected File |
getConfigFile()
Return a File object representing the jonas-realm.xml configuration file. |
JResource |
getJResource(String name)
Return a resource by giving its name. |
boolean |
isValidAlgorithm(String algo)
Check if the given algorithm is a valid algorithm. |
void |
removeJResource(String resourceName)
Remove the Resource (memory, ldap, datasource,...). |
void |
setJmxService(JmxService jmxService)
|
void |
setRealmJndiRegistration(boolean register)
|
void |
setRegistryService(RegistryService registry)
|
String |
toXML()
String representation of the JOnAS realm. |
Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl |
---|
convertToList, doInit, getDomainName, getJonasServerName, getName, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString |
Methods inherited from class org.ow2.jonas.lib.reconfig.ReconfigEmitter |
---|
initLogger, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.ow2.jonas.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
public static final String REMOTE_RESOUCE
protected static final String CONFIG_FILE
Constructor Detail |
---|
public JonasSecurityServiceImpl()
Method Detail |
---|
public void setRealmJndiRegistration(boolean register)
register
- Bind a resource for security in JNDI ?public void removeJResource(String resourceName) throws Exception
removeJResource
in interface JonasSecurityServiceImplMBean
resourceName
- name of the resource
Exception
- if the resource name does not existpublic void setRegistryService(RegistryService registry)
registry
- the registry service to setpublic void doStart() throws ServiceException
doStart
in class AbsServiceImpl
ServiceException
- if the stop failed.public void doStop()
doStop
in class AbsServiceImpl
public JResource getJResource(String name)
getJResource
in interface SecurityService
name
- the wanted Resource
protected File getConfigFile() throws FileNotFoundException
FileNotFoundException
- if the configuration file is not found.public String toXML()
toXML
in interface SecurityService
public String encryptPassword(String string, String algo) throws NoSuchAlgorithmException
encryptPassword
in interface JonasSecurityServiceImplMBean
string
- the string to encodealgo
- algorithm to apply on the given string
NoSuchAlgorithmException
- One reason could be a bad algorithmpublic boolean isValidAlgorithm(String algo)
isValidAlgorithm
in interface JonasSecurityServiceImplMBean
algo
- algorithm to apply on the given string
public void addResources(String xml) throws Exception
addResources
in interface JonasSecurityServiceImplMBean
xml
- xml representation of the resources to add
Exception
- if the resources can't be addedpublic void addJResourceMemory(String name) throws Exception
addJResourceMemory
in interface JonasSecurityServiceImplMBean
name
- the name of the JResourceMemory to create
Exception
- if the resource can't be addedpublic void addJResourceDS(String name, String dsName, String userTable, String userTableUsernameCol, String userTablePasswordCol, String roleTable, String roleTableUsernameCol, String roleTableRolenameCol, String algorithm) throws Exception
addJResourceDS
in interface JonasSecurityServiceImplMBean
name
- the name of the JResourceDS to createdsName
- Name of the datasource resource to use.userTable
- Name of table which have the username/passworduserTableUsernameCol
- Column of the username of the user tableuserTablePasswordCol
- Column of the password of the user tableroleTable
- Name of table which have the username/roleroleTableUsernameCol
- Column of the username of the role tableroleTableRolenameCol
- Column of the role of the role tablealgorithm
- Default algorithm. If specified, the default is not
'clear' password
Exception
- if the resource can't be addedpublic void addJResourceLDAP(String name, String initialContextFactory, String providerUrl, String securityAuthentication, String securityPrincipal, String securityCredentials, String securityProtocol, String language, String referral, String stateFactories, String authenticationMode, String userPasswordAttribute, String userRolesAttribute, String roleNameAttribute, String baseDN, String userDN, String userSearchFilter, String roleDN, String roleSearchFilter, String algorithm) throws Exception
addJResourceLDAP
in interface JonasSecurityServiceImplMBean
name
- the name of the JResourceLDAP to createinitialContextFactory
- Initial context factory for the LDAp serverproviderUrl
- Url of the ldap serversecurityAuthentication
- Type of the authentication used during the
authentication to the LDAP serversecurityPrincipal
- DN of the Principal(username). He can retrieve
the information from the usersecurityCredentials
- Credential(password) of the principalsecurityProtocol
- Constant that holds the name of the environment
property for specifying the security protocol to use.language
- Constant that holds the name of the environment property
for specifying the preferred language to use with the service.referral
- Constant that holds the name of the environment property
for specifying how referrals encountered by the service provider
are to be processed.stateFactories
- Constant that holds the name of the environment
property for specifying the list of state factories to use.authenticationMode
- Mode for validate the authentication
(BIND_AUTHENTICATION_MODE or COMPARE_AUTHENTICATION_MODE)userPasswordAttribute
- Attribute in order to get the password from
the ldap serveruserRolesAttribute
- Attribute in order to get the user role from
the ldap serverroleNameAttribute
- Attribute for the role name when performing a
lookup on a rolebaseDN
- DN used for the lookupuserDN
- DN used when searching the user DN. Override the baseDN if
it is defineduserSearchFilter
- Filter used when searching the userroleDN
- DN used when searching the role DN. Override the baseDN if
it is definedroleSearchFilter
- Filter used when searching the rolealgorithm
- Default algorithm. If specified, the default is not
'clear' password
Exception
- if the resource can't be addedpublic void bindResource(String name, JResource jResource)
bindResource
in interface SecurityService
name
- resource namejResource
- resourcepublic void setJmxService(JmxService jmxService)
jmxService
- the jmxService to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |