Class OpenMetadataStore
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.OpenMetadataStore
OpenMetadataStore provides access to metadata elements stored in the metadata repositories. It is implemented by the
abstract class OpenMetadataClient and used by all the governance action services to retrieve metadata.
The concrete class for OpenMetadataClient is implemented by a metadata repository provider. In Egeria, this class is
implemented in the GAF Metadata Management Services.
-
Constructor Summary
ConstructorsConstructorDescriptionOpenMetadataStore
(OpenMetadataClient openMetadataClient, String userId) Construct the open metadata store wrapper around the open metadata client. -
Method Summary
Modifier and TypeMethodDescriptionfindMetadataElements
(String metadataElementTypeName, List<String> metadataElementSubtypeName, SearchProperties searchProperties, List<ElementStatus> limitResultsByStatus, SearchClassifications matchClassifications, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) Return a list of metadata elements that match the supplied criteria.findMetadataElementsWithString
(String searchString, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) Retrieve the metadata elements that contain the requested string.findRelationshipsBetweenMetadataElements
(String relationshipTypeName, SearchProperties searchProperties, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) Return a list of relationships that match the requested conditions.getMetadataElementByGUID
(String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) Retrieve the metadata element using its unique identifier.getMetadataElementByUniqueName
(String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) Retrieve the metadata element using its unique name (typically the qualified name).getMetadataElementGUIDByUniqueName
(String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).getRelatedMetadataElements
(String elementGUID, int startingAtEnd, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) Retrieve the metadata elements connected to the supplied element.
-
Constructor Details
-
OpenMetadataStore
Construct the open metadata store wrapper around the open metadata client.- Parameters:
openMetadataClient
- client to retrieve values from theuserId
- userId for the governance service
-
-
Method Details
-
getMetadataElementByGUID
public OpenMetadataElement getMetadataElementByGUID(String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the metadata element using its unique identifier.- Parameters:
elementGUID
- unique identifier for the metadata elementforLineage
- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved element is for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.- Returns:
- metadata element properties
- Throws:
InvalidParameterException
- the unique identifier is null or not known.UserNotAuthorizedException
- the governance action service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
getMetadataElementByUniqueName
public OpenMetadataElement getMetadataElementByUniqueName(String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the metadata element using its unique name (typically the qualified name).- Parameters:
uniqueName
- unique name for the metadata elementuniquePropertyName
- name of property name to test in the open metadata element - if null "qualifiedName" is usedforLineage
- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved element is for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.- Returns:
- metadata element properties or null if not found
- Throws:
InvalidParameterException
- the unique identifier is null.UserNotAuthorizedException
- the governance action service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
getMetadataElementGUIDByUniqueName
public String getMetadataElementGUIDByUniqueName(String uniqueName, String uniquePropertyName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the unique identifier of a metadata element using its unique name (typically the qualified name).- Parameters:
uniqueName
- unique name for the metadata elementuniquePropertyName
- name of property name to test in the open metadata element - if null "qualifiedName" is usedforLineage
- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved element is for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.- Returns:
- metadata element unique identifier (guid)
- Throws:
InvalidParameterException
- the unique identifier is null or not known.UserNotAuthorizedException
- the governance action service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
findMetadataElementsWithString
public List<OpenMetadataElement> findMetadataElementsWithString(String searchString, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the metadata elements that contain the requested string.- Parameters:
searchString
- name to retrieveforLineage
- the retrieved elements are for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved elements are for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.startFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of matching metadata elements (or null if no elements match the name)
- Throws:
InvalidParameterException
- the qualified name is nullUserNotAuthorizedException
- the governance action service is not able to access the elementPropertyServerException
- there is a problem accessing the metadata store
-
getRelatedMetadataElements
public List<RelatedMetadataElement> getRelatedMetadataElements(String elementGUID, int startingAtEnd, String relationshipTypeName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the metadata elements connected to the supplied element.- Parameters:
elementGUID
- unique identifier for the starting metadata elementstartingAtEnd
- indicates which end to retrieve from (0 is "either end"; 1 is end1; 2 is end 2)relationshipTypeName
- type name of relationships to follow (or null for all)forLineage
- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved elements are for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.startFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- list of related elements
- Throws:
InvalidParameterException
- the unique identifier is null or not known; the relationship type is invalidUserNotAuthorizedException
- the governance action service is not able to access the elementsPropertyServerException
- there is a problem accessing the metadata store
-
findMetadataElements
public List<OpenMetadataElement> findMetadataElements(String metadataElementTypeName, List<String> metadataElementSubtypeName, SearchProperties searchProperties, List<ElementStatus> limitResultsByStatus, SearchClassifications matchClassifications, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return a list of metadata elements that match the supplied criteria. The results can be returned over many pages.- Parameters:
metadataElementTypeName
- type of interest (null means any element type)metadataElementSubtypeName
- optional list of the subtypes of the metadataElementTypeName to include in the search results. Null means all subtypes.searchProperties
- Optional list of entity property conditions to match.limitResultsByStatus
- By default, entities in all statuses (other than DELETE) are returned. However, it is possible to specify a list of statuses (e.g. ACTIVE) to restrict the results to. Null means all status values.matchClassifications
- Optional list of classifications to match.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.forLineage
- the retrieved element is for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved element is for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return the element if it is effective at this time. Null means anytime. Use "new Date()" for now.startFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- a list of elements matching the supplied criteria; null means no matching elements in the metadata store.
- Throws:
InvalidParameterException
- one of the search parameters are is invalidUserNotAuthorizedException
- the governance action service is not able to access the elementsPropertyServerException
- there is a problem accessing the metadata store
-
findRelationshipsBetweenMetadataElements
public List<RelatedMetadataElements> findRelationshipsBetweenMetadataElements(String relationshipTypeName, SearchProperties searchProperties, String sequencingProperty, SequencingOrder sequencingOrder, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return a list of relationships that match the requested conditions. The results can be received as a series of pages.- Parameters:
relationshipTypeName
- relationship's type. Null means all types (but may be slow so not recommended).searchProperties
- Optional list of relationship property conditions to match.sequencingProperty
- String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).sequencingOrder
- Enum defining how the results should be ordered.forLineage
- the retrieved elements are for lineage processing so include archived elementsforDuplicateProcessing
- the retrieved element is for duplicate processing so do not combine results from known duplicates.effectiveTime
- only return an element if it is effective at this time. Null means anytime. Use "new Date()" for now.startFrom
- paging start pointpageSize
- maximum results that can be returned- Returns:
- a list of relationships. Null means no matching relationships.
- Throws:
InvalidParameterException
- one of the search parameters are is invalidUserNotAuthorizedException
- the governance action service is not able to access the elementsPropertyServerException
- there is a problem accessing the metadata store
-