java.lang.Object
org.odpi.openmetadata.integrationservices.catalog.connector.SchemaExchangeService
Direct Known Subclasses:
DataAssetExchangeService, LineageExchangeService

public class SchemaExchangeService extends Object
LineageExchangeService is the context for managing process definitions and lineage linkage.
  • Method Details

    • isForLineage

      public boolean isForLineage()
      Return whether retrieval requests from this service are to include elements with the Memento classification attached or not.
      Returns:
      boolean flag
    • setForLineage

      public void setForLineage(boolean forLineage)
      Set up whether retrieval requests from this service are to include elements with the Memento classification attached or not.
      Parameters:
      forLineage - boolean flag
    • isForDuplicateProcessing

      public boolean isForDuplicateProcessing()
      Return whether retrieval requests from this service are to avoid merging duplicates or not.
      Returns:
      boolean flag
    • setForDuplicateProcessing

      public void setForDuplicateProcessing(boolean forDuplicateProcessing)
      Set up whether retrieval requests from this service are to avoid merging duplicates or not.
      Parameters:
      forDuplicateProcessing - boolean flag
    • createSchemaType

      public String createSchemaType(boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, SchemaTypeProperties schemaTypeProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new metadata element to represent a schema type.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this schema element
      externalIdentifierProperties - optional properties used to define an external identifier
      schemaTypeProperties - properties about the schema type to store
      Returns:
      unique identifier of the new schema type
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • createAnchoredSchemaType

      public String createAnchoredSchemaType(boolean assetManagerIsHome, String anchorGUID, ExternalIdentifierProperties externalIdentifierProperties, SchemaTypeProperties schemaTypeProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new metadata element to represent a schema type.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this schema element
      anchorGUID - unique identifier of the intended anchor of the schema type
      externalIdentifierProperties - optional properties used to define an external identifier
      schemaTypeProperties - properties about the schema type to store
      Returns:
      unique identifier of the new schema type
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • createSchemaTypeFromTemplate

      public String createSchemaTypeFromTemplate(boolean assetManagerIsHome, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new metadata element to represent a schema type using an existing metadata element as a template.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this schema element
      templateGUID - unique identifier of the metadata element to copy
      externalIdentifierProperties - optional properties used to define an external identifier
      templateProperties - properties that override the template
      Returns:
      unique identifier of the new schema type
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • updateSchemaType

      public void updateSchemaType(String schemaTypeGUID, String schemaTypeExternalIdentifier, boolean isMergeUpdate, SchemaTypeProperties schemaTypeProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Update the metadata element representing a schema type.
      Parameters:
      schemaTypeGUID - unique identifier of the metadata element to update
      schemaTypeExternalIdentifier - unique identifier of the schema type in the external asset manager
      isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
      schemaTypeProperties - new properties for the metadata element
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • setupSchemaTypeParent

      public void setupSchemaTypeParent(boolean assetManagerIsHome, String schemaTypeGUID, String parentElementGUID, String parentElementTypeName, RelationshipProperties properties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Connect a schema type to a data asset, process or port.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this relationship
      schemaTypeGUID - unique identifier of the schema type to connect
      parentElementGUID - unique identifier of the open metadata element that this schema type is to be connected to
      parentElementTypeName - unique type name of the open metadata element that this schema type is to be connected to
      properties - properties for the relationship
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • clearSchemaTypeParent

      public void clearSchemaTypeParent(String schemaTypeGUID, String parentElementGUID, String parentElementTypeName, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the relationship between a schema type and its parent data asset, process or port.
      Parameters:
      schemaTypeGUID - unique identifier of the schema type to connect
      parentElementGUID - unique identifier of the open metadata element that this schema type is to be connected to
      parentElementTypeName - unique type name of the open metadata element that this schema type is to be connected to
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • setupSchemaElementRelationship

      public void setupSchemaElementRelationship(boolean assetManagerIsHome, String endOneGUID, String endTwoGUID, String relationshipName, Date effectiveTime, RelationshipProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a relationship between two schema elements. The name of the desired relationship, and any properties (including effectivity dates) are passed on the API.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this relationship
      endOneGUID - unique identifier of the schema element at end one of the relationship
      endTwoGUID - unique identifier of the schema element at end two of the relationship
      relationshipName - name of the relationship to delete
      effectiveTime - optional date for effective time of the query. Null means any effective time
      properties - relationship properties
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • clearSchemaElementRelationship

      public void clearSchemaElementRelationship(String endOneGUID, String endTwoGUID, String relationshipName, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove a relationship between two schema elements. The name of the desired relationship is passed on the API.
      Parameters:
      endOneGUID - unique identifier of the schema element at end one of the relationship
      endTwoGUID - unique identifier of the schema element at end two of the relationship
      relationshipName - name of the relationship to delete
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • removeSchemaType

      public void removeSchemaType(String schemaTypeGUID, String schemaTypeExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the metadata element representing a schema type.
      Parameters:
      schemaTypeGUID - unique identifier of the metadata element to remove
      schemaTypeExternalIdentifier - unique identifier of the schema type in the external asset manager
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • findSchemaType

      public List<SchemaTypeElement> findSchemaType(String searchString, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of schema type metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      searchString - string to find in the properties
      startFrom - paging start point
      pageSize - maximum results that can be returned
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      list of matching metadata elements
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getSchemaTypeForElement

      public SchemaTypeElement getSchemaTypeForElement(String parentElementGUID, String parentElementTypeName, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Return the schema type associated with a specific open metadata element (data asset, process or port).
      Parameters:
      parentElementGUID - unique identifier of the open metadata element that this schema type is to be connected to
      parentElementTypeName - unique type name of the open metadata element that this schema type is to be connected to
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      metadata element describing the schema type associated with the requested parent element
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getSchemaTypeByName

      public List<SchemaTypeElement> getSchemaTypeByName(String name, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of schema type metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
      Parameters:
      name - name to search for
      startFrom - paging start point
      pageSize - maximum results that can be returned
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      list of matching metadata elements
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getSchemaTypeByGUID

      public SchemaTypeElement getSchemaTypeByGUID(String schemaTypeGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the schema type metadata element with the supplied unique identifier.
      Parameters:
      schemaTypeGUID - unique identifier of the requested metadata element
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      requested metadata element
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getSchemaTypeParent

      public ElementHeader getSchemaTypeParent(String schemaTypeGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the header of the metadata element connected to a schema type.
      Parameters:
      schemaTypeGUID - unique identifier of the requested metadata element
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      header for parent element (data asset, process, port)
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • createSchemaAttribute

      public String createSchemaAttribute(boolean assetManagerIsHome, String schemaElementGUID, ExternalIdentifierProperties externalIdentifierProperties, SchemaAttributeProperties schemaAttributeProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new metadata element to represent a schema attribute.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this schema attribute
      schemaElementGUID - unique identifier of the schemaType or Schema Attribute where the schema attribute is connected to
      externalIdentifierProperties - optional properties used to define an external identifier
      schemaAttributeProperties - properties for the schema attribute
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      unique identifier of the new metadata element for the schema attribute
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • createSchemaAttributeFromTemplate

      public String createSchemaAttributeFromTemplate(boolean assetManagerIsHome, String schemaElementGUID, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new metadata element to represent a schema attribute using an existing metadata element as a template.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this schema element
      schemaElementGUID - unique identifier of the schemaType or Schema Attribute where the schema attribute is connected to
      templateGUID - unique identifier of the metadata element to copy
      externalIdentifierProperties - optional properties used to define an external identifier
      templateProperties - properties that override the template
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      unique identifier of the new metadata element for the schema attribute
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • updateSchemaAttribute

      public void updateSchemaAttribute(String schemaAttributeGUID, String schemaAttributeExternalIdentifier, boolean isMergeUpdate, SchemaAttributeProperties schemaAttributeProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Update the properties of the metadata element representing a schema attribute.
      Parameters:
      schemaAttributeGUID - unique identifier of the schema attribute to update
      schemaAttributeExternalIdentifier - unique identifier of the schema attribute in the external asset manager
      isMergeUpdate - should the new properties be merged with existing properties (true) or completely replace them (false)?
      schemaAttributeProperties - new properties for the schema attribute
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • setSchemaElementAsCalculatedValue

      public void setSchemaElementAsCalculatedValue(boolean assetManagerIsHome, String schemaElementGUID, String schemaElementExternalIdentifier, String formula, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Classify the schema type (or attribute if type is embedded) to indicate that it is a calculated value.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this schema attribute
      schemaElementGUID - unique identifier of the metadata element to update
      schemaElementExternalIdentifier - unique identifier of the schema element in the external asset manager
      formula - description of how the value is calculated
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • clearSchemaElementAsCalculatedValue

      public void clearSchemaElementAsCalculatedValue(String schemaElementGUID, String schemaElementExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the calculated value designation from the schema element.
      Parameters:
      schemaElementGUID - unique identifier of the metadata element to update
      schemaElementExternalIdentifier - unique identifier of the schema element in the external asset manager
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • setupColumnAsPrimaryKey

      public void setupColumnAsPrimaryKey(boolean assetManagerIsHome, String schemaAttributeGUID, String schemaAttributeExternalIdentifier, String primaryKeyName, KeyPattern primaryKeyPattern, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Classify the column schema attribute to indicate that it describes a primary key.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this classification
      schemaAttributeGUID - unique identifier of the metadata element to update
      schemaAttributeExternalIdentifier - unique identifier of the schema attribute in the external asset manager
      primaryKeyName - name of the primary key (if different from the column name)
      primaryKeyPattern - key pattern used to maintain the primary key
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • clearColumnAsPrimaryKey

      public void clearColumnAsPrimaryKey(String schemaAttributeGUID, String schemaAttributeExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the primary key designation from the schema attribute.
      Parameters:
      schemaAttributeGUID - unique identifier of the metadata element to update
      schemaAttributeExternalIdentifier - unique identifier of the schema attribute in the external asset manager
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • setupForeignKeyRelationship

      public void setupForeignKeyRelationship(boolean assetManagerIsHome, String primaryKeyGUID, String foreignKeyGUID, ForeignKeyProperties foreignKeyProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Link two schema attributes together to show a foreign key relationship.
      Parameters:
      assetManagerIsHome - ensure that only the asset manager can update this relationship
      primaryKeyGUID - unique identifier of the derived schema element
      foreignKeyGUID - unique identifier of the query target schema element
      foreignKeyProperties - properties for the foreign key relationship
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • updateForeignKeyRelationship

      public void updateForeignKeyRelationship(String primaryKeyGUID, String foreignKeyGUID, ForeignKeyProperties foreignKeyProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Update the relationship properties for the query target.
      Parameters:
      primaryKeyGUID - unique identifier of the derived schema element
      foreignKeyGUID - unique identifier of the query target schema element
      foreignKeyProperties - properties for the foreign key relationship
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • clearForeignKeyRelationship

      public void clearForeignKeyRelationship(String primaryKeyGUID, String foreignKeyGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the foreign key relationship between two schema elements.
      Parameters:
      primaryKeyGUID - unique identifier of the derived schema element
      foreignKeyGUID - unique identifier of the query target schema element
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • removeSchemaAttribute

      public void removeSchemaAttribute(String schemaAttributeGUID, String schemaAttributeExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the metadata element representing a schema attribute.
      Parameters:
      schemaAttributeGUID - unique identifier of the metadata element to remove
      schemaAttributeExternalIdentifier - unique identifier of the schema attribute in the external asset manager
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • findSchemaAttributes

      public List<SchemaAttributeElement> findSchemaAttributes(String searchString, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of schema attribute metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      searchString - string to find in the properties
      startFrom - paging start point
      pageSize - maximum results that can be returned
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      list of matching metadata elements
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getNestedAttributes

      public List<SchemaAttributeElement> getNestedAttributes(String parentSchemaElementGUID, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of schema attributes associated with a schema element.
      Parameters:
      parentSchemaElementGUID - unique identifier of the schemaType of interest
      startFrom - paging start point
      pageSize - maximum results that can be returned
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      list of associated metadata elements
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getSchemaAttributesByName

      public List<SchemaAttributeElement> getSchemaAttributesByName(String name, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the list of schema attribute metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
      Parameters:
      name - name to search for
      startFrom - paging start point
      pageSize - maximum results that can be returned
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      list of matching metadata elements
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)
    • getSchemaAttributeByGUID

      public SchemaAttributeElement getSchemaAttributeByGUID(String schemaAttributeGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Retrieve the schema attribute metadata element with the supplied unique identifier.
      Parameters:
      schemaAttributeGUID - unique identifier of the requested metadata element
      effectiveTime - optional date for effective time of the query. Null means any effective time
      Returns:
      matching metadata element
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user is not authorized to issue this request
      PropertyServerException - there is a problem reported in the open metadata server(s)