Interface PersonAttributeDao

All Superinterfaces:
Comparable<PersonAttributeDao>, org.springframework.core.Ordered

public interface PersonAttributeDao extends Comparable<PersonAttributeDao>, org.springframework.core.Ordered
Defines methods for finding a PersonAttributes or Set of IPersons based on a user ID or a Map of user attributes to query with.
Since:
7.1.0
  • Field Details

    • WILDCARD

      static final String WILDCARD
      Wildcard indicator.
      See Also:
    • WILDCARD_PATTERN

      static final Pattern WILDCARD_PATTERN
      Wildcard regex pattern.
  • Method Details

    • getPerson

      PersonAttributes getPerson(String uid, Set<PersonAttributes> resultPeople, PersonAttributeDaoFilter filter)
      Searches for a single PersonAttributes using the specified uid (userName).

      This method returns according to the following rules:

      • If the user exists and has attributes a populated PersonAttributes is returned.
      • If the user exists and has no attributes an PersonAttributes with an empty attributes Map is returned.
      • If the user doesn't exist null is returned.
      • If an error occurs while find the person an appropriate exception will be thrown.
      Parameters:
      uid - The userName of the person to find.
      resultPeople - the result people
      filter - the filter
      Returns:
      The populated PersonAttributes for the specified uid, null if no person could be found for the uid.
      Throws:
      IllegalArgumentException - If uid is null.
    • getPerson

      default PersonAttributes getPerson(String uid)
      Gets person.
      Parameters:
      uid - the uid
      Returns:
      the person
    • getPerson

      default PersonAttributes getPerson(String uid, Set<PersonAttributes> resultPeople)
      Gets person.
      Parameters:
      uid - the uid
      resultPeople - the result people
      Returns:
      the person
    • getPeople

      Set<PersonAttributes> getPeople(Map<String,Object> query, PersonAttributeDaoFilter filter, Set<PersonAttributes> resultPeople)
      Searches for PersonAttributess that match the set of attributes provided in the query Map. Each implementation is free to define what qualifies as a 'match' is on its own. The provided query Map contains String attribute names and single values which may be null.
      If the implementation can not execute its query for an expected reason such as not enough information in the query Map null should be returned. For unexpected problems throw an exception.
      Parameters:
      query - A Map of name/value pair attributes to use in searching for PersonAttributess
      filter - the filter
      resultPeople - the result people
      Returns:
      A Set of PersonAttributess that match the query Map. If no matches are found an empty Set is returned. If the query could not be run null is returned.
      Throws:
      IllegalArgumentException - If query is null.
    • getPeople

      default Set<PersonAttributes> getPeople(Map<String,Object> query)
      Gets people.
      Parameters:
      query - the query
      Returns:
      the people
    • getPeople

      default Set<PersonAttributes> getPeople(Map<String,Object> query, PersonAttributeDaoFilter filter)
      Gets people.
      Parameters:
      query - the query
      filter - the filter
      Returns:
      the people
    • getPeople

      default Set<PersonAttributes> getPeople(Map<String,Object> query, Set<PersonAttributes> resultPeople)
      Gets people.
      Parameters:
      query - the query
      resultPeople - the result people
      Returns:
      the people
    • getPeopleWithMultivaluedAttributes

      default Set<PersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query, PersonAttributeDaoFilter filter, Set<PersonAttributes> resultPeople)
      Searches for PersonAttributess that match the set of attributes provided in the query Map. Each implementation is free to define what qualifies as a 'match' is on its own. The provided query Map contains String attribute names and single values which may be null.
      If the implementation can not execute its query for an expected reason such as not enough information in the query Map null should be returned. For unexpected problems throw an exception.
      Parameters:
      query - A Map of name/value pair attributes to use in searching for PersonAttributess
      filter - the filter
      resultPeople - the result people from previous attempts, if any.
      Returns:
      A Set of PersonAttributess that match the query Map. If no matches are found an empty Set is returned. If the query could not be run null is returned.
      Throws:
      IllegalArgumentException - If query is null.
    • getPeopleWithMultivaluedAttributes

      default Set<PersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query, PersonAttributeDaoFilter filter)
      Gets people with multivalued attributes.
      Parameters:
      query - the query
      filter - the filter
      Returns:
      the people with multivalued attributes
    • getPeopleWithMultivaluedAttributes

      default Set<PersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query)
      Gets people with multivalued attributes.
      Parameters:
      query - the query
      Returns:
      the people with multivalued attributes
    • getPeopleWithMultivaluedAttributes

      default Set<PersonAttributes> getPeopleWithMultivaluedAttributes(Map<String,List<Object>> query, Set<PersonAttributes> resultPeople)
      Gets people with multivalued attributes.
      Parameters:
      query - the query
      resultPeople - the result people
      Returns:
      the people with multivalued attributes
    • getPossibleUserAttributeNames

      default Set<String> getPossibleUserAttributeNames(PersonAttributeDaoFilter filter)
      Gets a Set of attribute names that may be returned for an IPersonAttributes. The names returned represent all possible attributes names for the PersonAttributes objects returned by the get methods. If the dao doesn't have a way to know all possible attribute names this method should return null.
      Returns an immutable Set.
      Parameters:
      filter - the filter
      Returns:
      A Set of possible attribute names for user queries.
    • getAvailableQueryAttributes

      default Set<String> getAvailableQueryAttributes(PersonAttributeDaoFilter filter)
      Gets a Set of attribute names that this implementation knows how to use in a query. The names returned represent all possible names for query attributes for this implmenentation. If the dao doesn't have a way to know all possible query attribute names this method should return null
      Returns an immutable Set.
      Parameters:
      filter - the filter
      Returns:
      The set of attributes that can be used to query for user ids in this dao, null if the set is unknown.
    • getOrder

      default int getOrder()
      Describes the order by which this DAO may be sorted and put into an ordered collection.
      Specified by:
      getOrder in interface org.springframework.core.Ordered
      Returns:
      the numeric order.
    • getId

      default String[] getId()
      Gets the unique identifier for this dao.
      Returns:
      the id
    • isEnabled

      default boolean isEnabled()
      Is this dao enabled?
      Returns:
      true/false
    • getTags

      Map<String,Object> getTags()
      Gets properties assigned to this repository. Properties are arbitrary tags and labels assigned to a repository for follow-up processing.
      Returns:
      the properties
    • stuffAttributesIntoList

      default Map<String,List<Object>> stuffAttributesIntoList(Map<String,?> personAttributesMap, PersonAttributeDaoFilter filter)
      Stuff attributes into list.
      Parameters:
      personAttributesMap - the person attributes map
      filter - the filter
      Returns:
      the map