Class ERManagementDelegate

java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.ERManagementDelegate

public class ERManagementDelegate extends Object
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 Details

    • ERManagementDelegate

      public ERManagementDelegate()
  • Method Details

    • isFilterNonActiveDescendants

      public boolean isFilterNonActiveDescendants()
      Returns whether descendant Contexts with a non-ACTIVE effectiveState are additionally filtered out.
      Returns:
      true if non-ACTIVE descendants are filtered, false otherwise
    • setFilterNonActiveDescendants

      public void setFilterNonActiveDescendants(boolean filterNonActiveDescendants)
      Sets whether descendant Contexts with a non-ACTIVE effectiveState must additionally be filtered out. The PEP layer sets this to true for every non-administrative caller, regardless of contextVisibilityPolicy.
      Parameters:
      filterNonActiveDescendants - true to filter non-ACTIVE descendants
    • getContextVisibilityPolicy

      public ContextVisibilityPolicy getContextVisibilityPolicy()
      Returns the configured context visibility policy.
      Returns:
      the active ContextVisibilityPolicy
    • setContextVisibilityPolicy

      public void setContextVisibilityPolicy(ContextVisibilityPolicy contextVisibilityPolicy)
      Sets the context visibility policy.
      Parameters:
      contextVisibilityPolicy - the ContextVisibilityPolicy to apply
    • getCurrentContextPath

      public String getCurrentContextPath()
      Returns the configured current context path.
      Returns:
      the current context path string
    • setCurrentContextPath

      public void setCurrentContextPath(String currentContextPath)
      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-ACTIVE descendants if isFilterNonActiveDescendants() 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