Search in sources :

Example 6 with VoNotExistsException

use of cz.metacentrum.perun.core.api.exceptions.VoNotExistsException in project perun by CESNET.

the class FacilitiesManagerBlImpl method getAllowedVos.

public List<Vo> getAllowedVos(PerunSession sess, Facility facility) throws InternalErrorException {
    List<Vo> vos = new ArrayList<Vo>();
    List<Integer> voIds = getFacilitiesManagerImpl().getAllowedVosIds(sess, facility);
    try {
        for (Integer id : voIds) {
            vos.add(getPerunBl().getVosManagerBl().getVoById(sess, id));
        }
    } catch (VoNotExistsException ex) {
        throw new ConsistencyErrorException("Non-existent VO is allowed on the facility", ex);
    }
    return vos;
}
Also used : ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) ArrayList(java.util.ArrayList) Vo(cz.metacentrum.perun.core.api.Vo) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException)

Example 7 with VoNotExistsException

use of cz.metacentrum.perun.core.api.exceptions.VoNotExistsException in project perun by CESNET.

the class VosManagerBlImpl method findCandidates.

public List<Candidate> findCandidates(PerunSession sess, Group group, String searchString) throws InternalErrorException {
    List<Candidate> candidates = new ArrayList<>();
    try {
        // Iterate through all registered extSources in the group
        for (ExtSource source : getPerunBl().getExtSourcesManagerBl().getGroupExtSources(sess, group)) {
            // Info if this is only simple ext source, change behavior if not
            boolean simpleExtSource = true;
            // Get potential subjects from the extSource
            List<Map<String, String>> subjects;
            try {
                if (source instanceof ExtSourceApi) {
                    // find subjects with all their properties
                    subjects = ((ExtSourceApi) source).findSubjects(searchString);
                    simpleExtSource = false;
                } else {
                    // find subjects only with logins - they then must be retrieved by login
                    subjects = ((ExtSourceSimpleApi) source).findSubjectsLogins(searchString);
                }
            } catch (ExtSourceUnsupportedOperationException e1) {
                log.warn("ExtSource {} doesn't support findSubjects", source.getName());
                continue;
            } catch (InternalErrorException e) {
                log.error("Error occurred on ExtSource {},  Exception {}.", source.getName(), e);
                continue;
            } finally {
                try {
                    ((ExtSourceSimpleApi) source).close();
                } catch (ExtSourceUnsupportedOperationException e) {
                // ExtSource doesn't support that functionality, so silently skip it.
                } catch (InternalErrorException e) {
                    log.error("Can't close extSource connection. Cause: {}", e);
                }
            }
            Set<String> uniqueLogins = new HashSet<>();
            for (Map<String, String> s : subjects) {
                // Check if the user has unique identifier within extSource
                if ((s.get("login") == null) || (s.get("login") != null && ((String) s.get("login")).isEmpty())) {
                    log.error("User '{}' cannot be added, because he/she doesn't have a unique identifier (login)", s);
                    // Skip to another user
                    continue;
                }
                String extLogin = (String) s.get("login");
                // check uniqueness of every login in extSource
                if (uniqueLogins.contains(extLogin)) {
                    throw new InternalErrorException("There are more than 1 login '" + extLogin + "' getting from extSource '" + source + "'");
                } else {
                    uniqueLogins.add(extLogin);
                }
                // Get Candidate
                Candidate candidate;
                try {
                    if (simpleExtSource) {
                        // retrieve data about subjects from ext source based on ext. login
                        candidate = getPerunBl().getExtSourcesManagerBl().getCandidate(sess, source, extLogin);
                    } else {
                        // retrieve data about subjects from subjects we already have locally
                        candidate = getPerunBl().getExtSourcesManagerBl().getCandidate(sess, s, source, extLogin);
                    }
                } catch (ExtSourceNotExistsException e) {
                    throw new ConsistencyErrorException("Getting candidate from non-existing extSource " + source, e);
                } catch (CandidateNotExistsException e) {
                    throw new ConsistencyErrorException("findSubjects returned that candidate, but getCandidate cannot find him using login " + extLogin, e);
                } catch (ExtSourceUnsupportedOperationException e) {
                    throw new InternalErrorException("extSource supports findSubjects but not getCandidate???", e);
                }
                try {
                    Vo vo = getPerunBl().getVosManagerBl().getVoById(sess, group.getVoId());
                    getPerunBl().getMembersManagerBl().getMemberByUserExtSources(sess, vo, candidate.getUserExtSources());
                    // Candidate is already a member of the VO, so do not add him to the list of candidates
                    continue;
                } catch (VoNotExistsException e) {
                    throw new InternalErrorException(e);
                } catch (MemberNotExistsException e) {
                // This is OK
                }
                // Add candidate to the list of candidates
                log.debug("findCandidates: returning candidate: {}", candidate);
                candidates.add(candidate);
            }
        }
        log.debug("Returning {} potential members for group {}", candidates.size(), group);
        return candidates;
    } catch (RuntimeException e) {
        throw new InternalErrorException(e);
    }
}
Also used : Candidate(cz.metacentrum.perun.core.api.Candidate) ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) MemberNotExistsException(cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException) ArrayList(java.util.ArrayList) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) ExtSourceApi(cz.metacentrum.perun.core.implApi.ExtSourceApi) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException) Vo(cz.metacentrum.perun.core.api.Vo) ExtSource(cz.metacentrum.perun.core.api.ExtSource) ExtSourceUnsupportedOperationException(cz.metacentrum.perun.core.api.exceptions.ExtSourceUnsupportedOperationException) ExtSourceNotExistsException(cz.metacentrum.perun.core.api.exceptions.ExtSourceNotExistsException) Map(java.util.Map) ExtSourceSimpleApi(cz.metacentrum.perun.core.implApi.ExtSourceSimpleApi) HashSet(java.util.HashSet) CandidateNotExistsException(cz.metacentrum.perun.core.api.exceptions.CandidateNotExistsException)

Example 8 with VoNotExistsException

use of cz.metacentrum.perun.core.api.exceptions.VoNotExistsException in project perun by CESNET.

the class ServicesManagerBlImpl method getDataWithGroups.

private ServiceAttributes getDataWithGroups(PerunSession sess, Service service, Facility facility, Resource resource) throws InternalErrorException {
    ServiceAttributes resourceServiceAttributes = new ServiceAttributes();
    resourceServiceAttributes.addAttributes(getPerunBl().getAttributesManagerBl().getRequiredAttributes(sess, service, resource));
    //Add there also voRequiredAttributes for service
    try {
        Vo resourceVo = getPerunBl().getVosManagerBl().getVoById(sess, resource.getVoId());
        resourceServiceAttributes.addAttributes(getPerunBl().getAttributesManagerBl().getRequiredAttributes(sess, service, resourceVo));
    } catch (VoNotExistsException ex) {
        throw new ConsistencyErrorException("There is missing Vo for existing resource " + resource);
    }
    ServiceAttributes membersAbstractSA = new ServiceAttributes();
    Map<Member, ServiceAttributes> memberAttributes = new HashMap<Member, ServiceAttributes>();
    List<Member> members = getPerunBl().getResourcesManagerBl().getAllowedMembers(sess, resource);
    HashMap<Member, List<Attribute>> attributes;
    try {
        attributes = getPerunBl().getAttributesManagerBl().getRequiredAttributes(sess, service, facility, resource, members, true);
    } catch (WrongAttributeAssignmentException ex) {
        throw new InternalErrorException(ex);
    }
    for (Member mem : attributes.keySet()) {
        ServiceAttributes tmpAttributes = new ServiceAttributes();
        tmpAttributes.addAttributes(attributes.get(mem));
        memberAttributes.put(mem, tmpAttributes);
        membersAbstractSA.addChildElement(tmpAttributes);
    }
    ServiceAttributes groupsAbstractSA = new ServiceAttributes();
    List<Group> groups = getPerunBl().getResourcesManagerBl().getAssignedGroups(sess, resource);
    for (Group group : groups) {
        groupsAbstractSA.addChildElement(getData(sess, service, facility, resource, group, memberAttributes));
    }
    //assign abstract services attributes to resource service attributes
    resourceServiceAttributes.addChildElement(groupsAbstractSA);
    resourceServiceAttributes.addChildElement(membersAbstractSA);
    return resourceServiceAttributes;
}
Also used : Group(cz.metacentrum.perun.core.api.Group) ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) HashMap(java.util.HashMap) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException) ServiceAttributes(cz.metacentrum.perun.core.api.ServiceAttributes) Vo(cz.metacentrum.perun.core.api.Vo) List(java.util.List) ArrayList(java.util.ArrayList) Member(cz.metacentrum.perun.core.api.Member)

Example 9 with VoNotExistsException

use of cz.metacentrum.perun.core.api.exceptions.VoNotExistsException in project perun by CESNET.

the class urn_perun_group_attribute_def_def_groupExtSource method checkAttributeValue.

@Override
public void checkAttributeValue(PerunSessionImpl sess, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException {
    //prepare groupName value variable
    String extSourceName = null;
    if (attribute.getValue() != null)
        extSourceName = (String) attribute.getValue();
    if (extSourceName == null) {
        //attribute can be removed
        return;
    } else {
        try {
            Vo groupVo = sess.getPerunBl().getVosManagerBl().getVoById(sess, group.getVoId());
            List<ExtSource> allowedExtSources = sess.getPerunBl().getExtSourcesManagerBl().getVoExtSources(sess, groupVo);
            for (ExtSource es : allowedExtSources) {
                if (extSourceName.equals(es.getName()))
                    return;
            }
            throw new WrongAttributeValueException(attribute, group, "ExtSourceName " + extSourceName + " is not valid, because VO " + groupVo + " of this group has no such extSource assigned.");
        } catch (VoNotExistsException ex) {
            throw new ConsistencyErrorException("Vo of this group " + group + " not exists!");
        }
    }
}
Also used : ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) Vo(cz.metacentrum.perun.core.api.Vo) ExtSource(cz.metacentrum.perun.core.api.ExtSource) WrongAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException)

Example 10 with VoNotExistsException

use of cz.metacentrum.perun.core.api.exceptions.VoNotExistsException in project perun by CESNET.

the class MembersManagerBlImpl method manageMembershipExpiration.

/**
	 * More info on https://wiki.metacentrum.cz/wiki/VO_managers%27s_manual
	 *
	 * If setAttributeValue is true, then store the membership expiration date into the attribute, otherwise
	 * return object pair containing true/false if the member can be extended and date specifying exact date of the new expiration
	 *
	 * @param sess session
	 * @param member member to check / set membership expiration
	 * @param setAttributeValue TRUE = set new membership expiration date / FALSE = do NOT set new expiration date (just calculate it)
	 * @param throwExceptions TRUE = throw exception / FALSE = return false when member can't extend membership
	 * @return Pair with result in left side (can / can't extend membership) and Date in right side telling new membership expiration date
	 *
	 * @throws InternalErrorException
	 * @throws ExtendMembershipException When member can't extend membership and throwException is set to true.
	 */
protected Pair<Boolean, Date> manageMembershipExpiration(PerunSession sess, Member member, boolean setAttributeValue, boolean throwExceptions) throws InternalErrorException, ExtendMembershipException {
    // Check if the VO has set membershipExpirationRules attribute
    LinkedHashMap<String, String> membershipExpirationRules;
    Vo vo;
    Attribute membershipExpirationRulesAttribute = null;
    try {
        vo = getPerunBl().getVosManagerBl().getVoById(sess, member.getVoId());
        membershipExpirationRulesAttribute = getPerunBl().getAttributesManagerBl().getAttribute(sess, vo, MembersManager.membershipExpirationRulesAttributeName);
        membershipExpirationRules = (LinkedHashMap<String, String>) membershipExpirationRulesAttribute.getValue();
        // If attribute was not filled, then silently exit
        if (membershipExpirationRules == null)
            return new Pair<Boolean, Date>(true, null);
    } catch (VoNotExistsException e) {
        throw new ConsistencyErrorException("Member " + member + " of non-existing VO id=" + member.getVoId());
    } catch (AttributeNotExistsException e) {
        // There is no attribute definition for membership expiration rules.
        return new Pair<Boolean, Date>(true, null);
    } catch (WrongAttributeAssignmentException e) {
        throw new InternalErrorException("Shouldn't happen.");
    }
    // Get user LOA
    String memberLoa = null;
    try {
        Attribute loa = getPerunBl().getAttributesManagerBl().getAttribute(sess, member, AttributesManager.NS_MEMBER_ATTR_VIRT + ":loa");
        memberLoa = (String) loa.getValue();
    } catch (AttributeNotExistsException e) {
    // Ignore, will be probably set further
    } catch (WrongAttributeAssignmentException e) {
        throw new InternalErrorException(e);
    }
    // Get current membershipExpiration date
    Attribute membershipExpirationAttribute = null;
    try {
        membershipExpirationAttribute = getPerunBl().getAttributesManagerBl().getAttribute(sess, member, AttributesManager.NS_MEMBER_ATTR_DEF + ":membershipExpiration");
    } catch (AttributeNotExistsException e) {
        throw new ConsistencyErrorException("Attribute: " + AttributesManager.NS_MEMBER_ATTR_DEF + ":membershipExpiration" + " must be defined in order to use membershipExpirationRules");
    } catch (WrongAttributeAssignmentException e) {
        throw new InternalErrorException(e);
    }
    boolean isServiceUser = false;
    try {
        User user = getPerunBl().getUsersManagerBl().getUserById(sess, member.getUserId());
        isServiceUser = user.isServiceUser();
    } catch (UserNotExistsException ex) {
        throw new ConsistencyErrorException("User must exists for " + member + " when checking expiration rules.");
    }
    // and are not service users
    if (membershipExpirationRules.get(MembersManager.membershipDoNotExtendLoaKeyName) != null && membershipExpirationAttribute.getValue() != null && !isServiceUser) {
        if (memberLoa == null) {
            // Member doesn't have LOA defined and LOA is required for extension, so do not extend membership.
            log.warn("Member {} doesn't have LOA defined, but 'doNotExtendLoa' option is set for VO id {}.", member, member.getVoId());
            if (throwExceptions) {
                throw new ExtendMembershipException(ExtendMembershipException.Reason.NOUSERLOA, "Member " + member + " doesn't have LOA defined, but 'doNotExtendLoa' option is set for VO id " + member.getVoId() + ".");
            } else {
                return new Pair<Boolean, Date>(false, null);
            }
        }
        String[] doNotExtendLoas = membershipExpirationRules.get(MembersManager.membershipDoNotExtendLoaKeyName).split(",");
        for (String doNotExtendLoa : doNotExtendLoas) {
            if (doNotExtendLoa.equals(memberLoa)) {
                // Member has LOA which is not allowed for extension
                if (throwExceptions) {
                    throw new ExtendMembershipException(ExtendMembershipException.Reason.INSUFFICIENTLOAFOREXTENSION, "Member " + member + " doesn't have required LOA for VO id " + member.getVoId() + ".");
                } else {
                    return new Pair<Boolean, Date>(false, null);
                }
            }
        }
    }
    Calendar calendar = Calendar.getInstance();
    // Does the user have expired membership, if yes, then for canExtendMembership return true
    if (!setAttributeValue && membershipExpirationAttribute.getValue() != null) {
        try {
            Date currentMemberExpiration = BeansUtils.getDateFormatterWithoutTime().parse((String) membershipExpirationAttribute.getValue());
            Calendar currentMemberExpirationCalendar = Calendar.getInstance();
            currentMemberExpirationCalendar.setTime(currentMemberExpiration);
            if (calendar.after(currentMemberExpirationCalendar)) {
                return new Pair<Boolean, Date>(true, null);
            }
        } catch (ParseException e) {
            throw new InternalErrorException("Wrong format of the membersExpiration: " + membershipExpirationAttribute.getValue(), e);
        }
    }
    String period = null;
    // Default extension
    if (membershipExpirationRules.get(MembersManager.membershipPeriodKeyName) != null) {
        period = membershipExpirationRules.get(MembersManager.membershipPeriodKeyName);
    }
    // Do we extend particular LoA? Attribute syntax LoA|[period][.]
    if (membershipExpirationRules.get(MembersManager.membershipPeriodLoaKeyName) != null) {
        // Which period
        String[] membershipPeriodLoa = membershipExpirationRules.get(MembersManager.membershipPeriodLoaKeyName).split("\\|");
        String loa = membershipPeriodLoa[0];
        String periodLoa = membershipPeriodLoa[1];
        // Does the user have this LoA?
        if (loa.equals(memberLoa)) {
            if (periodLoa.endsWith(".")) {
                // If period ends with ., then we do not allow extension for users with particular LoA if they are already members
                if (membershipExpirationAttribute.getValue() != null) {
                    if (throwExceptions) {
                        throw new ExtendMembershipException(ExtendMembershipException.Reason.INSUFFICIENTLOAFOREXTENSION, "Member " + member + " doesn't have required LOA for VO id " + member.getVoId() + ".");
                    } else {
                        return new Pair<Boolean, Date>(false, null);
                    }
                }
                // remove dot from the end of the string
                period = periodLoa.substring(0, periodLoa.length() - 1);
            } else {
                period = periodLoa;
            }
        }
    }
    // Do we extend for x months or for static date?
    if (period != null) {
        if (period.startsWith("+")) {
            if (!isMemberInGracePeriod(membershipExpirationRules, (String) membershipExpirationAttribute.getValue())) {
                if (throwExceptions) {
                    throw new ExtendMembershipException(ExtendMembershipException.Reason.OUTSIDEEXTENSIONPERIOD, (String) membershipExpirationAttribute.getValue(), "Member " + member + " cannot extend because we are outside grace period for VO id " + member.getVoId() + ".");
                } else {
                    return new Pair<Boolean, Date>(false, null);
                }
            }
            // By default do not add nothing
            int amount = 0;
            int field;
            // We will add days/months/years
            Pattern p = Pattern.compile("\\+([0-9]+)([dmy]?)");
            Matcher m = p.matcher(period);
            if (m.matches()) {
                String countString = m.group(1);
                amount = Integer.valueOf(countString);
                String dmyString = m.group(2);
                if (dmyString.equals("d")) {
                    field = Calendar.DAY_OF_YEAR;
                } else if (dmyString.equals("m")) {
                    field = Calendar.MONTH;
                } else if (dmyString.equals("y")) {
                    field = Calendar.YEAR;
                } else {
                    throw new InternalErrorException("Wrong format of period in VO membershipExpirationRules attribute. Period: " + period);
                }
            } else {
                throw new InternalErrorException("Wrong format of period in VO membershipExpirationRules attribute. Period: " + period);
            }
            // Add days/months/years
            calendar.add(field, amount);
        } else {
            // We will extend to particular date
            // Parse date
            Pattern p = Pattern.compile("([0-9]+).([0-9]+).");
            Matcher m = p.matcher(period);
            if (m.matches()) {
                int day = Integer.valueOf(m.group(1));
                int month = Integer.valueOf(m.group(2));
                // Get current year
                int year = calendar.get(Calendar.YEAR);
                // We must detect if the extension date is in current year or in a next year
                boolean extensionInNextYear;
                Calendar extensionCalendar = Calendar.getInstance();
                extensionCalendar.set(year, month - 1, day);
                Calendar today = Calendar.getInstance();
                if (extensionCalendar.before(today)) {
                    // Extension date is in a next year
                    extensionInNextYear = true;
                } else {
                    // Extension is in the current year
                    extensionInNextYear = false;
                }
                // Set the date to which the membershi should be extended, can be changed if there was grace period, see next part of the code
                // month is 0-based
                calendar.set(year, month - 1, day);
                if (extensionInNextYear) {
                    calendar.add(Calendar.YEAR, 1);
                }
                // Is there a grace period?
                if (membershipExpirationRules.get(MembersManager.membershipGracePeriodKeyName) != null) {
                    String gracePeriod = membershipExpirationRules.get(MembersManager.membershipGracePeriodKeyName);
                    // If the extension is requested in period-gracePeriod then extend to next period
                    // Get the value of the grace period
                    p = Pattern.compile("([0-9]+)([dmy]?)");
                    m = p.matcher(gracePeriod);
                    if (m.matches()) {
                        String countString = m.group(1);
                        int amount = Integer.valueOf(countString);
                        // Set the gracePeriodCalendar to the extension date
                        Calendar gracePeriodCalendar = Calendar.getInstance();
                        gracePeriodCalendar.set(year, month - 1, day);
                        if (extensionInNextYear) {
                            gracePeriodCalendar.add(Calendar.YEAR, 1);
                        }
                        int field;
                        String dmyString = m.group(2);
                        if (dmyString.equals("d")) {
                            field = Calendar.DAY_OF_YEAR;
                        } else if (dmyString.equals("m")) {
                            field = Calendar.MONTH;
                        } else if (dmyString.equals("y")) {
                            field = Calendar.YEAR;
                        } else {
                            throw new InternalErrorException("Wrong format of gracePeriod in VO membershipExpirationRules attribute. gracePeriod: " + gracePeriod);
                        }
                        // subtracts period definition, e.g. 3m
                        gracePeriodCalendar.add(field, -amount);
                        // Check if we are in grace period
                        if (gracePeriodCalendar.before(Calendar.getInstance())) {
                            // We are in grace period, so extend to the next period
                            calendar.add(Calendar.YEAR, 1);
                        }
                        // If we do not need to set the attribute value, only check if the current member's expiration time is not in grace period
                        if (!setAttributeValue && membershipExpirationAttribute.getValue() != null) {
                            try {
                                Date currentMemberExpiration = BeansUtils.getDateFormatterWithoutTime().parse((String) membershipExpirationAttribute.getValue());
                                // subtracts grace period from the currentMemberExpiration
                                Calendar currentMemberExpirationCalendar = Calendar.getInstance();
                                currentMemberExpirationCalendar.setTime(currentMemberExpiration);
                                currentMemberExpirationCalendar.add(field, -amount);
                                // if today is before that time, user can extend his period
                                if (currentMemberExpirationCalendar.after(Calendar.getInstance())) {
                                    if (throwExceptions) {
                                        throw new ExtendMembershipException(ExtendMembershipException.Reason.OUTSIDEEXTENSIONPERIOD, (String) membershipExpirationAttribute.getValue(), "Member " + member + " cannot extend because we are outside grace period for VO id " + member.getVoId() + ".");
                                    } else {
                                        return new Pair<Boolean, Date>(false, null);
                                    }
                                }
                            } catch (ParseException e) {
                                throw new InternalErrorException("Wrong format of the membersExpiration: " + membershipExpirationAttribute.getValue(), e);
                            }
                        }
                    }
                }
            } else {
                throw new InternalErrorException("Wrong format of period in VO membershipExpirationRules attribute. Period: " + period);
            }
        }
        // Reset hours, minutes and seconds to 0
        calendar.set(Calendar.HOUR, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        // Set new value of the membershipExpiration for the member
        if (setAttributeValue) {
            membershipExpirationAttribute.setValue(BeansUtils.getDateFormatterWithoutTime().format(calendar.getTime()));
            try {
                getPerunBl().getAttributesManagerBl().setAttribute(sess, member, membershipExpirationAttribute);
            } catch (WrongAttributeValueException e) {
                throw new InternalErrorException("Wrong value: " + membershipExpirationAttribute.getValue(), e);
            } catch (WrongReferenceAttributeValueException e) {
                throw new InternalErrorException(e);
            } catch (WrongAttributeAssignmentException e) {
                throw new InternalErrorException(e);
            }
        }
    }
    return new Pair<Boolean, Date>(true, calendar.getTime());
}
Also used : User(cz.metacentrum.perun.core.api.User) Attribute(cz.metacentrum.perun.core.api.Attribute) UserNotExistsException(cz.metacentrum.perun.core.api.exceptions.UserNotExistsException) Matcher(java.util.regex.Matcher) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) AttributeNotExistsException(cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException) ExtendMembershipException(cz.metacentrum.perun.core.api.exceptions.ExtendMembershipException) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException) WrongReferenceAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException) Vo(cz.metacentrum.perun.core.api.Vo) Pair(cz.metacentrum.perun.core.api.Pair) Pattern(java.util.regex.Pattern) ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) Calendar(java.util.Calendar) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) Date(java.util.Date) ParseException(java.text.ParseException) WrongAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)

Aggregations

VoNotExistsException (cz.metacentrum.perun.core.api.exceptions.VoNotExistsException)11 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)10 Vo (cz.metacentrum.perun.core.api.Vo)8 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)8 ArrayList (java.util.ArrayList)6 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)5 WrongAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)5 AttributeNotExistsException (cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException)4 Group (cz.metacentrum.perun.core.api.Group)3 MemberNotExistsException (cz.metacentrum.perun.core.api.exceptions.MemberNotExistsException)3 HashMap (java.util.HashMap)3 Map (java.util.Map)3 Attribute (cz.metacentrum.perun.core.api.Attribute)2 ExtSource (cz.metacentrum.perun.core.api.ExtSource)2 Member (cz.metacentrum.perun.core.api.Member)2 User (cz.metacentrum.perun.core.api.User)2 GroupNotExistsException (cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException)2 WrongReferenceAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException)2 BigDecimal (java.math.BigDecimal)2 LinkedHashMap (java.util.LinkedHashMap)2