Class UserVirtualAttributeCollectedFromUserExtSource<T extends UserVirtualAttributeCollectedFromUserExtSource.ModifyValueContext>
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<T>
- All Implemented Interfaces:
AttributesModuleImplApi
,UserAttributesModuleImplApi
,UserVirtualAttributesModuleImplApi
,VirtualAttributesModuleImplApi
- Direct Known Subclasses:
urn_perun_user_attribute_def_virt_additionalIdentifiers
,urn_perun_user_attribute_def_virt_alternativeLoginNames
,urn_perun_user_attribute_def_virt_eduPersonEntitlement
,urn_perun_user_attribute_def_virt_eduPersonORCID
,urn_perun_user_attribute_def_virt_eduPersonScopedAffiliations
,urn_perun_user_attribute_def_virt_eIDASPersonIdentifiers
,urn_perun_user_attribute_def_virt_epuids
,urn_perun_user_attribute_def_virt_europeanStudentIDs
,urn_perun_user_attribute_def_virt_forwardedVoPersonExternalAffiliation
,urn_perun_user_attribute_def_virt_institutionsCountries
,urn_perun_user_attribute_def_virt_loaFenix
,urn_perun_user_attribute_def_virt_mails_namespace_google
,urn_perun_user_attribute_def_virt_mails_namespace_microsoft
,urn_perun_user_attribute_def_virt_schacHomeOrganizations
,urn_perun_user_attribute_def_virt_schacPersonalUniqueCodes
,urn_perun_user_attribute_def_virt_userEligibilities
,urn_perun_user_attribute_def_virt_voPersonExternalAffiliation
public abstract class UserVirtualAttributeCollectedFromUserExtSource<T extends UserVirtualAttributeCollectedFromUserExtSource.ModifyValueContext>
extends UserVirtualAttributesModuleAbstract
Common ancestor class for user virtual attributes that just collect values from userExtSource attributes.
For a given user, collects string values of userExtSource attributes with friendly name specified by getSourceAttributeFriendlyName(), and splits them at character ';' which is used by mod_shib to join multiple values, and stores all values into virtual user attribute with friendly name specified by getDestinationAttributeFriendlyName().
- Author:
- Martin Kuba makub@ics.muni.cz
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Functional interface for controlling AuditEvents.static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Override this method to return true to also collect logins from the user ext sources.Return attributes definition which is represented by the modulegetAttributeValue
(PerunSessionImpl sess, User user, AttributeDefinition destinationAttributeDefinition) This method will return computed value.abstract String
Specifies friendly (short) name of attribute from namespace urn:perun:user:attribute-def:virt where values will be storedfinal String
Gets full URN of this virtual user attribute.protected Predicate
<UserExtSource> Override this method to filter the user ext sources (collect the value from the UES only if it passes the filter).abstract String
Specifies friendly (short) name of attribute from namespace urn:perun:ues:attribute-def:def whose values are to be collected.final String
Gets full URN of the UserExtSource attribute used for computing rhis attribute value.Override this method to filter the collected values.protected T
initModifyValueContext
(PerunSessionImpl sess, User user, AttributeDefinition destinationAttributeDefinition) protected boolean
Checks configuration properties idpLoginValidity if last access is not outdated.modifyValue
(PerunSession session, T ctx, UserExtSource ues, String value) Override this method if you need to modify the original values.resolveVirtualAttributeValueChange
(PerunSessionImpl perunSession, AuditEvent message) Gets message from auditer and resolves if it is needed to add another messages to DB about virtualAttribute changes.Methods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserVirtualAttributesModuleAbstract
getStrongDependencies, removeAttributeValue, searchInAttributesValues, setAttributeValue
Methods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserAttributesModuleAbstract
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttribute, getAnonymizedValue
Methods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleAbstract
getAuthorizedRoles, getDependencies
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleImplApi
getAuthorizedRoles, getDependencies
Methods inherited from interface cz.metacentrum.perun.core.implApi.modules.attributes.UserAttributesModuleImplApi
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttribute, getAnonymizedValue
-
Constructor Details
-
UserVirtualAttributeCollectedFromUserExtSource
public UserVirtualAttributeCollectedFromUserExtSource()
-
-
Method Details
-
getDestinationAttributeFriendlyName
Specifies friendly (short) name of attribute from namespace urn:perun:user:attribute-def:virt where values will be stored- Returns:
- short name of user attribute which is destination for collected values
-
getSourceAttributeFriendlyName
Specifies friendly (short) name of attribute from namespace urn:perun:ues:attribute-def:def whose values are to be collected.- Returns:
- short name of userExtSource attribute which is source of values
-
getAttributeDefinition
Description copied from interface:AttributesModuleImplApi
Return attributes definition which is represented by the module- Specified by:
getAttributeDefinition
in interfaceAttributesModuleImplApi
- Overrides:
getAttributeDefinition
in classAttributesModuleAbstract
- Returns:
- attribute definition
-
getAttributeValue
public Attribute getAttributeValue(PerunSessionImpl sess, User user, AttributeDefinition destinationAttributeDefinition) Description copied from interface:UserVirtualAttributesModuleImplApi
This method will return computed value.- Specified by:
getAttributeValue
in interfaceUserVirtualAttributesModuleImplApi
- Overrides:
getAttributeValue
in classUserVirtualAttributesModuleAbstract
- Parameters:
sess
- perun sessionuser
- user which is needed for computing the valuedestinationAttributeDefinition
- attribute to operate on- Returns:
-
getDestinationAttributeDescription
-
getDestinationAttributeDisplayName
-
getDestinationAttributeName
Gets full URN of this virtual user attribute.- Returns:
- full destination attribute URN
-
getHandleIdentifiers
public List<UserVirtualAttributeCollectedFromUserExtSource.AttributeHandleIdentifier> getHandleIdentifiers() -
getSourceAttributeName
Gets full URN of the UserExtSource attribute used for computing rhis attribute value.- Returns:
- full source attribute URN
-
getAlsoExtLogin
Override this method to return true to also collect logins from the user ext sources.- Returns:
- boolean value indicating whether to also collect logins
-
getValueFilter
Override this method to filter the collected values.- Returns:
- regex by which the collected values will be filtered.
-
getExtSourceFilter
Override this method to filter the user ext sources (collect the value from the UES only if it passes the filter).- Returns:
- UES predicate serving as a filter
-
initModifyValueContext
protected T initModifyValueContext(PerunSessionImpl sess, User user, AttributeDefinition destinationAttributeDefinition) -
isLastAccessValid
Checks configuration properties idpLoginValidity if last access is not outdated. Skips non-idp ext sources.- Parameters:
ues
- user extsource to be checked- Returns:
- true if ues is of type IdP and its last access is not outdated, false otherwise
-
modifyValue
Override this method if you need to modify the original values. The default implementation makes no modification. Return null if the value should be skipped.- 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 perunSession, AuditEvent message) throws WrongReferenceAttributeValueException, AttributeNotExistsException, WrongAttributeAssignmentException Description copied from interface:AttributesModuleImplApi
Gets message from auditer and resolves if it is needed to add another messages to DB about virtualAttribute changes.- Specified by:
resolveVirtualAttributeValueChange
in interfaceAttributesModuleImplApi
- Overrides:
resolveVirtualAttributeValueChange
in classUserVirtualAttributesModuleAbstract
- Parameters:
perunSession
-message
-- Returns:
- list of additional messages for auditer to log it
- Throws:
WrongReferenceAttributeValueException
AttributeNotExistsException
WrongAttributeAssignmentException
-