java.lang.Object
org.odpi.openmetadata.adapters.connectors.integration.basicfiles.ParentFolder

public class ParentFolder extends Object
ParentFolder describes the nearest catalogued folder above a file (or directory) that is about to be catalogued. The new element takes its governance zones from this folder, so that a file that appears in a restricted directory is restricted from the moment it is catalogued.
  • Constructor Details

    • ParentFolder

      public ParentFolder(String guid, String pathName, List<String> zones, boolean directParent)
      Constructor.
      Parameters:
      guid - unique identifier of the folder element
      pathName - canonical path name of the folder
      zones - governance zones of the folder (null or empty if it has none)
      directParent - is this folder the directory that holds the new element (true), or one further up (false)?
  • Method Details

    • getGUID

      public String getGUID()
      Return the unique identifier of the folder element.
      Returns:
      guid
    • getPathName

      public String getPathName()
      Return the canonical path name of the folder.
      Returns:
      path name
    • getZones

      public List<String> getZones()
      Return the governance zones of the folder.
      Returns:
      list of zone names; null or empty if the folder has no zones
    • isDirectParent

      public boolean isDirectParent()
      Return whether the folder is the directory that holds the new element. Only a direct parent is linked to the new element.
      Returns:
      boolean
    • getZones

      public static List<String> getZones(OpenMetadataRootElement folder)
      Return the governance zones of a catalogued folder.
      Parameters:
      folder - element retrieved from the open metadata repositories
      Returns:
      list of zone names, or null if the folder has none
    • getNewElementZones

      public static List<String> getNewElementZones(ParentFolder parentFolder, List<String> fallbackZones)
      Return the governance zones to request for a new element. The zones of the parent folder are used exactly as they are. The connector's fallback zones are used only when there is no catalogued parent folder, or it has no zones.
      Parameters:
      parentFolder - nearest catalogued folder above the new element (may be null)
      fallbackZones - the connector's fallback zones (may be null)
      Returns:
      list of zone names, or null if no zones are to be requested
    • getZoneNames

      public static List<String> getZoneNames(Object propertyValue)
      Turn the value of the fallbackZones configuration property into a list of zone names. The value may be a list, or a string of comma-separated names.
      Parameters:
      propertyValue - value from the configuration properties (may be null)
      Returns:
      list of zone names, or null if there are none
    • addZoneMembership

      public static Map<String,ClassificationProperties> addZoneMembership(Map<String,ClassificationProperties> initialClassifications, List<String> zones)
      Add the ZoneMembership classification for a new element to its initial classifications.
      Parameters:
      initialClassifications - classifications already set up for the new element (may be null)
      zones - zones for the new element (may be null)
      Returns:
      the initial classifications, which are null if there are none