Class ExternalReferenceExchangeHandler


  • public class ExternalReferenceExchangeHandler
    extends Object
    ExternalReferenceExchangeHandler is the server side handler for managing externalReference content.
    • Constructor Detail

      • 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 service
        serverName - name of the local server
        invalidParameterHandler - handler for managing parameter errors
        repositoryHandler - manages calls to the repository services
        repositoryHelper - provides utilities for manipulating the repository services objects
        localServerUserId - userId for this server
        securityVerifier - open metadata security services verifier
        supportedZones - 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 Detail

      • 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 user
        assetManagerIsHome - ensure that only the asset manager can update this asset
        correlationProperties - properties to help with the mapping of the elements in the external asset manager and open metadata
        externalReferenceProperties - properties to store
        anchorGUID - 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 invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - 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,
                                                     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 caller
        assetManagerName - unique name of software server capability representing the caller
        attachedToGUID - object linked to external references
        attachedToGUIDParameterName - parameter name
        externalReferenceGUID - unique identifier (guid) of the external reference details
        externalReferenceGUIDParameterName - parameter name
        linkProperties - description for the reference from the perspective of the object that the reference is being attached to.
        methodName - 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,
                                                         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 caller
        assetManagerName - unique name of software server capability representing the caller
        externalReferenceLinkGUID - unique identifier (guid) of the external reference details
        externalReferenceGUIDParameterName - parameter name
        linkProperties - description for the reference from the perspective of the object that the reference is being attached to
        methodName - 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,
                                                       String methodName)
                                                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:
        userId - the name of the calling user.
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique name of software server capability representing the caller
        externalReferenceLinkGUID - identifier of the external reference relationship
        externalReferenceGUIDParameterName - parameter name
        methodName - 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,
                                                                    Date effectiveTime,
                                                                    int startFrom,
                                                                    int pageSize,
                                                                    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 user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique name of software server capability representing the caller
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - paging start point
        pageSize - maximum results that can be returned
        methodName - calling method
        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)
      • findExternalReferences

        public List<ExternalReferenceElement> findExternalReferences​(String userId,
                                                                     String assetManagerGUID,
                                                                     String assetManagerName,
                                                                     String searchString,
                                                                     String searchStringParameterName,
                                                                     Date effectiveTime,
                                                                     int startFrom,
                                                                     int pageSize,
                                                                     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 user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique name of software server capability representing the caller
        searchString - string to find in the properties
        searchStringParameterName - name of parameter for search string
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - paging start point
        pageSize - maximum results that can be returned
        methodName - calling method
        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)
      • getExternalReferencesByName

        public List<ExternalReferenceElement> getExternalReferencesByName​(String userId,
                                                                          String assetManagerGUID,
                                                                          String assetManagerName,
                                                                          String name,
                                                                          String nameParameterName,
                                                                          Date effectiveTime,
                                                                          int startFrom,
                                                                          int pageSize,
                                                                          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 user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique name of software server capability representing the caller
        name - name to search for
        nameParameterName - name of parameter supplying name value
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - paging start point
        pageSize - maximum results that can be returned
        methodName - calling method
        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)
      • getExternalReferencesById

        public List<ExternalReferenceElement> getExternalReferencesById​(String userId,
                                                                        String assetManagerGUID,
                                                                        String assetManagerName,
                                                                        String referenceId,
                                                                        String referenceIdParameterName,
                                                                        Date effectiveTime,
                                                                        int startFrom,
                                                                        int pageSize,
                                                                        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 user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique referenceId of software server capability representing the caller
        referenceId - referenceId to search for
        referenceIdParameterName - name of parameter supplying referenceId value
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - paging start point
        pageSize - maximum results that can be returned
        methodName - calling method
        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)
      • getExternalReferencesByURL

        public List<ExternalReferenceElement> getExternalReferencesByURL​(String userId,
                                                                         String assetManagerGUID,
                                                                         String assetManagerName,
                                                                         String url,
                                                                         String urlParameterName,
                                                                         Date effectiveTime,
                                                                         int startFrom,
                                                                         int pageSize,
                                                                         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 user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique url of software server capability representing the caller
        url - url to search for
        urlParameterName - name of parameter supplying url value
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - paging start point
        pageSize - maximum results that can be returned
        methodName - calling method
        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)
      • getExternalReferencesForAssetManager

        public List<ExternalReferenceElement> getExternalReferencesForAssetManager​(String userId,
                                                                                   String assetManagerGUID,
                                                                                   String assetManagerName,
                                                                                   Date effectiveTime,
                                                                                   int startFrom,
                                                                                   int pageSize,
                                                                                   String methodName)
                                                                            throws InvalidParameterException,
                                                                                   UserNotAuthorizedException,
                                                                                   PropertyServerException
        Retrieve the list of external references created by this caller.
        Parameters:
        userId - calling user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique name of software server capability representing the caller
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - paging start point
        pageSize - maximum results that can be returned
        methodName - calling method
        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)
      • retrieveAttachedExternalReferences

        public List<ExternalReferenceLinkElement> retrieveAttachedExternalReferences​(String userId,
                                                                                     String assetManagerGUID,
                                                                                     String assetManagerName,
                                                                                     String attachedToGUID,
                                                                                     String attachedToGUIDParameterName,
                                                                                     Date effectiveTime,
                                                                                     int startFrom,
                                                                                     int pageSize,
                                                                                     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 caller
        assetManagerName - unique name of software server capability representing the caller
        attachedToGUID - object linked to external reference
        attachedToGUIDParameterName - name of attachedToGUID parameter
        effectiveTime - the time that the retrieved elements must be effective for
        startFrom - index of the list to start from (0 for start)
        pageSize - maximum number of elements to return
        methodName - 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,
                                                                   Date effectiveTime,
                                                                   String methodName)
                                                            throws InvalidParameterException,
                                                                   UserNotAuthorizedException,
                                                                   PropertyServerException
        Retrieve the externalReference metadata element with the supplied unique identifier.
        Parameters:
        userId - calling user
        assetManagerGUID - unique identifier of software server capability representing the caller
        assetManagerName - unique name of software server capability representing the caller
        guid - unique identifier of the requested metadata element
        guidParameterName - name of parameter for guid
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        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)