Package ome.api
Interface ILdap
-
- All Superinterfaces:
ServiceInterface
public interface ILdap extends ServiceInterface
Administration interface providing access to admin-only functionality as well as JMX-based server access and selected user functions. Most methods require membership in privilegedgroups. Methods which returnExperimenterorExperimenterGroupinstances fetch and load all related instances ofExperimenterGrouporExperimenter, respectively.- Since:
- OME3.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description ome.model.meta.ExperimentercreateUser(java.lang.String username)Creates anExperimenterentry in the OMERO DB based on the supplied LDAP username.java.util.List<ome.model.meta.Experimenter>discover()Discovers and listsExperimenters who are present in the remote LDAP server and in the local DB but have theldapproperty set tofalse.java.util.List<ome.model.meta.ExperimenterGroup>discoverGroups()Discovers and listsExperimenterGroups which are present in the remote LDAP server and in the local DB but have theldapproperty set tofalse.java.lang.StringfindDN(java.lang.String username)Searches unique Distinguished Name -Stringin LDAP for Common Name equals username.ome.model.meta.ExperimenterfindExperimenter(java.lang.String username)Searches Experimenter by unique Distinguished Name -Stringin LDAP for Common Name equals username.ome.model.meta.ExperimenterGroupfindGroup(java.lang.String groupname)Looks up a specificExperimenterGroupin LDAP using the provided group name.java.lang.StringfindGroupDN(java.lang.String groupname)Looks up the DN for a group.booleangetSetting()Gets config value from properties.java.util.List<ome.model.meta.Experimenter>searchAll()Searches allExperimenterlist on LDAP for attribute objectClass = person.java.util.List<ome.model.meta.Experimenter>searchByAttribute(java.lang.String dn, java.lang.String attribute, java.lang.String value)Searches allExperimenterin LDAP for specified attributejava.util.List<ome.model.meta.Experimenter>searchByAttributes(java.lang.String dn, java.lang.String[] attributes, java.lang.String[] values)Searches allExperimenterin LDAP for specified attributes.ome.model.meta.ExperimentersearchByDN(java.lang.String userdn)Searches oneExperimenterin LDAP for specified Distinguished Name -Stringjava.util.List<java.lang.String>searchDnInGroups(java.lang.String attr, java.lang.String value)Searches Distinguished Name -Stringin groupsvoidsetDN(java.lang.Long experimenterID, java.lang.String dn)Deprecated.As of release 5.1, relevant model objects have the "ldap" property added to their state.
-
-
-
Method Detail
-
searchAll
java.util.List<ome.model.meta.Experimenter> searchAll()
Searches allExperimenterlist on LDAP for attribute objectClass = person.- Returns:
- all Experimenter list.
-
searchDnInGroups
java.util.List<java.lang.String> searchDnInGroups(java.lang.String attr, java.lang.String value)Searches Distinguished Name -Stringin groups- Parameters:
attr- Name of member attribute. Never null or empty.value- User's DN which should be set on value for attribute. Never null or empty.- Returns:
- List of groups which contains DN.
-
searchByAttribute
java.util.List<ome.model.meta.Experimenter> searchByAttribute(java.lang.String dn, java.lang.String attribute, java.lang.String value)Searches allExperimenterin LDAP for specified attribute- Parameters:
dn-Distinguished Namebase for search. Never null.attribute- Name of attribute. Never null or empty.value- Expected value of attribute. Never null or empty.- Returns:
- List of Experimenters.
-
searchByAttributes
java.util.List<ome.model.meta.Experimenter> searchByAttributes(java.lang.String dn, java.lang.String[] attributes, java.lang.String[] values)Searches allExperimenterin LDAP for specified attributes. Attributes should be specified in String [] and their values should be set in equivalent String [].- Parameters:
dn-DistinguishedNamebase for search. Never null.attributes- Name of attribute. Never null or empty.values- Expected value of attribute. Never null or empty.- Returns:
- List of Experimenters.
-
searchByDN
ome.model.meta.Experimenter searchByDN(java.lang.String userdn)
Searches oneExperimenterin LDAP for specified Distinguished Name -String- Parameters:
userdn- unique Distinguished Name -Stringof user, Never null or empty.- Returns:
- an Experimenter.
-
findDN
java.lang.String findDN(java.lang.String username)
Searches unique Distinguished Name -Stringin 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.- Parameters:
username- Name of the Experimenter equals CommonName.- Returns:
- an String Distinguished Name. Never null.
- Throws:
ome.conditions.ApiUsageException- if more then one 'cn' under the specified base.
-
findGroupDN
java.lang.String findGroupDN(java.lang.String groupname)
Looks up the DN for a group.- Returns:
- an String Distinguished Name. Never null.
- Throws:
ome.conditions.ApiUsageException- if more then one 'cn' under the specified base.
-
findExperimenter
ome.model.meta.Experimenter findExperimenter(java.lang.String username)
Searches Experimenter by unique Distinguished Name -Stringin 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.- Parameters:
username- Name of the Experimenter equals CommonName.- Returns:
- an Experimenter. Never null.
- Throws:
ome.conditions.ApiUsageException- if more then one 'cn' under the specified base.
-
findGroup
ome.model.meta.ExperimenterGroup findGroup(java.lang.String groupname)
Looks up a specificExperimenterGroupin LDAP using the provided group name. It is expected that the group name will be unique in the searched LDAP base tree. If more than one group with the specified name has been found, an exception will be thrown.- Parameters:
groupname-- Returns:
- an ExperimenterGroup. Never
null. - Throws:
ome.conditions.ApiUsageException- if more then one group name matches under the specified base.
-
setDN
@Deprecated void setDN(java.lang.Long experimenterID, java.lang.String dn)Deprecated.As of release 5.1, relevant model objects have the "ldap" property added to their state.Sets the value of thedncolumn in thepasswordtable to the supplied string, for the suppliedExperimenterID.- Parameters:
experimenterID-dn-
-
getSetting
boolean getSetting()
Gets config value from properties.- Returns:
- boolean
-
createUser
ome.model.meta.Experimenter createUser(java.lang.String username)
Creates anExperimenterentry in the OMERO DB based on the supplied LDAP username.- Parameters:
username-- Returns:
- created Experimenter or null
-
discover
java.util.List<ome.model.meta.Experimenter> discover()
Discovers and listsExperimenters who are present in the remote LDAP server and in the local DB but have theldapproperty set tofalse.- Returns:
- list of Experimenters.
-
discoverGroups
java.util.List<ome.model.meta.ExperimenterGroup> discoverGroups()
Discovers and listsExperimenterGroups which are present in the remote LDAP server and in the local DB but have theldapproperty set tofalse.- Returns:
- list of ExperimenterGroups.
-
-