|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.lib.management.javaee.ManagedObject
org.ow2.jonas.lib.service.AbsServiceImpl
org.ow2.jonas.security.internal.JonasSecurityServiceImpl
public class JonasSecurityServiceImpl
Security Service implementation?
| Field Summary | |
|---|---|
protected static java.lang.String |
CONFIG_FILE
Relative path of the realm configuration file. |
static java.lang.String |
REMOTE_RESOUCE
Name of resource. |
| Constructor Summary | |
|---|---|
JonasSecurityServiceImpl()
|
|
| Method Summary | |
|---|---|
void |
addJResourceDS(java.lang.String name,
java.lang.String dsName,
java.lang.String userTable,
java.lang.String userTableUsernameCol,
java.lang.String userTablePasswordCol,
java.lang.String roleTable,
java.lang.String roleTableUsernameCol,
java.lang.String roleTableRolenameCol,
java.lang.String algorithm)
Add a DS resource. |
void |
addJResourceLDAP(java.lang.String name,
java.lang.String initialContextFactory,
java.lang.String providerUrl,
java.lang.String securityAuthentication,
java.lang.String securityPrincipal,
java.lang.String securityCredentials,
java.lang.String securityProtocol,
java.lang.String language,
java.lang.String referral,
java.lang.String stateFactories,
java.lang.String authenticationMode,
java.lang.String userPasswordAttribute,
java.lang.String userRolesAttribute,
java.lang.String roleNameAttribute,
java.lang.String baseDN,
java.lang.String userDN,
java.lang.String userSearchFilter,
java.lang.String roleDN,
java.lang.String roleSearchFilter,
java.lang.String algorithm)
Add a LDAP resource. |
void |
addJResourceMemory(java.lang.String name)
Add a Memory resource. |
void |
addResources(java.lang.String xml)
Add JResources with a given xml configuration. |
void |
bindResource(java.lang.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. |
java.lang.String |
encryptPassword(java.lang.String string,
java.lang.String algo)
Encrypt a string with an algorithm. |
protected java.io.File |
getConfigFile()
Return a File object representing the jonas-realm.xml configuration file. |
JResource |
getJResource(java.lang.String name)
Return a resource by giving its name. |
boolean |
isValidAlgorithm(java.lang.String algo)
Check if the given algorithm is a valid algorithm. |
void |
removeJResource(java.lang.String resourceName)
Remove the Resource (memory, ldap, datasource,...). |
void |
setJmxService(JmxService jmxService)
|
void |
setRealmJndiRegistration(boolean register)
|
void |
setRegistryService(RegistryService registry)
|
java.lang.String |
toXML()
String representation of the JOnAS realm. |
| Methods inherited from class org.ow2.jonas.lib.service.AbsServiceImpl |
|---|
convertToList, doInit, getDomainName, getJonasServerName, getName, getSequenceNumber, getServerProperties, init, isStarted, setName, setServerProperties, start, stop, throwRequirementException, toString |
| Methods inherited from class org.ow2.jonas.lib.management.javaee.ManagedObject |
|---|
getModelMBean, sendNotification, sendReconfigNotification, sendSaveNotification, setModelMBean |
| 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 java.lang.String REMOTE_RESOUCE
protected static final java.lang.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(java.lang.String resourceName)
throws java.lang.Exception
removeJResource in interface JonasSecurityServiceImplMBeanresourceName - name of the resource
java.lang.Exception - if the resource name does not existpublic void setRegistryService(RegistryService registry)
registry - the registry service to set
public void doStart()
throws ServiceException
doStart in class AbsServiceImplServiceException - if the stop failed.public void doStop()
doStop in class AbsServiceImplpublic JResource getJResource(java.lang.String name)
getJResource in interface SecurityServicename - the wanted Resource
protected java.io.File getConfigFile()
throws java.io.FileNotFoundException
java.io.FileNotFoundException - if the configuration file is not found.public java.lang.String toXML()
toXML in interface SecurityService
public java.lang.String encryptPassword(java.lang.String string,
java.lang.String algo)
throws java.security.NoSuchAlgorithmException
encryptPassword in interface JonasSecurityServiceImplMBeanstring - the string to encodealgo - algorithm to apply on the given string
java.security.NoSuchAlgorithmException - One reason could be a bad algorithmpublic boolean isValidAlgorithm(java.lang.String algo)
isValidAlgorithm in interface JonasSecurityServiceImplMBeanalgo - algorithm to apply on the given string
public void addResources(java.lang.String xml)
throws java.lang.Exception
addResources in interface JonasSecurityServiceImplMBeanxml - xml representation of the resources to add
java.lang.Exception - if the resources can't be added
public void addJResourceMemory(java.lang.String name)
throws java.lang.Exception
addJResourceMemory in interface JonasSecurityServiceImplMBeanname - the name of the JResourceMemory to create
java.lang.Exception - if the resource can't be added
public void addJResourceDS(java.lang.String name,
java.lang.String dsName,
java.lang.String userTable,
java.lang.String userTableUsernameCol,
java.lang.String userTablePasswordCol,
java.lang.String roleTable,
java.lang.String roleTableUsernameCol,
java.lang.String roleTableRolenameCol,
java.lang.String algorithm)
throws java.lang.Exception
addJResourceDS in interface JonasSecurityServiceImplMBeanname - 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
java.lang.Exception - if the resource can't be added
public void addJResourceLDAP(java.lang.String name,
java.lang.String initialContextFactory,
java.lang.String providerUrl,
java.lang.String securityAuthentication,
java.lang.String securityPrincipal,
java.lang.String securityCredentials,
java.lang.String securityProtocol,
java.lang.String language,
java.lang.String referral,
java.lang.String stateFactories,
java.lang.String authenticationMode,
java.lang.String userPasswordAttribute,
java.lang.String userRolesAttribute,
java.lang.String roleNameAttribute,
java.lang.String baseDN,
java.lang.String userDN,
java.lang.String userSearchFilter,
java.lang.String roleDN,
java.lang.String roleSearchFilter,
java.lang.String algorithm)
throws java.lang.Exception
addJResourceLDAP in interface JonasSecurityServiceImplMBeanname - 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
java.lang.Exception - if the resource can't be added
public void bindResource(java.lang.String name,
JResource jResource)
bindResource in interface SecurityServicename - 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 | |||||||||