Class UserFacilityVirtualAttributesModuleAbstract
java.lang.Object
cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.UserFacilityAttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.UserFacilityVirtualAttributesModuleAbstract
- All Implemented Interfaces:
AttributesModuleImplApi
,UserFacilityAttributesModuleImplApi
,UserFacilityVirtualAttributesModuleImplApi
,VirtualAttributesModuleImplApi
- Direct Known Subclasses:
urn_perun_user_facility_attribute_def_virt_blacklisted
,urn_perun_user_facility_attribute_def_virt_bucketQuota
,urn_perun_user_facility_attribute_def_virt_dataQuotas
,urn_perun_user_facility_attribute_def_virt_defaultUnixGID
,urn_perun_user_facility_attribute_def_virt_enabledO365MailForward
,urn_perun_user_facility_attribute_def_virt_fileQuotas
,urn_perun_user_facility_attribute_def_virt_groupStatus
,urn_perun_user_facility_attribute_def_virt_isBanned
,urn_perun_user_facility_attribute_def_virt_login
,urn_perun_user_facility_attribute_def_virt_preferredUnixGroupName
,urn_perun_user_facility_attribute_def_virt_shell
,urn_perun_user_facility_attribute_def_virt_UID
public abstract class UserFacilityVirtualAttributesModuleAbstract
extends UserFacilityAttributesModuleAbstract
implements UserFacilityVirtualAttributesModuleImplApi
Abstract class for Facility 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, Facility facility, AttributeDefinition attribute) This method will return computed value.Get list of attributes which this attribute value is computed from.boolean
removeAttributeValue
(PerunSessionImpl perunSession, User user, Facility facility, 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.boolean
setAttributeValue
(PerunSessionImpl perunSession, User user, Facility facility, Attribute attribute) Method sets attributes' values which are dependent on this virtual attribute.Methods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.UserFacilityAttributesModuleAbstract
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttribute
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.UserFacilityAttributesModuleImplApi
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttribute
-
Constructor Details
-
UserFacilityVirtualAttributesModuleAbstract
public UserFacilityVirtualAttributesModuleAbstract()
-
-
Method Details
-
getAttributeValue
public Attribute getAttributeValue(PerunSessionImpl perunSession, User user, Facility facility, AttributeDefinition attribute) Description copied from interface:UserFacilityVirtualAttributesModuleImplApi
This method will return computed value.- Specified by:
getAttributeValue
in interfaceUserFacilityVirtualAttributesModuleImplApi
- Parameters:
perunSession
- perun sessionuser
- user which is needed for computing the valuefacility
- facility 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 boolean removeAttributeValue(PerunSessionImpl perunSession, User user, Facility facility, AttributeDefinition attribute) Description copied from interface:UserFacilityVirtualAttributesModuleImplApi
Currently do nothing.- Specified by:
removeAttributeValue
in interfaceUserFacilityVirtualAttributesModuleImplApi
user
- user which is needed for computing the valuefacility
- facility which is needed for computing the valueattribute
- attribute to operate on- Returns:
true
if attribute was changed (deleted) orfalse
if attribute was not present in a first place
-
resolveVirtualAttributeValueChange
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) 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
-
setAttributeValue
public boolean setAttributeValue(PerunSessionImpl perunSession, User user, Facility facility, Attribute attribute) throws WrongReferenceAttributeValueException Description copied from interface:UserFacilityVirtualAttributesModuleImplApi
Method sets attributes' values which are dependent on this virtual attribute.- Specified by:
setAttributeValue
in interfaceUserFacilityVirtualAttributesModuleImplApi
user
- user which is needed for computing the valuefacility
- facility which is needed for computing the valueattribute
- attribute to operate on- Returns:
- true if attribute was really changed
- Throws:
WrongReferenceAttributeValueException
-