Search in sources :

Example 71 with AttributeDefinition

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

the class urn_perun_resource_attribute_def_def_projectsBasePath method getAttributeDefinition.

public AttributeDefinition getAttributeDefinition() {
    AttributeDefinition attr = new AttributeDefinition();
    attr.setNamespace(AttributesManager.NS_RESOURCE_ATTR_DEF);
    attr.setFriendlyName("projectsBasePath");
    attr.setDisplayName("Projects base path");
    attr.setType(String.class.getName());
    attr.setDescription("Path to base directory of projects.");
    return attr;
}
Also used : AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Example 72 with AttributeDefinition

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

the class urn_perun_resource_attribute_def_def_redmineProjectID method getAttributeDefinition.

@Override
public AttributeDefinition getAttributeDefinition() {
    AttributeDefinition attr = new AttributeDefinition();
    attr.setNamespace(AttributesManager.NS_RESOURCE_ATTR_DEF);
    attr.setFriendlyName("redmineProjectID");
    attr.setDisplayName("Redmine project ID");
    attr.setType(String.class.getName());
    attr.setDescription("ID for redmine project.");
    return attr;
}
Also used : AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Example 73 with AttributeDefinition

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

the class urn_perun_user_facility_attribute_def_def_basicDefaultGID method fillAttribute.

@Override
public Attribute fillAttribute(PerunSessionImpl sess, Facility facility, User user, AttributeDefinition attributeDefinition) throws InternalErrorException, WrongAttributeAssignmentException {
    Attribute attribute = new Attribute(attributeDefinition);
    List<Resource> allowedResources = sess.getPerunBl().getUsersManagerBl().getAllowedResources(sess, facility, user);
    try {
        for (Resource resource : allowedResources) {
            List<AttributeDefinition> resourceRequiredAttributesDefinitions = sess.getPerunBl().getAttributesManagerBl().getResourceRequiredAttributesDefinition(sess, resource);
            //if this attribute is not required by the services on the resource, skip the resource
            if (!resourceRequiredAttributesDefinitions.contains(attributeDefinition)) {
                continue;
            }
            Attribute unixGidAttribute = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, resource, AttributesManager.NS_RESOURCE_ATTR_VIRT + ":unixGID");
            if (unixGidAttribute.getValue() != null) {
                attribute.setValue(unixGidAttribute.getValue());
                return attribute;
            }
        }
    } catch (AttributeNotExistsException ex) {
        throw new ConsistencyErrorException(ex);
    }
    return attribute;
}
Also used : ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) Attribute(cz.metacentrum.perun.core.api.Attribute) AttributeNotExistsException(cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException) Resource(cz.metacentrum.perun.core.api.Resource) AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Example 74 with AttributeDefinition

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

the class urn_perun_user_facility_attribute_def_def_basicDefaultGID method getAttributeDefinition.

public AttributeDefinition getAttributeDefinition() {
    AttributeDefinition attr = new AttributeDefinition();
    attr.setNamespace(AttributesManager.NS_USER_FACILITY_ATTR_DEF);
    attr.setFriendlyName("basicDefaultGID");
    attr.setType(Integer.class.getName());
    attr.setDescription("Pregenerated primary unix gid which is used if user doesn't have other preferencies.");
    return attr;
}
Also used : AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Example 75 with AttributeDefinition

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

the class urn_perun_user_attribute_def_virt_preferredPhone method getAttributeDefinition.

public AttributeDefinition getAttributeDefinition() {
    AttributeDefinition attr = new AttributeDefinition();
    attr.setNamespace(AttributesManager.NS_USER_ATTR_VIRT);
    attr.setFriendlyName("preferredPhone");
    attr.setDisplayName("Preferred phone");
    attr.setType(String.class.getName());
    attr.setDescription("Preferred phone resolved from phone, mobilePhone and privatePhone (both DC2 and KOS).");
    return attr;
}
Also used : AttributeDefinition(cz.metacentrum.perun.core.api.AttributeDefinition)

Aggregations

AttributeDefinition (cz.metacentrum.perun.core.api.AttributeDefinition)396 Attribute (cz.metacentrum.perun.core.api.Attribute)157 ArrayList (java.util.ArrayList)46 Test (org.junit.Test)38 AbstractPerunIntegrationTest (cz.metacentrum.perun.core.AbstractPerunIntegrationTest)33 User (cz.metacentrum.perun.core.api.User)24 RichAttribute (cz.metacentrum.perun.core.api.RichAttribute)22 Vo (cz.metacentrum.perun.core.api.Vo)15 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)14 Facility (cz.metacentrum.perun.core.api.Facility)12 AttributeNotExistsException (cz.metacentrum.perun.core.api.exceptions.AttributeNotExistsException)12 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)12 Resource (cz.metacentrum.perun.core.api.Resource)10 LinkedHashMap (java.util.LinkedHashMap)10 Group (cz.metacentrum.perun.core.api.Group)8 Member (cz.metacentrum.perun.core.api.Member)8 PerunSession (cz.metacentrum.perun.core.api.PerunSession)7 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)6 WrongAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException)5 WrongReferenceAttributeValueException (cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException)5