Class MemberResourceVirtualAttributesModuleAbstract
java.lang.Object
cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.MemberResourceAttributesModuleAbstract
cz.metacentrum.perun.core.implApi.modules.attributes.MemberResourceVirtualAttributesModuleAbstract
- All Implemented Interfaces:
AttributesModuleImplApi,MemberResourceAttributesModuleImplApi,MemberResourceVirtualAttributesModuleImplApi,VirtualAttributesModuleImplApi
- Direct Known Subclasses:
urn_perun_member_resource_attribute_def_virt_bucketQuota,urn_perun_member_resource_attribute_def_virt_dataQuotas,urn_perun_member_resource_attribute_def_virt_fileQuotas,urn_perun_member_resource_attribute_def_virt_groupStatus,urn_perun_member_resource_attribute_def_virt_isBanned
public abstract class MemberResourceVirtualAttributesModuleAbstract
extends MemberResourceAttributesModuleAbstract
implements MemberResourceVirtualAttributesModuleImplApi
Abstract class for Resource Member 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 invalid input: '<'stavamichal@gmail.com>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAttributeValue(PerunSessionImpl perunSession, Member member, Resource resource, AttributeDefinition attribute) This method will return computed value.Get list of attributes which this attribute value is computed from.booleanremoveAttributeValue(PerunSessionImpl perunSession, Member member, Resource resource, 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.booleansetAttributeValue(PerunSessionImpl perunSession, Member member, Resource resource, Attribute attribute) Method sets attributes' values which are dependent on this virtual attribute.Methods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.MemberResourceAttributesModuleAbstract
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttributeMethods inherited from class cz.metacentrum.perun.core.implApi.modules.attributes.AttributesModuleAbstract
getAttributeDefinition, 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
getAttributeDefinition, getAuthorizedRoles, getDependenciesMethods inherited from interface cz.metacentrum.perun.core.implApi.modules.attributes.MemberResourceAttributesModuleImplApi
changedAttributeHook, checkAttributeSemantics, checkAttributeSyntax, fillAttribute
-
Constructor Details
-
MemberResourceVirtualAttributesModuleAbstract
public MemberResourceVirtualAttributesModuleAbstract()
-
-
Method Details
-
getAttributeValue
public Attribute getAttributeValue(PerunSessionImpl perunSession, Member member, Resource resource, AttributeDefinition attribute) Description copied from interface:MemberResourceVirtualAttributesModuleImplApiThis method will return computed value.- Specified by:
getAttributeValuein interfaceMemberResourceVirtualAttributesModuleImplApi- Parameters:
perunSession- perun sessionmember- member which is needed for computing the valueresource- resource which is needed for computing the valueattribute- attribute to operate on- Returns:
-
getStrongDependencies
Description copied from interface:VirtualAttributesModuleImplApiGet 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:
getStrongDependenciesin interfaceVirtualAttributesModuleImplApi- Returns:
- list of attributes this attribute strongly depends on
- See Also:
-
removeAttributeValue
public boolean removeAttributeValue(PerunSessionImpl perunSession, Member member, Resource resource, AttributeDefinition attribute) Description copied from interface:MemberResourceVirtualAttributesModuleImplApiCurrently do nothing.- Specified by:
removeAttributeValuein interfaceMemberResourceVirtualAttributesModuleImplApi- Parameters:
perunSession-member- member which is needed for computing the valueresource- resource which is needed for computing the valueattribute- attribute to operate on- Returns:
trueif attribute was changed (deleted) orfalseif attribute was not present in a first place
-
resolveVirtualAttributeValueChange
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl perunSession, AuditEvent message) throws AttributeNotExistsException, WrongAttributeAssignmentException Description copied from interface:AttributesModuleImplApiGets message from auditer and resolves if it is needed to add another messages to DB about virtualAttribute changes.- Specified by:
resolveVirtualAttributeValueChangein interfaceAttributesModuleImplApi- Overrides:
resolveVirtualAttributeValueChangein classAttributesModuleAbstract- Parameters:
perunSession-message-- Returns:
- list of additional messages for auditer to log it
- Throws:
AttributeNotExistsExceptionWrongAttributeAssignmentException
-
setAttributeValue
public boolean setAttributeValue(PerunSessionImpl perunSession, Member member, Resource resource, Attribute attribute) Description copied from interface:MemberResourceVirtualAttributesModuleImplApiMethod sets attributes' values which are dependent on this virtual attribute.- Specified by:
setAttributeValuein interfaceMemberResourceVirtualAttributesModuleImplApi- Parameters:
perunSession-member- member which is needed for computing the valueresource- resource which is needed for computing the valueattribute- attribute to operate on- Returns:
- true if attribute was really changed
-