Class ExternalReferenceHandler
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
org.odpi.openmetadata.frameworks.openmetadata.handlers.ExternalReferenceHandler
ExternalReferenceHandler provides methods to define external references and their relationships.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
auditLog, classificationBuilder, elementBuilder, localServerName, localServiceName, metadataElementTypeName, openMetadataClient, propertyHelper, relationshipBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionExternalReferenceHandler
(String localServerName, AuditLog auditLog, String localServiceName, OpenMetadataClient openMetadataClient) Create a new handler. -
Method Summary
Modifier and TypeMethodDescriptioncreateExternalReference
(String userId, NewElementOptions newElementOptions, Map<String, ClassificationProperties> initialClassifications, ExternalReferenceProperties properties, RelationshipProperties parentRelationshipProperties) Create a new external reference.createExternalReferenceFromTemplate
(String userId, TemplateOptions templateOptions, String templateGUID, ElementProperties replacementProperties, Map<String, String> placeholderProperties, RelationshipProperties parentRelationshipProperties) Create a new metadata element to represent an external reference using an existing element as a template.void
deleteExternalReference
(String userId, String externalReferenceGUID, DeleteOptions deleteOptions) Delete an external reference.void
detachCitedDocumentReference
(String userId, String elementGUID, String externalReferenceGUID, DeleteOptions deleteOptions) Detach an element from its external document reference.void
detachExternalReference
(String userId, String elementGUID, String externalReferenceGUID, DeleteOptions deleteOptions) Detach an external reference from an element.void
detachMediaReference
(String userId, String elementGUID, String externalReferenceGUID, DeleteOptions deleteOptions) Detach an external media reference from an element.findExternalReferences
(String userId, String searchString, SearchOptions searchOptions) Retrieve the list of external references metadata elements that contain the search string and show which solution components (if any) are attached to it.getExternalReferenceByGUID
(String userId, String externalReferenceGUID, GetOptions getOptions) Return the properties of a specific external reference.getExternalReferencesByName
(String userId, String name, QueryOptions queryOptions) Returns the list of external references with a particular name.void
linkCitedDocumentReference
(String userId, String elementGUID, String externalReferenceGUID, MetadataSourceOptions metadataSourceOptions, CitedDocumentLinkProperties relationshipProperties) Attach an element to its external document reference.void
linkExternalReference
(String userId, String elementGUID, String externalReferenceGUID, MetadataSourceOptions metadataSourceOptions, ExternalReferenceLinkProperties relationshipProperties) Attach an external reference to an element.void
linkMediaReference
(String userId, String elementGUID, String externalReferenceGUID, MetadataSourceOptions metadataSourceOptions, MediaReferenceProperties relationshipProperties) Attach an external media reference to an element.void
updateExternalReference
(String userId, String externalReferenceGUID, UpdateOptions updateOptions, ExternalReferenceProperties properties) Update the properties of an external reference.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
addDefaultType, addDefaultType, addDefaultType, addGovernanceDefinitionFamily, addMermaidToRootElement, convertRootElement, convertRootElement, convertRootElements, convertSolutionComponent, convertSolutionPort, createElementFromTemplate, createNewElement, findRootElements, getElementHierarchies, getElementHierarchy, getElementRelatedElements, getFullParentContext, getInformationSupplyChainContext, getQueryOptions, getQueryOptions, getQueryOptions, getRelatedRootElements, getRootElementByGUID, getRootElementByUniqueName, getRootElementsByName, updateElement, updateElementStatus
-
Constructor Details
-
ExternalReferenceHandler
public ExternalReferenceHandler(String localServerName, AuditLog auditLog, String localServiceName, OpenMetadataClient openMetadataClient) Create a new handler.- Parameters:
localServerName
- name of this server (view server)auditLog
- logging destinationlocalServiceName
- local service nameopenMetadataClient
- access to open metadata
-
-
Method Details
-
createExternalReference
public String createExternalReference(String userId, NewElementOptions newElementOptions, Map<String, ClassificationProperties> initialClassifications, ExternalReferenceProperties properties, RelationshipProperties parentRelationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionCreate a new external reference.- Parameters:
userId
- userId of user making request.newElementOptions
- details of the element to createinitialClassifications
- map of classification names to classification properties to include in the entity creation requestproperties
- properties for the new element.parentRelationshipProperties
- properties to include in parent relationship- Returns:
- unique identifier of the newly created element
- Throws:
InvalidParameterException
- one of the parameters is invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
createExternalReferenceFromTemplate
public String createExternalReferenceFromTemplate(String userId, TemplateOptions templateOptions, String templateGUID, ElementProperties replacementProperties, Map<String, String> placeholderProperties, RelationshipProperties parentRelationshipProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionCreate a new metadata element to represent an external reference using an existing element as a template. The template defines additional classifications and relationships that should be added to the new external reference.- Parameters:
userId
- calling usertemplateOptions
- details of the element to createtemplateGUID
- the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema connection etc)replacementProperties
- properties of the new metadata element. These override the template valuesplaceholderProperties
- property name-to-property value map to replace any placeholder values in the template element - and their anchored elements, which are also copied as part of this operation.parentRelationshipProperties
- properties to include in parent relationship- 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)
-
updateExternalReference
public void updateExternalReference(String userId, String externalReferenceGUID, UpdateOptions updateOptions, ExternalReferenceProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update the properties of an external reference.- Parameters:
userId
- userId of user making request.externalReferenceGUID
- unique identifier of the external reference (returned from create)updateOptions
- provides a structure for the additional options when updating an element.properties
- properties for the element.- Throws:
InvalidParameterException
- one of the parameters is invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
linkExternalReference
public void linkExternalReference(String userId, String elementGUID, String externalReferenceGUID, MetadataSourceOptions metadataSourceOptions, ExternalReferenceLinkProperties relationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Attach an external reference to an element.- Parameters:
userId
- userId of user making requestelementGUID
- unique identifier of the elementexternalReferenceGUID
- unique identifier of the external referencemetadataSourceOptions
- options to control access to open metadatarelationshipProperties
- description of the relationship.- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
detachExternalReference
public void detachExternalReference(String userId, String elementGUID, String externalReferenceGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Detach an external reference from an element.- Parameters:
userId
- userId of user making request.elementGUID
- unique identifier of the first external referenceexternalReferenceGUID
- unique identifier of the second external referencedeleteOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
linkMediaReference
public void linkMediaReference(String userId, String elementGUID, String externalReferenceGUID, MetadataSourceOptions metadataSourceOptions, MediaReferenceProperties relationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Attach an external media reference to an element.- Parameters:
userId
- userId of user making requestelementGUID
- unique identifier of the first external referenceexternalReferenceGUID
- unique identifier of the second external referencemetadataSourceOptions
- options to control access to open metadatarelationshipProperties
- description of the relationship.- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
detachMediaReference
public void detachMediaReference(String userId, String elementGUID, String externalReferenceGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Detach an external media reference from an element.- Parameters:
userId
- userId of user making request.elementGUID
- unique identifier of the first external referenceexternalReferenceGUID
- unique identifier of the second external referencedeleteOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
linkCitedDocumentReference
public void linkCitedDocumentReference(String userId, String elementGUID, String externalReferenceGUID, MetadataSourceOptions metadataSourceOptions, CitedDocumentLinkProperties relationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Attach an element to its external document reference.- Parameters:
userId
- userId of user making requestelementGUID
- unique identifier of the element to connectexternalReferenceGUID
- unique identifier of the external referencemetadataSourceOptions
- options to control access to open metadatarelationshipProperties
- description of the relationship.- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
detachCitedDocumentReference
public void detachCitedDocumentReference(String userId, String elementGUID, String externalReferenceGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Detach an element from its external document reference.- Parameters:
userId
- userId of user making request.elementGUID
- unique identifier of the elementexternalReferenceGUID
- unique identifier of the external referencedeleteOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
deleteExternalReference
public void deleteExternalReference(String userId, String externalReferenceGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Delete an external reference.- Parameters:
userId
- userId of user making request.externalReferenceGUID
- unique identifier of the elementdeleteOptions
- options for a delete request- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getExternalReferencesByName
public List<OpenMetadataRootElement> getExternalReferencesByName(String userId, String name, QueryOptions queryOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns the list of external references with a particular name.- Parameters:
userId
- userId of user making requestname
- name of the element to return - match is full text match in qualifiedName or namequeryOptions
- multiple options to control the query- Returns:
- a list of elements
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getExternalReferenceByGUID
public OpenMetadataRootElement getExternalReferenceByGUID(String userId, String externalReferenceGUID, GetOptions getOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the properties of a specific external reference.- Parameters:
userId
- userId of user making requestexternalReferenceGUID
- unique identifier of the required elementgetOptions
- multiple options to control the query- Returns:
- retrieved properties
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
findExternalReferences
public List<OpenMetadataRootElement> findExternalReferences(String userId, String searchString, SearchOptions searchOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of external references metadata elements that contain the search string and show which solution components (if any) are attached to it. The returned external references include a list of the components that are associated with it.- Parameters:
userId
- calling usersearchString
- string to find in the propertiessearchOptions
- multiple options to control the query- 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)
-