Search in sources :

Example 21 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 22 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 23 with RichAttribute

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

the class AttributesManagerBlImpl method removeAttribute.

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

Example 24 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)

Example 25 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, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, resource, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, resource, attribute)) {
        checkAttributeValue(sess, resource, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(resource, null, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Aggregations

RichAttribute (cz.metacentrum.perun.core.api.RichAttribute)42 Attribute (cz.metacentrum.perun.core.api.Attribute)29 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)14 AttributeDefinition (cz.metacentrum.perun.core.api.AttributeDefinition)14 Test (org.junit.Test)14 Vo (cz.metacentrum.perun.core.api.Vo)11 ArrayList (java.util.ArrayList)6 Group (cz.metacentrum.perun.core.api.Group)3 Facility (cz.metacentrum.perun.core.api.Facility)2 User (cz.metacentrum.perun.core.api.User)2 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)2 Host (cz.metacentrum.perun.core.api.Host)1 Member (cz.metacentrum.perun.core.api.Member)1 Resource (cz.metacentrum.perun.core.api.Resource)1 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)1 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)1 WrongAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)1 WrongReferenceAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException)1 HashSet (java.util.HashSet)1 List (java.util.List)1