|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.NotificationBroadcasterSupport org.objectweb.jonas.management.ReconfigDispatcher org.objectweb.jonas.service.AbsServiceImpl org.objectweb.jonas.security.JonasSecurityServiceImpl
public class JonasSecurityServiceImpl
Security Service implementation
Field Summary | |
---|---|
protected static java.lang.String |
BIND_RESOURCES_INTO_JNDI
Bind the resources into JNDI ? |
static java.lang.String |
CLASS
Security service configuration properties |
protected static java.lang.String |
CONFIG_FILE
Relative path of the realm configuration file |
static java.lang.String |
REMOTE_RESOUCE
Name of resource |
Fields inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
RECONFIG_TYPE, SAVE_RECONFIG_TYPE |
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 |
doInit(javax.naming.Context ctx)
Init the Service. |
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,...) |
java.lang.String |
toXML()
String representation of the JOnAS realm |
Methods inherited from class org.objectweb.jonas.service.AbsServiceImpl |
---|
getDomainName, getJonasServerName, getName, init, isStarted, setName, start, stop |
Methods inherited from class org.objectweb.jonas.management.ReconfigDispatcher |
---|
addNotificationListener, getFilter, getHandback, getListener, getNotificationInfo, initLogger, removeNotificationListener, sendReconfigNotification, sendSaveNotification |
Methods inherited from class javax.management.NotificationBroadcasterSupport |
---|
handleNotification, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.objectweb.jonas.service.Service |
---|
getName, init, isStarted, setName, start, stop |
Field Detail |
---|
public static final java.lang.String CLASS
public static final java.lang.String REMOTE_RESOUCE
protected static final java.lang.String CONFIG_FILE
protected static final java.lang.String BIND_RESOURCES_INTO_JNDI
Constructor Detail |
---|
public JonasSecurityServiceImpl()
Method Detail |
---|
public void doInit(javax.naming.Context ctx) throws ServiceException
doInit
in class AbsServiceImpl
ctx
- the configuration of the Security service.
ServiceException
- if the initialization failed.public void removeJResource(java.lang.String resourceName) throws java.lang.Exception
removeJResource
in interface JonasSecurityServiceImplMBean
resourceName
- name of the resource
java.lang.Exception
- if the resource name does not existpublic void doStart() throws ServiceException
doStart
in class AbsServiceImpl
ServiceException
- if the stop failed.public void doStop()
doStop
in class AbsServiceImpl
public JResource getJResource(java.lang.String name)
getJResource
in interface SecurityService
name
- 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 JonasSecurityServiceImplMBean
string
- 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 JonasSecurityServiceImplMBean
algo
- algorithm to apply on the given string
public void addResources(java.lang.String xml) throws java.lang.Exception
addResources
in interface JonasSecurityServiceImplMBean
xml
- xml representation of the resources to add
java.lang.Exception
- if the resources can't be addedpublic void addJResourceMemory(java.lang.String name) throws java.lang.Exception
addJResourceMemory
in interface JonasSecurityServiceImplMBean
name
- the name of the JResourceMemory to create
java.lang.Exception
- if the resource can't be addedpublic 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 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
java.lang.Exception
- if the resource can't be addedpublic 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 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
java.lang.Exception
- if the resource can't be addedpublic void bindResource(java.lang.String name, JResource jResource)
bindResource
in interface SecurityService
name
- resource namejResource
- resource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |