Interface GenDataProvider

All Known Implementing Classes:
GenDataProviderImpl

public interface GenDataProvider
This component is used to efficiently load required attributes.

Attributes, that can be hashed, must be loaded first via load* methods. E.g.: to be able to call getResourceAttributesHashes, one must first call loadResourceSpecificAttributes.

IMPORTANT: this components has a STATE! The order of load methods is important. E.g.: loadResourceSpecificAttributes will overwrite data for previously loaded resource.

Author:
Vojtech Sassmann <vojtech.sassmann@gmail.com>
  • Method Details

    • getAllFetchedAttributes

      Map<String,Map<String,Object>> getAllFetchedAttributes()
      Returns map of all loaded attributes grouped by their hashes. Returns only non-empty lists, and only lists, for which their hashes has been returned, by some get.*attributesHashes method.
      Returns:
      map of hashes attributes
    • getFacilityAttributesHashes

      List<String> getFacilityAttributesHashes()
      Return all hashes for facility attributes.
      Returns:
      list of hashes
    • getGroupAttributesHashes

      List<String> getGroupAttributesHashes(Resource resource, Group group)
      Returns all hashes relevant for given group. Group and Group-Resource attributes.
      Parameters:
      resource - resource used to get Group-Resource attributes.
      group - group
      Returns:
      list of hashes
    • getMemberAttributesHashes

      List<String> getMemberAttributesHashes(Resource resource, Member member)
      Return all hashes relevant for given member. Member, User, Member-Resource, User-Facility.
      Parameters:
      resource - resource used to get member-resource attributes hash
      member - given member
      Returns:
      list of hashes
    • getMemberAttributesHashes

      List<String> getMemberAttributesHashes(Resource resource, Member member, Group group)
      Return all hashes relevant for given member. Member, User, Member-Resource, User-Facility and Member-Group.
      Parameters:
      resource - resource used to get member-resource attributes hash
      member - given member
      group - group used to get member-group attributes
      Returns:
      list of hashes
    • getResourceAttributesHashes

      List<String> getResourceAttributesHashes(Resource resource, boolean addVoAttributes)
      Return all hashes for given resource attributes. If addVoAttributes is true, also adds a hash for resource's vo attributes, if they are not empty.
      Parameters:
      resource - resource
      addVoAttributes - if true, add also vo attributes hash, if not empty
      Returns:
      list of hashes
    • loadFacilityAttributes

      void loadFacilityAttributes()
      Loads Facility attributes.
    • loadGroupsAttributes

      void loadGroupsAttributes(Resource resource, List<Group> groups)
      Loads Group and Group-Resource attributes. Group attributes are loaded only for groups that has not been already loaded.
      Parameters:
      resource - resource
      groups - groups
    • loadMemberGroupAttributes

      void loadMemberGroupAttributes(Group group, List<Member> members)
      Loads Member-Group attributes.
      Parameters:
      group - groups
      members - members
    • loadResourceAttributes

      void loadResourceAttributes(Resource resource, List<Member> members, boolean loadVoAttributes)
      Loads Resource and Member specific attributes. Resouce, Member, User, User-Facility (if not already loaded). Resource-Member (always) Vo - if specified by loadVoAttributes
      Parameters:
      resource - resource
      members - members
      loadVoAttributes - specifies, if the voAttributesShould be loaded as well.