@@ -0,0 +1,2422 @@
+package cz.metacentrum.perun.core.impl.modules.attributes;%0A%0Aimport cz.metacentrum.perun.core.api.Attribute;%0Aimport cz.metacentrum.perun.core.api.AttributeDefinition;%0Aimport cz.metacentrum.perun.core.api.AttributesManager;%0Aimport cz.metacentrum.perun.core.api.Group;%0Aimport cz.metacentrum.perun.core.api.exceptions.InternalErrorException;%0Aimport cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException;%0Aimport cz.metacentrum.perun.core.api.exceptions.WrongAttributeValueException;%0Aimport cz.metacentrum.perun.core.api.exceptions.WrongReferenceAttributeValueException;%0Aimport cz.metacentrum.perun.core.impl.PerunSessionImpl;%0Aimport cz.metacentrum.perun.core.implApi.modules.attributes.GroupAttributesModuleAbstract;%0Aimport cz.metacentrum.perun.core.implApi.modules.attributes.GroupAttributesModuleImplApi;%0A%0Aimport java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * Group vomGroupName attribute.%0A *%0A * @author Vojtech Sassmann %3Cvojtech.sassmann@gmail.com%3E%0A */%0Apublic class urn_perun_group_attribute_def_def_vomsGroupName extends GroupAttributesModuleAbstract implements GroupAttributesModuleImplApi %7B%0A%0A%09private static final Pattern pattern = Pattern.compile(%22%5E%5B%5E%3C%3E&=%5D*$%22);%0A%0A%09@Override%0A%09public void checkAttributeValue(PerunSessionImpl perunSession, Group group, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException %7B%0A%09%09String vomsGroupName;%0A%0A%09%09if(attribute.getValue() == null) %7B%0A%09%09%09throw new WrongAttributeValueException(attribute, %22Group vomsGroupName cannot be null.%22);%0A%09%09%7D%0A%09%09if(!(attribute.getValue() instanceof String)) %7B%0A%09%09%09throw new WrongAttributeValueException(attribute, %22Wrong type of the attribute. Expected: String%22);%0A%09%09%7D%0A%0A%09%09vomsGroupName = (String) attribute.getValue();%0A%0A%09%09Matcher matcher = pattern.matcher(vomsGroupName);%0A%0A%09%09if(!matcher.matches()) %7B%0A%09%09%09throw new WrongAttributeValueException(attribute, %22Bad format of attribute vomsGroupName. It should not contain '%3C%3E&=' characters.%22);%0A%09%09%7D%0A%09%7D%0A%0A%09@Override%0A%09public AttributeDefinition getAttributeDefinition() %7B%0A%09%09AttributeDefinition attr = new AttributeDefinition();%0A%09%09attr.setFriendlyName(%22vomsGroupName%22);%0A%09%09attr.setDisplayName(%22Voms group name%22);%0A%09%09attr.setDescription(%22Name of voms group, if defined.%22);%0A%09%09attr.setType(String.class.getName());%0A%09%09attr.setNamespace(AttributesManager.NS_GROUP_ATTR_DEF);%0A%09%09return attr;%0A%09%7D%0A%7D%0A

Add vomsGroupName attribute