Class UserVirtualAttributesModuleAbstract
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
- All Implemented Interfaces:
AttributesModuleImplApi
,UserAttributesModuleImplApi
,UserVirtualAttributesModuleImplApi
,VirtualAttributesModuleImplApi
- Direct Known Subclasses:
urn_perun_user_attribute_def_virt_anonymized
,urn_perun_user_attribute_def_virt_associatedUsersMails
,urn_perun_user_attribute_def_virt_earliestActiveLastAccess
,urn_perun_user_attribute_def_virt_eduPersonPrincipalNames
,urn_perun_user_attribute_def_virt_groupNames
,urn_perun_user_attribute_def_virt_kerberosLogins
,urn_perun_user_attribute_def_virt_loa
,urn_perun_user_attribute_def_virt_login_namespace_bbmri_persistent
,urn_perun_user_attribute_def_virt_login_namespace_bbmriid_persistent
,urn_perun_user_attribute_def_virt_login_namespace_eduteams_acc_persistent
,urn_perun_user_attribute_def_virt_login_namespace_eduteams_persistent
,urn_perun_user_attribute_def_virt_login_namespace_einfraid_persistent
,urn_perun_user_attribute_def_virt_login_namespace_elixir_persistent
,urn_perun_user_attribute_def_virt_login_namespace_envriid_persistent
,urn_perun_user_attribute_def_virt_login_namespace_eosc_beyond_persistent
,urn_perun_user_attribute_def_virt_login_namespace_eosc_federation_persistent
,urn_perun_user_attribute_def_virt_login_namespace_erasmus_persistent
,urn_perun_user_attribute_def_virt_login_namespace_erasmus_username
,urn_perun_user_attribute_def_virt_login_namespace_eurofusion_persistent
,urn_perun_user_attribute_def_virt_login_namespace_fenix_persistent
,urn_perun_user_attribute_def_virt_login_namespace_geant_persistent
,urn_perun_user_attribute_def_virt_login_namespace_lifescienceid_persistent
,urn_perun_user_attribute_def_virt_login_namespace_mu_persistent
,urn_perun_user_attribute_def_virt_login_namespace_myaccessid_persistent
,urn_perun_user_attribute_def_virt_login_namespace_researcher_access_persistent
,urn_perun_user_attribute_def_virt_login_namespace_surf_ram_persistent
,urn_perun_user_attribute_def_virt_login_namespace_umbrellaid_persistent
,urn_perun_user_attribute_def_virt_logins_namespace_google
,urn_perun_user_attribute_def_virt_mfaStatus
,urn_perun_user_attribute_def_virt_optional_login_namespace
,urn_perun_user_attribute_def_virt_preferredPhone
,urn_perun_user_attribute_def_virt_scopedLogin_namespace_mu
,urn_perun_user_attribute_def_virt_shibbolethExtSources
,urn_perun_user_attribute_def_virt_sponsoredMembershipInOrganizations
,urn_perun_user_attribute_def_virt_studentIdentifiers
,urn_perun_user_attribute_def_virt_tcsMails_mu
,urn_perun_user_attribute_def_virt_unscopedLogin_namespace
,urn_perun_user_attribute_def_virt_userCertDNs
,urn_perun_user_attribute_def_virt_userCertExpirations
,urn_perun_user_attribute_def_virt_userCertificatesLimited
,urn_perun_user_attribute_def_virt_userOrganizations
,urn_perun_user_attribute_def_virt_vomsDiracNickname
,UserVirtualAttributeCollectedFromUserExtSource
public abstract class UserVirtualAttributesModuleAbstract
extends UserAttributesModuleAbstract
implements UserVirtualAttributesModuleImplApi
Abstract class for User Virtual Attributes modules. Implements methods for modules to perform default function. In
the function that the method in the module does nothing, it is not necessary to implement it, simply extend this
abstract class.
- Author:
- Michal Stava <stavamichal@gmail.com>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAttributeValue
(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) This method will return computed value.Get list of attributes which this attribute value is computed from.void
removeAttributeValue
(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) Currently do nothing.resolveVirtualAttributeValueChange
(PerunSessionImpl perunSession, AuditEvent message) Gets message from auditer and resolves if it is needed to add another messages to DB about virtualAttribute changes.searchInAttributesValues
(PerunSessionImpl perunSession, String attribute) Method searches all users, who have attribute with the given value.boolean
setAttributeValue
(PerunSessionImpl perunSession, User user, Attribute attribute) Method sets attributes' values which are dependent on this virtual attribute.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
getAttributeDefinition, 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
getAttributeDefinition, getAuthorizedRoles, getDependencies
Methods inherited from interface cz.metacentrum.perun.core.implApi.modules.attributes.UserAttributesModuleImplApi
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttribute, getAnonymizedValue
-
Constructor Details
-
UserVirtualAttributesModuleAbstract
public UserVirtualAttributesModuleAbstract()
-
-
Method Details
-
getAttributeValue
public Attribute getAttributeValue(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) Description copied from interface:UserVirtualAttributesModuleImplApi
This method will return computed value.- Specified by:
getAttributeValue
in interfaceUserVirtualAttributesModuleImplApi
- Parameters:
perunSession
- perun sessionuser
- user which is needed for computing the valueattribute
- attribute to operate on- Returns:
-
getStrongDependencies
Description copied from interface:VirtualAttributesModuleImplApi
Get list of attributes which this attribute value is computed from. In other words attributes whose values change can also directly affect value of this attribute.An attribute should strongly depend on all attributes which values are used in method "getAttributeValue" defined in attribute module for virtual attributes.
- Specified by:
getStrongDependencies
in interfaceVirtualAttributesModuleImplApi
- Returns:
- list of attributes this attribute strongly depends on
- See Also:
-
removeAttributeValue
public void removeAttributeValue(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) Description copied from interface:UserVirtualAttributesModuleImplApi
Currently do nothing.- Specified by:
removeAttributeValue
in interfaceUserVirtualAttributesModuleImplApi
user
- user which is needed for computing the valueattribute
- attribute to operate on
-
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 classAttributesModuleAbstract
- Returns:
- list of additional messages for auditer to log it
- Throws:
WrongReferenceAttributeValueException
AttributeNotExistsException
WrongAttributeAssignmentException
-
searchInAttributesValues
Description copied from interface:UserVirtualAttributesModuleImplApi
Method searches all users, who have attribute with the given value. The rules of the match are dependent on the type of the attribute:String match in substring List match in one item Map match in key or value - Specified by:
searchInAttributesValues
in interfaceUserVirtualAttributesModuleImplApi
- Parameters:
perunSession
- perun sessionattribute
- attribute with value, which all returned users have to have- Returns:
- all users, who have attribute with given value
-
setAttributeValue
Description copied from interface:UserVirtualAttributesModuleImplApi
Method sets attributes' values which are dependent on this virtual attribute.- Specified by:
setAttributeValue
in interfaceUserVirtualAttributesModuleImplApi
user
- user which is needed for computing the valueattribute
- attribute to operate on- Returns:
- true if attribute was really changed
-