Search in sources :

Example 1 with RichAttribute

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

the class AttributesManagerBlImpl method setAttribute.

@Override
public void setAttribute(PerunSession sess, Member member, Group group, Attribute attribute) throws InternalErrorException, AttributeNotExistsException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, member, group, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, member, group, attribute, false)) {
        checkAttributeValue(sess, member, group, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(member, group, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Example 2 with RichAttribute

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

the class AttributesManagerBlImpl method setAttribute.

public void setAttribute(PerunSession sess, Host host, Attribute attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, host, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, host, attribute)) {
        checkAttributeValue(sess, host, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(host, null, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Example 3 with RichAttribute

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

the class AttributesManagerBlImpl method setAttribute.

public void setAttribute(PerunSession sess, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, group, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, group, attribute)) {
        checkAttributeValue(sess, group, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(group, null, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Example 4 with RichAttribute

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

the class AttributesManagerBlImpl method setAttribute.

public void setAttribute(PerunSession sess, Resource resource, Member member, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, resource, member, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, resource, member, attribute, false)) {
        checkAttributeValue(sess, resource, member, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(resource, member, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Example 5 with RichAttribute

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

the class AttributesManagerBlImpl method setAttribute.

public void setAttribute(PerunSession sess, UserExtSource ues, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, ues, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, ues, attribute)) {
        checkAttributeValue(sess, ues, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(ues, null, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Aggregations

RichAttribute (cz.metacentrum.perun.core.api.RichAttribute)321 ArrayList (java.util.ArrayList)284 Attribute (cz.metacentrum.perun.core.api.Attribute)220 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)154 Test (org.junit.Test)154 Method (java.lang.reflect.Method)140 List (java.util.List)140 HashSet (java.util.HashSet)94 AllAttributesRemovedForMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForMember)34 AllAttributesRemovedForResourceAndMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForResourceAndMember)34 AttributeRemovedForMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForMember)34 AttributeRemovedForResourceAndMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForResourceAndMember)34 AttributeSetForMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForMember)34 AttributeSetForResourceAndMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForResourceAndMember)34 Member (cz.metacentrum.perun.core.api.Member)34 AttributeRemovedForFacility (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForFacility)32 AttributeSetForFacility (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForFacility)32 Facility (cz.metacentrum.perun.core.api.Facility)32 AllAttributesRemovedForFacilityAndUser (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForFacilityAndUser)31 AllAttributesRemovedForUser (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForUser)31