class urn_perun_group_resource_attribute_def_def_freeipaGroupName extends GroupResourceAttributesModuleAbstract implements GroupResourceAttributesModuleImplApi {

	@Override
	public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws WrongAttributeValueException {

		//prepare group name and check its format
		String groupName = attribute.valueAsString();
		if (groupName == null) return;

		Matcher match = pattern.matcher(groupName);

		if (!match.matches()) {
			throw new WrongAttributeValueException(attribute, group, "Bad format of attribute freeipaGroupName. It has to match pattern ^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,252}[a-zA-Z0-9_.$-]?$");
		}
	}

}