Class DataAssetExchangeService
java.lang.Object
org.odpi.openmetadata.integrationservices.catalog.connector.SchemaExchangeService
org.odpi.openmetadata.integrationservices.catalog.connector.DataAssetExchangeService
DataAssetExchangeService is the context for managing data assets and associated elements such as schemas.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearAssetRelationship
(String relationshipTypeName, String relationshipGUID, Date effectiveTime) Remove the relationship between two elements.void
clearDataAssetAsReferenceData
(String assetGUID, String assetExternalIdentifier, Date effectiveTime) Remove the reference data designation from the asset.createDataAsset
(boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, DataAssetProperties assetProperties) Create a new metadata element to represent the root of an asset.createDataAssetFromTemplate
(boolean assetManagerIsHome, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) Create a new metadata element to represent an asset using an existing metadata element as a template.findDataAssets
(String searchString, int startFrom, int pageSize, Date effectiveTime) Retrieve the list of asset metadata elements that contain the search string.getAssetRelationship
(String relationshipTypeName, String fromAssetGUID, String toAssetGUID, Date effectiveTime) Retrieve the relationship between two elements.getDataAssetByGUID
(String dataAssetGUID, Date effectiveTime) Retrieve the asset metadata element with the supplied unique identifier.getDataAssetsByName
(String name, int startFrom, int pageSize, Date effectiveTime) Retrieve the list of asset metadata elements with a matching qualified or display name.getDataAssetsForAssetManager
(int startFrom, int pageSize, Date effectiveTime) Retrieve the list of assets created on behalf of the named asset manager.getRelatedAssetsAtEnd1
(String relationshipTypeName, String toAssetGUID, int startingFrom, int pageSize, Date effectiveTime) Retrieve the relationships linked from a specific element at end 2 of the relationship.getRelatedAssetsAtEnd2
(String relationshipTypeName, String fromAssetGUID, int startingFrom, int pageSize, Date effectiveTime) Retrieve the requested relationships linked from a specific element at end 2.void
publishDataAsset
(String assetGUID, Date effectiveTime) Update the zones for the asset so that it becomes visible to consumers.void
removeDataAsset
(String assetGUID, String assetExternalIdentifier, Date effectiveTime) Remove the metadata element representing an asset.void
setDataAssetAsReferenceData
(String assetGUID, String assetExternalIdentifier, Date effectiveTime) Classify the asset to indicate that it can be used as reference data.setupRelatedDataAsset
(boolean assetManagerIsHome, String relationshipTypeName, String fromAssetGUID, String toAssetGUID, RelationshipProperties relationshipProperties, Date effectiveTime) Link two asset together.void
updateAssetRelationship
(String relationshipTypeName, String relationshipGUID, boolean isMergeUpdate, RelationshipProperties relationshipProperties, Date effectiveTime) Update relationship between two elements.void
updateDataAsset
(String assetGUID, String assetExternalIdentifier, boolean isMergeUpdate, DataAssetProperties assetProperties, Date effectiveTime) Update the metadata element representing an asset.void
withdrawDataAsset
(String assetGUID, Date effectiveTime) Update the zones for the asset so that it is no longer visible to consumers.Methods inherited from class org.odpi.openmetadata.integrationservices.catalog.connector.SchemaExchangeService
clearColumnAsPrimaryKey, clearForeignKeyRelationship, clearSchemaElementAsCalculatedValue, clearSchemaElementRelationship, clearSchemaTypeParent, createAnchoredSchemaType, createSchemaAttribute, createSchemaAttributeFromTemplate, createSchemaType, createSchemaTypeFromTemplate, findSchemaAttributes, findSchemaType, getNestedAttributes, getSchemaAttributeByGUID, getSchemaAttributesByName, getSchemaTypeByGUID, getSchemaTypeByName, getSchemaTypeForElement, getSchemaTypeParent, isForDuplicateProcessing, isForLineage, removeSchemaAttribute, removeSchemaType, setForDuplicateProcessing, setForLineage, setSchemaElementAsCalculatedValue, setupColumnAsPrimaryKey, setupForeignKeyRelationship, setupSchemaElementRelationship, setupSchemaTypeParent, updateForeignKeyRelationship, updateSchemaAttribute, updateSchemaType
-
Method Details
-
createDataAsset
public String createDataAsset(boolean assetManagerIsHome, ExternalIdentifierProperties externalIdentifierProperties, DataAssetProperties assetProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new metadata element to represent the root of an asset.- Parameters:
assetManagerIsHome
- ensure that only the asset manager can update this assetexternalIdentifierProperties
- optional properties used to define an external identifierassetProperties
- properties to store- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
createDataAssetFromTemplate
public String createDataAssetFromTemplate(boolean assetManagerIsHome, String templateGUID, ExternalIdentifierProperties externalIdentifierProperties, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new metadata element to represent an asset using an existing metadata element as a template. The template defines additional classifications and relationships that should be added to the new asset.- Parameters:
assetManagerIsHome
- ensure that only the asset manager can update this processtemplateGUID
- unique identifier of the metadata element to copyexternalIdentifierProperties
- optional properties used to define an external identifiertemplateProperties
- properties that override the template- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
updateDataAsset
public void updateDataAsset(String assetGUID, String assetExternalIdentifier, boolean isMergeUpdate, DataAssetProperties assetProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the metadata element representing an asset.- Parameters:
assetGUID
- unique identifier of the metadata element to updateassetExternalIdentifier
- unique identifier of the asset in the external asset managerisMergeUpdate
- should the new properties be merged with existing properties (true) or completely replace them (false)?assetProperties
- new properties for this elementeffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
publishDataAsset
public void publishDataAsset(String assetGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the zones for the asset so that it becomes visible to consumers. (The zones are set to the list of zones in the publishedZones option configured for each instance of the Asset Manager OMAS).- Parameters:
assetGUID
- unique identifier of the metadata element to publisheffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
withdrawDataAsset
public void withdrawDataAsset(String assetGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the zones for the asset so that it is no longer visible to consumers. (The zones are set to the list of zones in the defaultZones option configured for each instance of the Asset Manager OMAS. This is the setting when the database is first created).- Parameters:
assetGUID
- unique identifier of the metadata element to withdraweffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
removeDataAsset
public void removeDataAsset(String assetGUID, String assetExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the metadata element representing an asset. This will delete the asset and all anchored elements such as schema and comments.- Parameters:
assetGUID
- unique identifier of the metadata element to removeassetExternalIdentifier
- unique identifier of the asset in the external asset managereffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
setDataAssetAsReferenceData
public void setDataAssetAsReferenceData(String assetGUID, String assetExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Classify the asset to indicate that it can be used as reference data.- Parameters:
assetGUID
- unique identifier of the metadata element to updateassetExternalIdentifier
- unique identifier of the asset in the external asset managereffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
clearDataAssetAsReferenceData
public void clearDataAssetAsReferenceData(String assetGUID, String assetExternalIdentifier, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the reference data designation from the asset.- Parameters:
assetGUID
- unique identifier of the metadata element to updateassetExternalIdentifier
- unique identifier of the asset in the external asset managereffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
setupRelatedDataAsset
public String setupRelatedDataAsset(boolean assetManagerIsHome, String relationshipTypeName, String fromAssetGUID, String toAssetGUID, RelationshipProperties relationshipProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link two asset together. Use information from the relationship type definition to ensure the fromAssetGUID and toAssetGUID are the right way around.- Parameters:
assetManagerIsHome
- ensure that only the process manager can update this processrelationshipTypeName
- type name of relationship to createfromAssetGUID
- unique identifier of the asset at end 1 of the relationshiptoAssetGUID
- unique identifier of the asset at end 2 of the relationshiprelationshipProperties
- unique identifier for this relationshipeffectiveTime
- optional date for effective time of the query. Null means any effective time- Returns:
- unique identifier of the relationship
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getAssetRelationship
public RelationshipElement getAssetRelationship(String relationshipTypeName, String fromAssetGUID, String toAssetGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the relationship between two elements.- Parameters:
relationshipTypeName
- type name of relationship to createfromAssetGUID
- unique identifier of the asset at end 1 of the relationshiptoAssetGUID
- unique identifier of the asset at end 2 of the relationshipeffectiveTime
- optional date for effective time of the query. Null means any effective time- Returns:
- unique identifier and properties of the relationship
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
updateAssetRelationship
public void updateAssetRelationship(String relationshipTypeName, String relationshipGUID, boolean isMergeUpdate, RelationshipProperties relationshipProperties, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update relationship between two elements.- Parameters:
relationshipTypeName
- type name of relationship to updaterelationshipGUID
- unique identifier of the relationshiprelationshipProperties
- description and/or purpose of the relationshipisMergeUpdate
- should the new properties be merged with the existing properties, or replace them entirelyeffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
clearAssetRelationship
public void clearAssetRelationship(String relationshipTypeName, String relationshipGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the relationship between two elements.- Parameters:
relationshipTypeName
- type name of relationship to deleterelationshipGUID
- unique identifier of the relationshipeffectiveTime
- optional date for effective time of the query. Null means any effective time- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getRelatedAssetsAtEnd2
public List<RelationshipElement> getRelatedAssetsAtEnd2(String relationshipTypeName, String fromAssetGUID, int startingFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the requested relationships linked from a specific element at end 2.- Parameters:
relationshipTypeName
- type name of relationship to deletefromAssetGUID
- unique identifier of the asset at end 1 of the relationshipstartingFrom
- start position for resultspageSize
- maximum number of resultseffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- unique identifier and properties of the relationship
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getRelatedAssetsAtEnd1
public List<RelationshipElement> getRelatedAssetsAtEnd1(String relationshipTypeName, String toAssetGUID, int startingFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the relationships linked from a specific element at end 2 of the relationship.- Parameters:
relationshipTypeName
- type name of relationship to deletetoAssetGUID
- unique identifier of the asset at end 2 of the relationshipstartingFrom
- start position for resultspageSize
- maximum number of resultseffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- unique identifier and properties of the relationship
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
findDataAssets
public List<DataAssetElement> findDataAssets(String searchString, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of asset metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
searchString
- string to find in the propertiesstartFrom
- paging start pointpageSize
- maximum results that can be returnedeffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getDataAssetsByName
public List<DataAssetElement> getDataAssetsByName(String name, int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of asset metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Parameters:
name
- name to search forstartFrom
- paging start pointpageSize
- maximum results that can be returnedeffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getDataAssetsForAssetManager
public List<DataAssetElement> getDataAssetsForAssetManager(int startFrom, int pageSize, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of assets created on behalf of the named asset manager.- Parameters:
startFrom
- paging start pointpageSize
- maximum results that can be returnedeffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
getDataAssetByGUID
public DataAssetElement getDataAssetByGUID(String dataAssetGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the asset metadata element with the supplied unique identifier.- Parameters:
dataAssetGUID
- unique identifier of the requested metadata elementeffectiveTime
- the time that the retrieved elements must be effective for (null for any time, new Date() for now)- Returns:
- matching metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-