Search in sources :

Example 36 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, Group group, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    if (removeAttributeWithoutCheck(sess, group, attribute)) {
        checkAttributeValue(sess, group, new Attribute(attribute));
        this.checkAttributeDependencies(sess, new RichAttribute(group, null, 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 37 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, Vo vo, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    if (removeAttributeWithoutCheck(sess, vo, attribute)) {
        checkAttributeValue(sess, vo, new Attribute(attribute));
        this.checkAttributeDependencies(sess, new RichAttribute(vo, null, 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 38 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, Facility facility, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, facility, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, facility, attribute)) {
        checkAttributeValue(sess, facility, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(facility, null, attribute));
    }
}
Also used : RichAttribute(cz.metacentrum.perun.core.api.RichAttribute)

Example 39 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, Facility facility, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    if (removeAttributeWithoutCheck(sess, facility, attribute)) {
        this.checkAttributeValue(sess, facility, new Attribute(attribute));
        this.checkAttributeDependencies(sess, new RichAttribute(facility, null, 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 40 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, Facility facility, User user, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException {
    if (attribute.getValue() == null) {
        removeAttribute(sess, facility, user, attribute);
        return;
    }
    if (setAttributeWithoutCheck(sess, facility, user, attribute)) {
        checkAttributeValue(sess, facility, user, attribute);
        this.checkAttributeDependencies(sess, new RichAttribute(facility, user, 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