Search in sources :

Example 11 with VoNotExistsException

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

the class MembersManagerBlImpl method insertToMemberGroup.

public void insertToMemberGroup(PerunSession sess, Member member, Vo vo) throws InternalErrorException, AlreadyMemberException, GroupOperationsException {
    // Insert member into the members group
    try {
        getPerunBl().getVosManagerBl().checkVoExists(sess, vo);
        Group g = getPerunBl().getGroupsManagerBl().getGroupByName(sess, vo, VosManager.MEMBERS_GROUP);
        getPerunBl().getGroupsManagerBl().addMemberToMembersGroup(sess, g, member);
    } catch (NotMemberOfParentGroupException ex) {
        //members group is top level -> this should not happen
        throw new ConsistencyErrorException(ex);
    } catch (GroupNotExistsException e) {
        throw new InternalErrorException(e);
    } catch (VoNotExistsException e) {
        throw new InternalErrorException(e);
    } catch (WrongAttributeValueException e) {
        //Member is not valid, so he couldn't have truly required atributes, neither he couldn't have influence on user attributes
        throw new ConsistencyErrorException(e);
    } catch (WrongReferenceAttributeValueException e) {
        //Member is not valid, so he couldn't have truly required atributes, neither he couldn't have influence on user attributes
        throw new ConsistencyErrorException(e);
    }
}
Also used : Group(cz.metacentrum.perun.core.api.Group) NotMemberOfParentGroupException(cz.metacentrum.perun.core.api.exceptions.NotMemberOfParentGroupException) ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) GroupNotExistsException(cz.metacentrum.perun.core.api.exceptions.GroupNotExistsException) ParentGroupNotExistsException(cz.metacentrum.perun.core.api.exceptions.ParentGroupNotExistsException) WrongReferenceAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) WrongAttributeValueException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException) VoNotExistsException(cz.metacentrum.perun.core.api.exceptions.VoNotExistsException)

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