|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.logic.AbstractLevel2Service
ome.logic.LdapImpl
@Transactional(readOnly=true) public class LdapImpl
Provides methods for administering user accounts, passwords, as well as methods which require special privileges. Developer note: As can be expected, to perform these privileged the Admin service has access to several resources that should not be generally used while developing services. Misuse could circumvent security or auditing.
SecuritySystem
,
Permissions
Nested Class Summary | |
---|---|
static class |
LdapImpl.GroupAttributMapper
|
class |
LdapImpl.PersonContextMapper
|
static class |
LdapImpl.UidAttributMapper
|
Field Summary | |
---|---|
protected String |
attributes
|
protected boolean |
config
|
protected String |
groups
|
protected org.springframework.jdbc.core.simple.SimpleJdbcOperations |
jdbc
|
protected org.springframework.ldap.core.LdapOperations |
ldapOperations
|
protected String |
newUserGroup
|
protected RoleProvider |
roleProvider
|
protected String |
values
|
Fields inherited from class ome.logic.AbstractLevel2Service |
---|
iQuery, iUpdate, metadata, queryFactory, sec |
Constructor Summary | |
---|---|
LdapImpl(RoleProvider roleProvider,
org.springframework.ldap.core.LdapOperations ldapOperations,
org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc,
String newUserGroup,
String groups,
String attributes,
String values,
boolean config)
|
Method Summary | |
---|---|
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. |
String |
getBase()
Gets base from the OmeroContext -> Bean: contextSource |
String[] |
getReqAttributes()
Gets specyfied attributes from properties. |
List<String> |
getReqGroups()
Gets specyfied requirements from properties. |
String[] |
getReqValues()
Gets specified values for attributes from properties. |
Class<? extends ServiceInterface> |
getServiceInterface()
|
boolean |
getSetting()
Gets config value from properties. |
protected void |
isAuthContext(String username,
String password)
Creates the initial context with no connection request controls in order to check authentication. |
boolean |
isInGroups(List groups,
List usergroups)
Checks that user's group list contains require groups. |
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 |
List<ome.model.meta.ExperimenterGroup> |
searchGroups()
Searchs all Groups in LDAP |
void |
setDN(Long experimenterID,
String dn)
Searchs all Experimenter in LDAP for objectClass =
person |
void |
setReqAttributes(String[] arg0)
Sets specyfied attributes from properties. |
void |
setReqGroups(List<String> arg0)
Sets specyfied requirements from properties. |
void |
setReqValues(String[] arg0)
Sets specified values for attributes from properties. |
boolean |
validatePassword(String base,
String password)
Validates password for base. |
boolean |
validateRequiroments(String base)
Valids specyfied requirements for base (groups, attributes) |
Methods inherited from class ome.logic.AbstractLevel2Service |
---|
getBeanHelper, getExtendedMetadata, getQueryFactory, getSecuritySystem, selfConfigure, setExtendedMetadata, setQueryFactory, setQueryService, setSecuritySystem, setUpdateService |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.springframework.ldap.core.LdapOperations ldapOperations
protected final org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc
protected final String newUserGroup
protected final String groups
protected final String attributes
protected final String values
protected final boolean config
protected final RoleProvider roleProvider
Constructor Detail |
---|
public LdapImpl(RoleProvider roleProvider, org.springframework.ldap.core.LdapOperations ldapOperations, org.springframework.jdbc.core.simple.SimpleJdbcOperations jdbc, String newUserGroup, String groups, String attributes, String values, boolean config)
Method Detail |
---|
public List<ome.model.meta.Experimenter> searchAll()
ILdap
Experimenter
list on LDAP for
attribute objectClass = person.
searchAll
in interface ILdap
public List<ome.model.meta.Experimenter> searchByAttribute(String dns, String attr, String value)
ILdap
Experimenter
in LDAP for specyfied
attribute
searchByAttribute
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.
findDN
in interface ILdap
username
- Name of the Experimenter equals CommonName.
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 groups
searchDnInGroups
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
.
public List<ome.model.meta.ExperimenterGroup> searchGroups()
ILdap
searchGroups
in interface ILdap
@Transactional(readOnly=false) public void setDN(Long experimenterID, String dn)
ILdap
Experimenter
in LDAP for objectClass =
person
setDN
in interface ILdap
public boolean getSetting()
ILdap
getSetting
in interface ILdap
public List<String> getReqGroups()
ILdap
getReqGroups
in interface ILdap
public String[] getReqAttributes()
ILdap
getReqAttributes
in interface ILdap
public String[] getReqValues()
ILdap
getReqValues
in interface ILdap
public void setReqAttributes(String[] arg0)
ILdap
setReqAttributes
in interface ILdap
public void setReqGroups(List<String> arg0)
ILdap
setReqGroups
in interface ILdap
public void setReqValues(String[] arg0)
ILdap
setReqValues
in interface ILdap
public Class<? extends ServiceInterface> getServiceInterface()
getServiceInterface
in interface SelfConfigurableService
public String getBase()
getBase
in interface LocalLdap
protected void isAuthContext(String username, String password)
SecurityViolation
.
public boolean validatePassword(String base, String password)
validatePassword
in interface LocalLdap
@Transactional(readOnly=false) public boolean createUserFromLdap(String username, String password)
createUserFromLdap
in interface LocalLdap
ServiceFactory
public boolean validateRequiroments(String base)
validateRequiroments
in interface LocalLdap
public boolean isInGroups(List groups, List usergroups)
isInGroups
in interface LocalLdap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: Beta-4.1.1-r5927-b91
Copyright © 2009 The University of Dundee. All Rights Reserved.