Class ExternalReferenceExchangeHandler
java.lang.Object
org.odpi.openmetadata.accessservices.assetmanager.handlers.ExternalReferenceExchangeHandler
ExternalReferenceExchangeHandler is the server side handler for managing externalReference content.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionExternalReferenceExchangeHandler
(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog) Construct the externalReference exchange handler with information needed to work with externalReference related objects for Asset Manager OMAS. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clearElementAsDataField
(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Remove the data field designation from the element.createExternalReference
(String userId, boolean assetManagerIsHome, MetadataCorrelationProperties correlationProperties, ExternalReferenceProperties externalReferenceProperties, String anchorGUID, String methodName) Create a new metadata element to represent the root of a externalReference.findExternalReferences
(String userId, String assetManagerGUID, String assetManagerName, String searchString, String searchStringParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of externalReference metadata elements that contain the search string.getExternalReferenceByGUID
(String userId, String assetManagerGUID, String assetManagerName, String guid, String guidParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the externalReference metadata element with the supplied unique identifier.getExternalReferences
(String userId, String assetManagerGUID, String assetManagerName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of externalReference metadata elements that contain the search string.getExternalReferencesById
(String userId, String assetManagerGUID, String assetManagerName, String referenceId, String referenceIdParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of externalReference metadata elements with a matching qualified or display referenceId.getExternalReferencesByName
(String userId, String assetManagerGUID, String assetManagerName, String name, String nameParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of externalReference metadata elements with a matching qualified or display name.getExternalReferencesByURL
(String userId, String assetManagerGUID, String assetManagerName, String url, String urlParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of externalReference metadata elements with a matching qualified or display url.getExternalReferencesForAssetManager
(String userId, String assetManagerGUID, String assetManagerName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of external references created by this caller.linkExternalReferenceToElement
(String userId, String assetManagerGUID, String assetManagerName, String attachedToGUID, String attachedToGUIDParameterName, String externalReferenceGUID, String externalReferenceGUIDParameterName, ExternalReferenceLinkProperties linkProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Link an external reference to an object.void
removeExternalReference
(String userId, MetadataCorrelationProperties correlationProperties, String externalReferenceGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Remove the metadata element representing a externalReference.retrieveAttachedExternalReferences
(String userId, String assetManagerGUID, String assetManagerName, String attachedToGUID, String attachedToGUIDParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Retrieve the list of external references attached to the supplied object.void
setElementAsDataField
(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, DataFieldValuesProperties properties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Classify the element to indicate that it describes a data field and supply properties that describe the characteristics of the data values found within.void
unlinkExternalReferenceFromElement
(String userId, String assetManagerGUID, String assetManagerName, String externalReferenceLinkGUID, String externalReferenceGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Remove the link between an external reference and an element.void
updateExternalReference
(String userId, MetadataCorrelationProperties correlationProperties, String externalReferenceGUID, boolean isMergeUpdate, ExternalReferenceProperties externalReferenceProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Update the metadata element representing an external reference.void
updateExternalReferenceToElementLink
(String userId, String assetManagerGUID, String assetManagerName, String externalReferenceLinkGUID, String externalReferenceGUIDParameterName, ExternalReferenceLinkProperties linkProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) Update the link between an external reference to an object.
-
Field Details
-
elementGUIDParameterName
- See Also:
-
-
Constructor Details
-
ExternalReferenceExchangeHandler
public ExternalReferenceExchangeHandler(String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog) Construct the externalReference exchange handler with information needed to work with externalReference related objects for Asset Manager OMAS.- Parameters:
serviceName
- name of this serviceserverName
- name of the local serverinvalidParameterHandler
- handler for managing parameter errorsrepositoryHandler
- manages calls to the repository servicesrepositoryHelper
- provides utilities for manipulating the repository services objectslocalServerUserId
- userId for this serversecurityVerifier
- open metadata security services verifiersupportedZones
- list of zones that the access service is allowed to serve instances from.defaultZones
- list of zones that the access service should set in all new instances.publishZones
- list of zones that the access service sets up in published instances.auditLog
- destination for audit log events.
-
-
Method Details
-
createExternalReference
public String createExternalReference(String userId, boolean assetManagerIsHome, MetadataCorrelationProperties correlationProperties, ExternalReferenceProperties externalReferenceProperties, String anchorGUID, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a new metadata element to represent the root of a externalReference. All categories and terms are linked to a single externalReference. They are owned by this externalReference and if the externalReference is deleted, any linked terms and categories are deleted as well.- Parameters:
userId
- calling userassetManagerIsHome
- ensure that only the asset manager can update this assetcorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataexternalReferenceProperties
- properties to storeanchorGUID
- optional element to link the external reference to that will act as an anchor - that is, this external reference will be deleted when the element is deleted (once the external reference is linked to the anchor).methodName
- calling method- 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, MetadataCorrelationProperties correlationProperties, String externalReferenceGUID, boolean isMergeUpdate, ExternalReferenceProperties externalReferenceProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the metadata element representing an external reference.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataexternalReferenceGUID
- unique identifier of the metadata element to updateisMergeUpdate
- are unspecified properties unchanged (true) or replaced with null?externalReferenceProperties
- new properties for this elementforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
removeExternalReference
public void removeExternalReference(String userId, MetadataCorrelationProperties correlationProperties, String externalReferenceGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the metadata element representing a externalReference. This will delete the externalReference and all categories and terms because the Anchors classifications are set up in these elements.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataexternalReferenceGUID
- unique identifier of the metadata element to removeforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
linkExternalReferenceToElement
public String linkExternalReferenceToElement(String userId, String assetManagerGUID, String assetManagerName, String attachedToGUID, String attachedToGUIDParameterName, String externalReferenceGUID, String externalReferenceGUIDParameterName, ExternalReferenceLinkProperties linkProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Link an external reference to an object.- Parameters:
userId
- the name of the calling user.assetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerattachedToGUID
- object linked to external referencesattachedToGUIDParameterName
- parameter nameexternalReferenceGUID
- unique identifier (guid) of the external reference detailsexternalReferenceGUIDParameterName
- parameter namelinkProperties
- description for the reference from the perspective of the object that the reference is being attached to.forLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- Returns:
- Unique identifier for new relationship
- Throws:
InvalidParameterException
- problem with the GUID or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
updateExternalReferenceToElementLink
public void updateExternalReferenceToElementLink(String userId, String assetManagerGUID, String assetManagerName, String externalReferenceLinkGUID, String externalReferenceGUIDParameterName, ExternalReferenceLinkProperties linkProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update the link between an external reference to an object.- Parameters:
userId
- the name of the calling user.assetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerexternalReferenceLinkGUID
- unique identifier (guid) of the external reference detailsexternalReferenceGUIDParameterName
- parameter namelinkProperties
- description for the reference from the perspective of the object that the reference is being attached toforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- Throws:
InvalidParameterException
- problem with the GUID or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
unlinkExternalReferenceFromElement
public void unlinkExternalReferenceFromElement(String userId, String assetManagerGUID, String assetManagerName, String externalReferenceLinkGUID, String externalReferenceGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Remove the link between an external reference and an element. If the element is its anchor, the external reference is removed.- Parameters:
userId
- the name of the calling user.assetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerexternalReferenceLinkGUID
- identifier of the external reference relationshipexternalReferenceGUIDParameterName
- parameter nameforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- Throws:
InvalidParameterException
- problem with the GUID or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getExternalReferences
public List<ExternalReferenceElement> getExternalReferences(String userId, String assetManagerGUID, String assetManagerName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of externalReference metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerstartFrom
- paging start pointpageSize
- maximum results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
findExternalReferences
public List<ExternalReferenceElement> findExternalReferences(String userId, String assetManagerGUID, String assetManagerName, String searchString, String searchStringParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of externalReference metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callersearchString
- string to find in the propertiessearchStringParameterName
- name of parameter for search stringstartFrom
- paging start pointpageSize
- maximum results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
getExternalReferencesByName
public List<ExternalReferenceElement> getExternalReferencesByName(String userId, String assetManagerGUID, String assetManagerName, String name, String nameParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of externalReference metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callername
- name to search fornameParameterName
- name of parameter supplying name valuestartFrom
- paging start pointpageSize
- maximum results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
getExternalReferencesById
public List<ExternalReferenceElement> getExternalReferencesById(String userId, String assetManagerGUID, String assetManagerName, String referenceId, String referenceIdParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of externalReference metadata elements with a matching qualified or display referenceId. There are no wildcards supported on this request.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique referenceId of software server capability representing the callerreferenceId
- referenceId to search forreferenceIdParameterName
- name of parameter supplying referenceId valuestartFrom
- paging start pointpageSize
- maximum results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
getExternalReferencesByURL
public List<ExternalReferenceElement> getExternalReferencesByURL(String userId, String assetManagerGUID, String assetManagerName, String url, String urlParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of externalReference metadata elements with a matching qualified or display url. There are no wildcards supported on this request.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique url of software server capability representing the callerurl
- url to search forurlParameterName
- name of parameter supplying url valuestartFrom
- paging start pointpageSize
- maximum results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
getExternalReferencesForAssetManager
public List<ExternalReferenceElement> getExternalReferencesForAssetManager(String userId, String assetManagerGUID, String assetManagerName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of external references created by this caller.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerstartFrom
- paging start pointpageSize
- maximum results that can be returnedforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
retrieveAttachedExternalReferences
public List<ExternalReferenceLinkElement> retrieveAttachedExternalReferences(String userId, String assetManagerGUID, String assetManagerName, String attachedToGUID, String attachedToGUIDParameterName, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve the list of external references attached to the supplied object.- Parameters:
userId
- the name of the calling user.assetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerattachedToGUID
- object linked to external referenceattachedToGUIDParameterName
- name of attachedToGUID parameterstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to returnforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- Returns:
- links to addition information.
- Throws:
InvalidParameterException
- guid invalid or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
getExternalReferenceByGUID
public ExternalReferenceElement getExternalReferenceByGUID(String userId, String assetManagerGUID, String assetManagerName, String guid, String guidParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the externalReference metadata element with the supplied unique identifier.- Parameters:
userId
- calling userassetManagerGUID
- unique identifier of software server capability representing the callerassetManagerName
- unique name of software server capability representing the callerguid
- unique identifier of the requested metadata elementguidParameterName
- name of parameter for guidforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- when should the elements be effected for - null is anytime; new Date() is nowmethodName
- calling method- 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)
-
setElementAsDataField
public void setElementAsDataField(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, DataFieldValuesProperties properties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Classify the element to indicate that it describes a data field and supply properties that describe the characteristics of the data values found within.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataelementGUID
- unique identifier of the metadata element to updateproperties
- characterizations of the data values stored in the data fieldforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- calling method- 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)
-
clearElementAsDataField
public void clearElementAsDataField(String userId, MetadataCorrelationProperties correlationProperties, String elementGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the data field designation from the element.- Parameters:
userId
- calling usercorrelationProperties
- properties to help with the mapping of the elements in the external asset manager and open metadataelementGUID
- unique identifier of the metadata element to updateforLineage
- return elements marked with the Memento classification?forDuplicateProcessing
- do not merge elements marked as duplicates?effectiveTime
- optional date for effective time of the query. Null means any effective timemethodName
- calling method- 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)
-