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 privileged groups. Methods which return Experimenter or ExperimenterGroup instances fetch and load all related instances of ExperimenterGroup or Experimenter, respectively.
    Since:
    OME3.0
    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      ome.model.meta.Experimenter createUser​(java.lang.String username)
      Creates an Experimenter entry in the OMERO DB based on the supplied LDAP username.
      java.util.List<ome.model.meta.Experimenter> discover()
      Discovers and lists Experimenters who are present in the remote LDAP server and in the local DB but have the ldap property set to false.
      java.util.List<ome.model.meta.ExperimenterGroup> discoverGroups()
      Discovers and lists ExperimenterGroups which are present in the remote LDAP server and in the local DB but have the ldap property set to false.
      java.lang.String findDN​(java.lang.String username)
      Searches unique Distinguished Name - String in LDAP for Common Name equals username.
      ome.model.meta.Experimenter findExperimenter​(java.lang.String username)
      Searches Experimenter by unique Distinguished Name - String in LDAP for Common Name equals username.
      ome.model.meta.ExperimenterGroup findGroup​(java.lang.String groupname)
      Looks up a specific ExperimenterGroup in LDAP using the provided group name.
      java.lang.String findGroupDN​(java.lang.String groupname)
      Looks up the DN for a group.
      boolean getSetting()
      Gets config value from properties.
      java.util.List<ome.model.meta.Experimenter> searchAll()
      Searches all Experimenter list 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 all Experimenter in LDAP for specified attribute
      java.util.List<ome.model.meta.Experimenter> searchByAttributes​(java.lang.String dn, java.lang.String[] attributes, java.lang.String[] values)
      Searches all Experimenter in LDAP for specified attributes.
      ome.model.meta.Experimenter searchByDN​(java.lang.String userdn)
      Searches one Experimenter in LDAP for specified Distinguished Name - String
      java.util.List<java.lang.String> searchDnInGroups​(java.lang.String attr, java.lang.String value)
      Searches Distinguished Name - String in groups
      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.
    • Method Detail

      • searchAll

        java.util.List<ome.model.meta.Experimenter> searchAll()
        Searches all Experimenter list 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 - String in 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 all Experimenter in LDAP for specified attribute
        Parameters:
        dn - Distinguished Name base 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 all Experimenter in LDAP for specified attributes. Attributes should be specified in String [] and their values should be set in equivalent String [].
        Parameters:
        dn - DistinguishedName base 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 one Experimenter in LDAP for specified Distinguished Name - String
        Parameters:
        userdn - unique Distinguished Name - String of user, Never null or empty.
        Returns:
        an Experimenter.
      • findDN

        java.lang.String findDN​(java.lang.String username)
        Searches unique Distinguished Name - 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.
        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 - 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.
        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 specific ExperimenterGroup in 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 the dn column in the password table to the supplied string, for the supplied Experimenter ID.
        Parameters:
        experimenterID -
        dn -
      • getSetting

        boolean getSetting()
        Gets config value from properties.
        Returns:
        boolean
      • createUser

        ome.model.meta.Experimenter createUser​(java.lang.String username)
        Creates an Experimenter entry 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 lists Experimenters who are present in the remote LDAP server and in the local DB but have the ldap property set to false.
        Returns:
        list of Experimenters.
      • discoverGroups

        java.util.List<ome.model.meta.ExperimenterGroup> discoverGroups()
        Discovers and lists ExperimenterGroups which are present in the remote LDAP server and in the local DB but have the ldap property set to false.
        Returns:
        list of ExperimenterGroups.