Interface Searcher

All Known Implementing Classes:
SearcherEntry

public interface Searcher
Author:
Michal Stava
  • Method Details

    • getUsers

      This method get Map of Attributes with searching values and try to find all users, which have specific attributes in format. Better information about format below. When there are more than 1 attribute in Map, it means all must be true "looking for all of them" (AND)
      Parameters:
      sess - perun session
      attributesWithSearchingValues - map of attributes names when attribute is type String, so value is string and we are looking for total match (Partial is not supported now, will be supported later by symbol *) when attribute is type Integer, so value is integer in String and we are looking for total match when attribute is type List, so value is String and we are looking for at least one total or partial matching element when attribute is type Map so value is String in format "key=value" and we are looking total match of both or if is it "key" so we are looking for total match of key IMPORTANT: In map there is not allowed char '=' in key. First char '=' is delimiter in MAP item key=value!!!
      Returns:
      list of users who have attributes with specific values (behaviour above) if no user exist, return empty list of users
      Throws:
      AttributeNotExistsException
      InternalErrorException
      PrivilegeException
      WrongAttributeAssignmentException
    • getMembersByUserAttributes

      List<Member> getMembersByUserAttributes(PerunSession sess, Vo vo, Map<String,String> userAttributesWithSearchingValues) throws AttributeNotExistsException, PrivilegeException, WrongAttributeAssignmentException, VoNotExistsException
      This method get Map of user Attributes with searching values and try to find all members, which have specific attributes in format for specific VO. Better information about format below. When there are more than 1 attribute in Map, it means all must be true "looking for all of them" (AND) if principal has no rights for operation, throw exception if principal has no rights for some attribute on specific user, do not return this user if attributesWithSearchingValues is null or empty, return all members from vo if principal has rights for this operation
      Parameters:
      sess - perun session
      userAttributesWithSearchingValues - map of attributes names when attribute is type String, so value is string and we are looking for total match (Partial is not supported now, will be supported later by symbol *) when attribute is type Integer, so value is integer in String and we are looking for total match when attribute is type List, so value is String and we are looking for at least one total or partial matching element when attribute is type Map so value is String in format "key=value" and we are looking total match of both or if is it "key" so we are looking for total match of key IMPORTANT: In map there is not allowed char '=' in key. First char '=' is delimiter in MAP item key=value!!!
      Returns:
      list of users who have attributes with specific values (behaviour above) if no user exist, return empty list of users
      Throws:
      AttributeNotExistsException
      InternalErrorException
      PrivilegeException
      WrongAttributeAssignmentException
      VoNotExistsException
    • getUsersForCoreAttributes

      List<User> getUsersForCoreAttributes(PerunSession sess, Map<String,String> coreAttributesWithSearchingValues) throws AttributeNotExistsException, WrongAttributeAssignmentException, PrivilegeException
      This method take map of coreAttributes with search values and return all users who have the specific match for all of these core attributes.
      Parameters:
      sess -
      coreAttributesWithSearchingValues -
      Returns:
      Throws:
      InternalErrorException
      AttributeNotExistsException
      WrongAttributeAssignmentException
      PrivilegeException
    • getMembersByExpiration

      List<Member> getMembersByExpiration(PerunSession sess, String operator, int days) throws PrivilegeException
      Return members with expiration date set, which will expire on today +/- X days. You can specify operator for comparison (by default "=") returning exact match. So you can get all expired members (including today) using "<=" and zero days shift. or using "<" and +1 day shift. Method ignores current member state, just compares expiration date !
      Parameters:
      sess - PerunSession
      operator - One of "=", "<", ">", "<=", ">=". If null, "=" is anticipated.
      days - X days before/after today
      Returns:
      Members with expiration relative to method params.
      Throws:
      InternalErrorException
      PrivilegeException
    • getMembersByExpiration

      List<Member> getMembersByExpiration(PerunSession sess, String operator, LocalDate date) throws PrivilegeException
      Return members with expiration date set, which will expire on specified date. You can specify operator for comparison (by default "=") returning exact match. So you can get all expired members (including today) using "<=" and current date. or using "<" and tomorrow date. Method ignores current member state, just compares expiration date !
      Parameters:
      sess - PerunSession
      operator - One of "=", "<", ">", "<=", ">=". If null, "=" is anticipated.
      date - Date to compare expiration with (if null, current date is used).
      Returns:
      Members with expiration relative to method params.
      Throws:
      InternalErrorException
      PrivilegeException
    • getFacilities

      This method get Map of Attributes with searching values and try to find all facilities, which have specific attributes in format. Better information about format below. When there are more than 1 attribute in Map, it means all must be true "looking for all of them" (AND)
      Parameters:
      sess - perun session
      attributesWithSearchingValues - map of attributes names when attribute is type String, so value is string and we are looking for total match (Partial is not supported now, will be supported later by symbol *) when attribute is type Integer, so value is integer in String and we are looking for total match when attribute is type List, so value is String and we are looking for at least one total or partial matching element when attribute is type Map so value is String in format "key=value" and we are looking total match of both or if is it "key" so we are looking for total match of key IMPORTANT: In map there is not allowed char '=' in key. First char '=' is delimiter in MAP item key=value!!!
      Returns:
      list of facilities that have attributes with specific values (behaviour above) if no such facility exists, returns empty list
      Throws:
      PrivilegeException - insufficient permission
      InternalErrorException - internal error
      AttributeNotExistsException - when specified attribute does not exist
      WrongAttributeAssignmentException - wrong attribute assignment
    • getResources

      List<Resource> getResources(PerunSession sess, Map<String,String> attributesWithSearchingValues, boolean allowPartialMatchForString) throws PrivilegeException, AttributeNotExistsException, WrongAttributeAssignmentException
      This method get Map of Attributes with searching values and try to find all resources, which have specific attributes in format. Better information about format below. When there are more than 1 attribute in Map, it means all must be true "looking for all of them" (AND)
      Parameters:
      sess - perun session
      attributesWithSearchingValues - map of attributes names when attribute is type String, so value is string and we are looking for exact or partial match based by parameter 'allowPartialMatchForString' when attribute is type Integer, so value is integer in String and we are looking for total match when attribute is type List, so value is String and we are looking for at least one total or partial matching element when attribute is type Map so value is String in format "key=value" and we are looking total match of both or if is it "key" so we are looking for total match of key IMPORTANT: In map there is not allowed char '=' in key. First char '=' is delimiter in MAP item key=value!!!
      allowPartialMatchForString - if true, we are looking for partial match, if false, we are looking only for exact match (only for STRING type attributes)
      Returns:
      list of resources that have attributes with specific values (behaviour above) if no such resource exists, returns empty list
      Throws:
      PrivilegeException - insufficient permission
      InternalErrorException - internal error
      AttributeNotExistsException - when specified attribute does not exist
      WrongAttributeAssignmentException - wrong attribute assignment
    • getMembersByGroupExpiration

      List<Member> getMembersByGroupExpiration(PerunSession sess, Group group, String operator, LocalDate date) throws PrivilegeException, GroupNotExistsException
      Return members with group expiration date set, which will expire on specified date in given group. You can specify operator for comparison (by default "=") returning exact match. So you can get all expired members (including today) using "<=" and today date. or using "<" and tomorrow date. Method returns members with its expiration status for given group. Method ignores current member state, just compares expiration date! Method returns also indirect members of group with expiration set (by accident probably), but we manage status only for direct members !!
      Parameters:
      sess - Perun session
      operator - One of "=", "<", ">", "<=", ">=". If null, "=" is anticipated.
      date - Date to compare expiration with (if null, current date is used).
      Returns:
      Members with expiration relative to method params.
      Throws:
      InternalErrorException - internal error
      PrivilegeException - insufficient permission
      GroupNotExistsException