Class ParentFolder
java.lang.Object
org.odpi.openmetadata.adapters.connectors.integration.basicfiles.ParentFolder
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 Summary
ConstructorsConstructorDescriptionParentFolder(String guid, String pathName, List<String> zones, boolean directParent) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String, ClassificationProperties> addZoneMembership(Map<String, ClassificationProperties> initialClassifications, List<String> zones) Add the ZoneMembership classification for a new element to its initial classifications.getGUID()Return the unique identifier of the folder element.getNewElementZones(ParentFolder parentFolder, List<String> fallbackZones) Return the governance zones to request for a new element.Return the canonical path name of the folder.getZoneNames(Object propertyValue) Turn the value of the fallbackZones configuration property into a list of zone names.getZones()Return the governance zones of the folder.getZones(OpenMetadataRootElement folder) Return the governance zones of a catalogued folder.booleanReturn whether the folder is the directory that holds the new element.
-
Constructor Details
-
ParentFolder
Constructor.- Parameters:
guid- unique identifier of the folder elementpathName- canonical path name of the folderzones- 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
Return the unique identifier of the folder element.- Returns:
- guid
-
getPathName
Return the canonical path name of the folder.- Returns:
- path name
-
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
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
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
-