Class urn_perun_user_attribute_def_virt_institutionsCountries
java.lang.Object
cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.UserAttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.UserVirtualAttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.UserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>
cz.metacentrum.perun.core.impl.modules.attributes.urn_perun_user_attribute_def_virt_institutionsCountries
- All Implemented Interfaces:
AttributesModuleImplApi,UserAttributesModuleImplApi,UserVirtualAttributesModuleImplApi,VirtualAttributesModuleImplApi
public class urn_perun_user_attribute_def_virt_institutionsCountries
extends UserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>
Virtual user's attribute for converting schacHomeOrganization names to country names. Using help of entityless
attribute dnsStateMapping for conversion. Using the greedy approach -> always taking the longest match from the
available ones. Returns only non-empty values.
Examples:
muni.cz -> Czech Republic
oxford.ac.uk -> United Kingdom
.ebi.ac.uk -> null
- Author:
- Vladimir Mecko vladimir.mecko@gmail.com, Martin Kuba makub@ics.muni.cz
-
Nested Class Summary
Nested classes/interfaces inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserVirtualAttributeCollectedFromUserExtSource
UserVirtualAttributeCollectedFromUserExtSource.AttributeHandleIdentifier, UserVirtualAttributeCollectedFromUserExtSource.ModifyValueContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies friendly (short) name of attribute from namespace urn:perun:user:attribute-def:virt where values will be storedSpecifies friendly (short) name of attribute from namespace urn:perun:ues:attribute-def:def whose values are to be collected.protected cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtxinitModifyValueContext(PerunSessionImpl sess, User user, AttributeDefinition attr) Loads DNS-to-country translation map from attribute urn:perun:entityless:attribute-def:def:dnsStateMaping.modifyValue(PerunSession session, cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx ctx, UserExtSource ues, String value) Replaces DNS domain with country name, or null.resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) For a change in dnsStateMapping attribute, finds all affected users and generates audit message about changing this attribute for each of them.Methods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserVirtualAttributeCollectedFromUserExtSource
getAlsoExtLogin, getAttributeDefinition, getAttributeValue, getDestinationAttributeDisplayName, getDestinationAttributeName, getExtSourceFilter, getHandleIdentifiers, getSourceAttributeName, getValueFilter, isLastAccessValidMethods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserVirtualAttributesModuleAbstract
getStrongDependencies, removeAttributeValue, searchInAttributesValues, setAttributeValueMethods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserAttributesModuleAbstract
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, deletedEntityHook, fillAttribute, getAnonymizedValueMethods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleAbstract
getAuthorizedRoles, getDependenciesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleImplApi
getAuthorizedRoles, getDependenciesMethods inherited from interface cz.metacentrum.perun.core.implApi.modules.attributes.UserAttributesModuleImplApi
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, deletedEntityHook, fillAttribute, getAnonymizedValue
-
Constructor Details
-
urn_perun_user_attribute_def_virt_institutionsCountries
public urn_perun_user_attribute_def_virt_institutionsCountries()
-
-
Method Details
-
getDestinationAttributeDescription
- Overrides:
getDestinationAttributeDescriptionin classUserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>
-
getDestinationAttributeFriendlyName
Description copied from class:UserVirtualAttributeCollectedFromUserExtSourceSpecifies friendly (short) name of attribute from namespace urn:perun:user:attribute-def:virt where values will be stored- Specified by:
getDestinationAttributeFriendlyNamein classUserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>- Returns:
- short name of user attribute which is destination for collected values
-
getSourceAttributeFriendlyName
Description copied from class:UserVirtualAttributeCollectedFromUserExtSourceSpecifies friendly (short) name of attribute from namespace urn:perun:ues:attribute-def:def whose values are to be collected.- Specified by:
getSourceAttributeFriendlyNamein classUserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>- Returns:
- short name of userExtSource attribute which is source of values
-
initModifyValueContext
protected cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx initModifyValueContext(PerunSessionImpl sess, User user, AttributeDefinition attr) Loads DNS-to-country translation map from attribute urn:perun:entityless:attribute-def:def:dnsStateMaping. DNS domains are in keys, country names are in values of the attribute.- Overrides:
initModifyValueContextin classUserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>
-
modifyValue
public String modifyValue(PerunSession session, cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx ctx, UserExtSource ues, String value) Replaces DNS domain with country name, or null.- Overrides:
modifyValuein classUserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>- Parameters:
session- PerunSessionctx- context initialized in initModifyValueContext methodues- UserExtSourcevalue- of userExtSource attribute- Returns:
- modified value or null to skip the value
-
resolveVirtualAttributeValueChange
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException For a change in dnsStateMapping attribute, finds all affected users and generates audit message about changing this attribute for each of them.- Specified by:
resolveVirtualAttributeValueChangein interfaceAttributesModuleImplApi- Overrides:
resolveVirtualAttributeValueChangein classUserVirtualAttributeCollectedFromUserExtSource<cz.metacentrum.perun.core.impl.modules.attributes.DnsMapCtx>- Parameters:
sess-message-- Returns:
- list of additional messages for auditer to log it
- Throws:
WrongReferenceAttributeValueExceptionAttributeNotExistsExceptionWrongAttributeAssignmentException
-