@Transactional(readOnly=true) public class LdapImpl extends AbstractLevel2Service implements ILdap, org.springframework.context.ApplicationContextAware
SecuritySystem
,
Permissions
iQuery, iUpdate, metadata, queryFactory, sec
Constructor and Description |
---|
LdapImpl(org.springframework.ldap.core.ContextSource ctx,
org.springframework.ldap.core.LdapOperations ldap,
Roles roles,
LdapConfig config,
RoleProvider roleProvider,
ome.util.SqlAction sql) |
Modifier and Type | Method and Description |
---|---|
boolean |
createUserFromLdap(String username,
String password)
Gets user from LDAP for checking him by requirements and setting his
details on DB
|
String |
findDN(String username)
Searchs unique Distinguished Name -
String in
LDAP for Common Name equals username. |
ome.model.meta.Experimenter |
findExperimenter(String username)
Searchs Experimenter by unique Distinguished Name -
String in
LDAP for Common Name equals username. |
Class<? extends ServiceInterface> |
getServiceInterface() |
boolean |
getSetting()
Gets config value from properties.
|
List<Long> |
loadLdapGroups(String username,
org.springframework.ldap.core.DistinguishedName dn) |
String |
lookupLdapAuthExperimenter(Long id) |
List<Map<String,Object>> |
lookupLdapAuthExperimenters() |
List<ome.model.meta.Experimenter> |
searchAll()
Searchs all
Experimenter list on LDAP for
attribute objectClass = person. |
List<ome.model.meta.Experimenter> |
searchByAttribute(String dns,
String attr,
String value)
Searchs all
Experimenter in LDAP for specyfied
attribute |
List<ome.model.meta.Experimenter> |
searchByAttributes(String dn,
String[] attributes,
String[] values)
Searchs all
Experimenter in LDAP for specyfied
attributes. |
ome.model.meta.Experimenter |
searchByDN(String dns)
Searchs one
Experimenter in LDAP for specyfied
Distinguished Name - String |
List<String> |
searchDnInGroups(String attr,
String value)
Searchs Distinguished Name -
String in groups |
void |
setApplicationContext(org.springframework.context.ApplicationContext arg0)
Set the ApplicationContext that this object runs in.
|
void |
setDN(Long experimenterID,
String dn)
Searchs all
Experimenter in LDAP for objectClass =
person |
void |
synchronizeLdapUser(String username) |
boolean |
validatePassword(String dn,
String password)
Validates password for base.
|
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setSecuritySystem, setUpdateService
public LdapImpl(org.springframework.ldap.core.ContextSource ctx, org.springframework.ldap.core.LdapOperations ldap, Roles roles, LdapConfig config, RoleProvider roleProvider, ome.util.SqlAction sql)
public void setApplicationContext(org.springframework.context.ApplicationContext arg0) throws org.springframework.beans.BeansException
org.springframework.context.ApplicationContextAware
Invoked after population of normal bean properties but before an init callback such
as InitializingBean.afterPropertiesSet()
or a custom init-method. Invoked after ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)
,
ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher)
and
MessageSourceAware
, if applicable.
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
arg0
- the ApplicationContext object to be used by this objectorg.springframework.context.ApplicationContextException
- in case of context initialization errorsorg.springframework.beans.BeansException
- if thrown by application context methodsBeanInitializationException
public Class<? extends ServiceInterface> getServiceInterface()
getServiceInterface
in interface SelfConfigurableService
public List<ome.model.meta.Experimenter> searchAll()
ILdap
Experimenter
list on LDAP for
attribute objectClass = person.public List<ome.model.meta.Experimenter> searchByAttribute(String dns, String attr, String value)
ILdap
Experimenter
in LDAP for specyfied
attributesearchByAttribute
in interface ILdap
dns
- -
Distinguished Name - String
base for
search. Never null, should be
net.sf.ldaptemplate.support.DistinguishedName#EMPTY_PATH
.value
- -
String expected value of attribute. Never null or empty.public ome.model.meta.Experimenter searchByDN(String dns)
ILdap
Experimenter
in LDAP for specyfied
Distinguished Name - String
searchByDN
in interface ILdap
dns
- unique Distinguished Name - String
of user, Never null or empty.public String findDN(String username)
ILdap
String
in
LDAP for Common Name equals username. Common Name should be unique under
the specified base. If list of cn's contains more then one DN will return
exception.public ome.model.meta.Experimenter findExperimenter(String username)
ILdap
String
in
LDAP for Common Name equals username. Common Name should be unique under
the specified base. If list of cn's contains more then one DN will return
exception.findExperimenter
in interface ILdap
username
- Name of the Experimenter equals CommonName.public List<String> searchDnInGroups(String attr, String value)
ILdap
String
in groupssearchDnInGroups
in interface ILdap
attr
- -
String name of memeber attribute. Never null or empty.value
- -
user's DN which should be set on value for attribute. Never
null or empty.public List<ome.model.meta.Experimenter> searchByAttributes(String dn, String[] attributes, String[] values)
ILdap
Experimenter
in LDAP for specyfied
attributes. Attributes should be specyfied in String [] and their values
should be set in equivalets String [].searchByAttributes
in interface ILdap
dn
- -
net.sf.ldaptemplate.support.DistinguishedName
base for
search. Never null, should be
net.sf.ldaptemplate.support.DistinguishedName#EMPTY_PATH
.@Transactional(readOnly=false) public void setDN(Long experimenterID, String dn)
ILdap
Experimenter
in LDAP for objectClass =
personpublic boolean getSetting()
ILdap
getSetting
in interface ILdap
public void synchronizeLdapUser(String username)
public boolean createUserFromLdap(String username, String password)
ServiceFactory
public List<Long> loadLdapGroups(String username, org.springframework.ldap.core.DistinguishedName dn)
public boolean validatePassword(String dn, String password)
Version: 4.4.12-ice34-b116
Copyright © 2014 The University of Dundee & Open Microscopy Environment. All Rights Reserved.