Class ExternalReferenceExchangeService
- java.lang.Object
-
- org.odpi.openmetadata.integrationservices.catalog.connector.ExternalReferenceExchangeService
-
public class ExternalReferenceExchangeService extends Object
DataAssetExchangeService is the context for managing data assets and associated elements such as schemas.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateExternalReference(String referenceExternalIdentifier, String referenceExternalIdentifierName, String referenceExternalIdentifierUsage, KeyPattern referenceExternalIdentifierKeyPattern, Map<String,String> mappingProperties, String anchorGUID, ExternalReferenceProperties properties)Create a definition of a external reference.voiddeleteExternalReference(String externalReferenceGUID, String referenceExternalIdentifier)Remove the definition of a external reference.List<ExternalReferenceElement>findExternalReferences(String searchString, Date effectiveTime, int startFrom, int pageSize)Find the external references that contain the search string - which may contain wildcards.ExternalReferenceElementgetExternalReferenceByGUID(Date effectiveTime, String externalReferenceGUID)Return information about a specific external reference.List<ExternalReferenceElement>getExternalReferences(Date effectiveTime, int startFrom, int pageSize)Retrieve the list of external references sorted in open metadata.List<ExternalReferenceElement>getExternalReferencesById(String resourceId, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of external references for this resourceId.List<ExternalReferenceElement>getExternalReferencesByName(String name, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of external references for this name.List<ExternalReferenceElement>getExternalReferencesByURL(String url, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of external references for this URL.List<ExternalReferenceElement>getExternalReferencesForAssetManager(Date effectiveTime, int startFrom, int pageSize)Retrieve the list of external reference created on behalf of the named asset manager.StringlinkExternalReferenceToElement(String attachedToGUID, String externalReferenceGUID, ExternalReferenceLinkProperties linkProperties)Link an external reference to an object.List<ExternalReferenceLinkElement>retrieveAttachedExternalReferences(String attachedToGUID, Date effectiveTime, int startFrom, int pageSize)Retrieve the list of external references attached to the supplied object.voidsetAssetManagerIsHome(boolean assetManagerIsHome)Set up the flag that controls the ownership of metadata created for this asset manager.voidunlinkExternalReferenceFromElement(String externalReferenceLinkGUID)Remove the link between a external reference and an element.voidupdateExternalReference(String externalReferenceGUID, String referenceExternalIdentifier, boolean isMergeUpdate, ExternalReferenceProperties properties)Update the definition of a external reference.voidupdateExternalReferenceToElementLink(String externalReferenceLinkGUID, ExternalReferenceLinkProperties linkProperties)Update the link between an external reference to an object.
-
-
-
Method Detail
-
setAssetManagerIsHome
public void setAssetManagerIsHome(boolean assetManagerIsHome)
Set up the flag that controls the ownership of metadata created for this asset manager. Default is true.- Parameters:
assetManagerIsHome- should the metadata be marked as owned by the infrastructure manager so others can not update?
-
createExternalReference
public String createExternalReference(String referenceExternalIdentifier, String referenceExternalIdentifierName, String referenceExternalIdentifierUsage, KeyPattern referenceExternalIdentifierKeyPattern, Map<String,String> mappingProperties, String anchorGUID, ExternalReferenceProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a definition of a external reference.- Parameters:
referenceExternalIdentifier- unique identifier of the external reference in the external asset managerreferenceExternalIdentifierName- name of property for the external identifier in the external asset managerreferenceExternalIdentifierUsage- optional usage description for the external identifier when calling the external asset managerreferenceExternalIdentifierKeyPattern- pattern for the external identifier within the external asset manager (default is LOCAL_KEY)mappingProperties- additional properties to help with the mapping of the elements in the external asset manager and open metadataanchorGUID- 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).properties- properties for a external reference- Returns:
- unique identifier of the external reference
- Throws:
InvalidParameterException- qualifiedName or userId is null; qualifiedName is not uniquePropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
updateExternalReference
public void updateExternalReference(String externalReferenceGUID, String referenceExternalIdentifier, boolean isMergeUpdate, ExternalReferenceProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the definition of a external reference.- Parameters:
externalReferenceGUID- unique identifier of external referencereferenceExternalIdentifier- unique identifier of the external reference in the external asset managerisMergeUpdate- are unspecified properties unchanged (true) or replaced with null?properties- properties to change- Throws:
InvalidParameterException- guid, qualifiedName or userId is null; qualifiedName is not unique; guid is not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
deleteExternalReference
public void deleteExternalReference(String externalReferenceGUID, String referenceExternalIdentifier) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the definition of a external reference.- Parameters:
externalReferenceGUID- unique identifier of external referencereferenceExternalIdentifier- unique identifier of the external reference in the external asset manager- Throws:
InvalidParameterException- guid or userId is null; guid is not knownPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
linkExternalReferenceToElement
public String linkExternalReferenceToElement(String attachedToGUID, String externalReferenceGUID, ExternalReferenceLinkProperties linkProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Link an external reference to an object.- Parameters:
attachedToGUID- object linked to external references.linkProperties- description for the reference from the perspective of the object that the reference is being attached to.externalReferenceGUID- unique identifier (guid) of the external reference details.- 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 externalReferenceLinkGUID, ExternalReferenceLinkProperties linkProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Update the link between an external reference to an object.- Parameters:
linkProperties- description for the reference from the perspective of the object that the reference is being attached to.externalReferenceLinkGUID- unique identifier (guid) of the external reference details.- 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 externalReferenceLinkGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove the link between a external reference and an element. If the element is its anchor, the external reference is removed.- Parameters:
externalReferenceLinkGUID- identifier of the external reference 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.
-
getExternalReferences
public List<ExternalReferenceElement> getExternalReferences(Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references sorted in open metadata.- Parameters:
effectiveTime- the time that the retrieved elements must be effective forstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- 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.
-
getExternalReferencesById
public List<ExternalReferenceElement> getExternalReferencesById(String resourceId, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references for this resourceId.- Parameters:
resourceId- unique reference id assigned by the resource owner (supports wildcards). This is the qualified name of the entityeffectiveTime- the time that the retrieved elements must be effective forstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- 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.
-
getExternalReferencesByURL
public List<ExternalReferenceElement> getExternalReferencesByURL(String url, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references for this URL.- Parameters:
url- URL of the external resource.effectiveTime- the time that the retrieved elements must be effective forstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- 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.
-
getExternalReferencesByName
public List<ExternalReferenceElement> getExternalReferencesByName(String name, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references for this name.- Parameters:
name- qualifiedName or displayName of the external resource.effectiveTime- the time that the retrieved elements must be effective forstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- 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.
-
getExternalReferencesForAssetManager
public List<ExternalReferenceElement> getExternalReferencesForAssetManager(Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of external reference created on behalf of the named asset manager.- Parameters:
effectiveTime- the time that the retrieved elements must be effective forstartFrom- paging start pointpageSize- maximum results that can be returned- 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 searchString, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Find the external references that contain the search string - which may contain wildcards.- Parameters:
searchString- regular expression (RegEx) to search foreffectiveTime- the time that the retrieved elements must be effective forstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- 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.
-
retrieveAttachedExternalReferences
public List<ExternalReferenceLinkElement> retrieveAttachedExternalReferences(String attachedToGUID, Date effectiveTime, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve the list of external references attached to the supplied object.- Parameters:
attachedToGUID- object linked to external reference.effectiveTime- the time that the retrieved elements must be effective forstartFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- 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(Date effectiveTime, String externalReferenceGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Return information about a specific external reference.- Parameters:
effectiveTime- the time that the retrieved elements must be effective forexternalReferenceGUID- unique identifier for the external reference- Returns:
- properties of the external reference
- Throws:
InvalidParameterException- externalReferenceGUID or userId is nullPropertyServerException- problem accessing property serverUserNotAuthorizedException- security access problem
-
-