use of cz.metacentrum.perun.core.api.AttributeDefinition in project perun by CESNET.
the class urn_perun_user_attribute_def_def_vsupMailAlias method getAttributeDefinition.
public AttributeDefinition getAttributeDefinition() {
AttributeDefinition attr = new AttributeDefinition();
attr.setNamespace(AttributesManager.NS_USER_ATTR_DEF);
attr.setFriendlyName("vsupMailAlias");
attr.setDisplayName("School mail alias");
attr.setType(String.class.getName());
attr.setDescription("Generated school mail alias in a \"name.surname[counter]@vsup.cz\" form. This is a main alias used in Zimbra mail. Value can be empty. On users name change, attribute value must be fixed manually.");
return attr;
}
use of cz.metacentrum.perun.core.api.AttributeDefinition in project perun by CESNET.
the class urn_perun_user_facility_attribute_def_def_homeMountPoint method getAttributeDefinition.
public AttributeDefinition getAttributeDefinition() {
AttributeDefinition attr = new AttributeDefinition();
attr.setNamespace(AttributesManager.NS_USER_FACILITY_ATTR_DEF);
attr.setFriendlyName("homeMountPoint");
attr.setDisplayName("Home mount point");
attr.setType(String.class.getName());
attr.setDescription("Home mount point.");
return attr;
}
use of cz.metacentrum.perun.core.api.AttributeDefinition in project perun by CESNET.
the class urn_perun_user_facility_attribute_def_def_shell_passwd_scp method getAttributeDefinition.
public AttributeDefinition getAttributeDefinition() {
AttributeDefinition attr = new AttributeDefinition();
attr.setNamespace(AttributesManager.NS_USER_FACILITY_ATTR_DEF);
attr.setFriendlyName("shell_passwd_scp");
attr.setDisplayName("Shell for passwd_scp");
attr.setType(String.class.getName());
attr.setDescription("Shell password.");
return attr;
}
use of cz.metacentrum.perun.core.api.AttributeDefinition in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method getRichAttributesWithHoldersForAttributeDefinitionGetGroupFromUserAndFacility.
@Test
public void getRichAttributesWithHoldersForAttributeDefinitionGetGroupFromUserAndFacility() throws Exception {
System.out.println(CLASS_NAME + "getRichAttributesWithHoldersForAttributeDefinitionGetGroupFromUserAndFacility");
//Prepare attribute, create it and set it with testing value
Attribute attribute = setAttributeInNamespace(AttributesManager.NS_GROUP_ATTR);
perun.getAttributesManagerBl().setAttribute(sess, group1InVo2, attribute);
perun.getAttributesManagerBl().setAttribute(sess, group2InVo2, attribute);
//Prepare richAttribute with holders (attribute is not needed but holders are needed)
RichAttribute richAttr = new RichAttribute();
richAttr.setPrimaryHolder(user2);
richAttr.setSecondaryHolder(facility2);
List<RichAttribute> listOfRichAttributes = perun.getAttributesManagerBl().getRichAttributesWithHoldersForAttributeDefinition(sess, new AttributeDefinition(attribute), richAttr);
assertTrue("return two groups", listOfRichAttributes.size() == 2);
assertTrue("primary holder is type of vo", listOfRichAttributes.get(0).getPrimaryHolder() instanceof Group);
assertTrue("secondary holder is null", listOfRichAttributes.get(0).getSecondaryHolder() == null);
List<Group> groups = new ArrayList<Group>();
for (RichAttribute ra : listOfRichAttributes) {
groups.add((Group) ra.getPrimaryHolder());
}
assertTrue("groups contains group1InVo2", groups.contains(group1InVo2));
assertTrue("groups contains group2InVo2", groups.contains(group2InVo2));
assertTrue("richObject have in Attribute our attribute, which was set before", listOfRichAttributes.get(0).getAttribute().equals(attribute));
}
use of cz.metacentrum.perun.core.api.AttributeDefinition in project perun by CESNET.
the class AttributesManagerEntryIntegrationTest method getRichAttributesWithHoldersForAttributeDefinitionGetGroupFromResourceAndGroup.
@Test
public void getRichAttributesWithHoldersForAttributeDefinitionGetGroupFromResourceAndGroup() throws Exception {
System.out.println(CLASS_NAME + "getRichAttributesWithHoldersForAttributeDefinitionGetGroupFromResourceAndGroup");
//Prepare attribute, create it and set it with testing value
Attribute attribute = setAttributeInNamespace(AttributesManager.NS_GROUP_ATTR);
perun.getAttributesManagerBl().setAttribute(sess, group2InVo2, attribute);
//Prepare richAttribute with holders (attribute is not needed but holders are needed)
RichAttribute richAttr = new RichAttribute();
richAttr.setPrimaryHolder(resource1InVo2);
richAttr.setSecondaryHolder(group2InVo2);
List<RichAttribute> listOfRichAttributes = perun.getAttributesManagerBl().getRichAttributesWithHoldersForAttributeDefinition(sess, new AttributeDefinition(attribute), richAttr);
//Return facilities Administrator too if exists
assertTrue("return only one group", listOfRichAttributes.size() == 1);
assertTrue("primary holder is type of vo", listOfRichAttributes.get(0).getPrimaryHolder() instanceof Group);
assertTrue("secondary holder is null", listOfRichAttributes.get(0).getSecondaryHolder() == null);
assertTrue("richObject have in primaryAttribute our group", listOfRichAttributes.get(0).getPrimaryHolder().equals(group2InVo2));
assertTrue("richObject have in Attribute our attribute, which was set before", listOfRichAttributes.get(0).getAttribute().equals(attribute));
}
Aggregations