Class ERManagementDelegate
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.ERManagementDelegate
Delegate class used via composition by EntityManagement and RelationManagement
to manage context visibility and filtering logic without polluting ElementManagement.
- Author:
- Luca Frosini (ISTI - CNR)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfilterContexts(Set<String> contexts) Filters the contexts based on the active visibility policy and current context path, then additionally drops non-ACTIVEdescendants ifisFilterNonActiveDescendants()is set.Returns the configured context visibility policy.Returns the configured current context path.booleanReturns whether descendant Contexts with a non-ACTIVEeffectiveStateare additionally filtered out.voidsetContextVisibilityPolicy(ContextVisibilityPolicy contextVisibilityPolicy) Sets the context visibility policy.voidsetCurrentContextPath(String currentContextPath) Sets the current context path.voidsetFilterNonActiveDescendants(boolean filterNonActiveDescendants) Sets whether descendant Contexts with a non-ACTIVEeffectiveStatemust additionally be filtered out.
-
Constructor Details
-
ERManagementDelegate
public ERManagementDelegate()
-
-
Method Details
-
isFilterNonActiveDescendants
public boolean isFilterNonActiveDescendants()Returns whether descendant Contexts with a non-ACTIVEeffectiveStateare additionally filtered out.- Returns:
trueif non-ACTIVEdescendants are filtered,falseotherwise
-
setFilterNonActiveDescendants
public void setFilterNonActiveDescendants(boolean filterNonActiveDescendants) Sets whether descendant Contexts with a non-ACTIVEeffectiveStatemust additionally be filtered out. The PEP layer sets this totruefor every non-administrative caller, regardless ofcontextVisibilityPolicy.- Parameters:
filterNonActiveDescendants-trueto filter non-ACTIVEdescendants
-
getContextVisibilityPolicy
Returns the configured context visibility policy.- Returns:
- the active ContextVisibilityPolicy
-
setContextVisibilityPolicy
Sets the context visibility policy.- Parameters:
contextVisibilityPolicy- the ContextVisibilityPolicy to apply
-
getCurrentContextPath
Returns the configured current context path.- Returns:
- the current context path string
-
setCurrentContextPath
Sets the current context path.- Parameters:
currentContextPath- the current context path to apply
-
filterContexts
public Set<String> filterContexts(Set<String> contexts) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Filters the contexts based on the active visibility policy and current context path, then additionally drops non-ACTIVEdescendants ifisFilterNonActiveDescendants()is set. The two filters are independent - see that flag's Javadoc for why they cannot share a single bypass condition.- Parameters:
contexts- the raw set of contexts to filter- Returns:
- the filtered set of contexts
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the lookup fails
-