Search in sources :

Example 16 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, User user, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    if (removeAttributeWithoutCheck(sess, user, attribute)) {
        checkAttributeValue(sess, user, new Attribute(attribute));
        this.checkAttributeDependencies(sess, new RichAttribute(user, 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 17 with RichAttribute

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

the class AttributesManagerBlImpl method removeAttribute.

@Override
public void removeAttribute(PerunSession sess, Member member, Group group, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    if (removeAttributeWithoutCheck(sess, member, group, attribute)) {
        checkAttributeValue(sess, member, group, new Attribute(attribute));
        this.checkAttributeDependencies(sess, new RichAttribute(member, group, 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 18 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 19 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, Group group, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    if (removeAttributeWithoutCheck(sess, resource, group, attribute)) {
        checkAttributeValue(sess, resource, group, new Attribute(attribute));
        this.checkAttributeDependencies(sess, new RichAttribute(resource, group, 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 20 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)

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