Class DataFieldHandler<B>

  • Type Parameters:
    B - class of bean

    public class DataFieldHandler<B>
    extends OpenMetadataAPIGenericHandler<B>
    Handler for data fields which are part of discovery reports.
    • Constructor Detail

      • DataFieldHandler

        public DataFieldHandler​(OpenMetadataAPIGenericConverter<B> converter,
                                Class<B> beanClass,
                                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 handler information needed to interact with the repository services
        Parameters:
        converter - specific converter for this bean class
        beanClass - name of bean class that is represented by the generic class B
        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 Asset instances from.
        defaultZones - list of zones that the access service should set in all new Asset instances.
        publishZones - list of zones that the access service sets up in published Asset instances.
        auditLog - destination for audit log events.
    • Method Detail

      • getPreviousDataFieldsForAsset

        public List<B> getPreviousDataFieldsForAsset​(String userId,
                                                     String discoveryReportGUID,
                                                     int startingFrom,
                                                     int pageSize,
                                                     String methodName)
                                              throws InvalidParameterException,
                                                     UserNotAuthorizedException,
                                                     PropertyServerException
        Return the list of data fields from previous runs of the discovery service. These data fields are the data fields are the accepted data fields linked to the asset's schema.
        Parameters:
        userId - identifier of calling user
        discoveryReportGUID - unique identifier of the discovery analysis report
        startingFrom - starting position in the list.
        pageSize - maximum number of elements that can be returned
        methodName - calling method
        Returns:
        list of data fields (or null if none are registered)
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user id not authorized to issue this request
        PropertyServerException - there was a problem retrieving data fields from the annotation store.
      • getNewDataFieldsForAsset

        public List<B> getNewDataFieldsForAsset​(String userId,
                                                String discoveryReportGUID,
                                                int startingFrom,
                                                int pageSize,
                                                String methodName)
                                         throws InvalidParameterException,
                                                UserNotAuthorizedException,
                                                PropertyServerException
        Return the current list of data fields for this discovery run.
        Parameters:
        userId - identifier of calling user
        discoveryReportGUID - unique identifier of the discovery analysis report
        startingFrom - starting position in the list.
        pageSize - maximum number of elements that can be returned
        methodName - calling method
        Returns:
        list of data fields (or null if none are registered)
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user id not authorized to issue this request
        PropertyServerException - there was a problem retrieving data fields from the annotation store.
      • addDataFieldToDiscoveryReport

        public String addDataFieldToDiscoveryReport​(String userId,
                                                    String externalSourceGUID,
                                                    String externalSourceName,
                                                    String annotationGUID,
                                                    int dataFieldPosition,
                                                    String dataFieldName,
                                                    String dataFieldType,
                                                    String dataFieldDescription,
                                                    List<String> dataFieldAliases,
                                                    int dataFieldSortOrder,
                                                    String defaultValue,
                                                    Map<String,​String> additionalProperties,
                                                    String methodName)
                                             throws InvalidParameterException,
                                                    UserNotAuthorizedException,
                                                    PropertyServerException
        Add a new data field to the Annotation store linked off of an annotation (typically SchemaAnalysisAnnotation).
        Parameters:
        userId - identifier of calling user
        externalSourceGUID - unique identifier of the external source (null for local)
        externalSourceName - unique name of the external source (null for local)
        annotationGUID - unique identifier of the annotation that the data field is to be linked to
        dataFieldPosition - the position of the data field in the schema (if there is ordering of fields)
        dataFieldName - the name of the data field
        dataFieldType - the type of the data field
        dataFieldDescription - a description of the data field
        dataFieldAliases - any aliases associated with the data field
        dataFieldSortOrder - any sort order
        defaultValue - default value of the field
        additionalProperties - any additional properties
        methodName - calling method
        Returns:
        unique identifier of new data field
        Throws:
        InvalidParameterException - the dataField is invalid or the annotation GUID points to an annotation that can not be associated with a data field.
        UserNotAuthorizedException - the user id not authorized to issue this request
        PropertyServerException - there was a problem adding the data field to the Annotation store.
      • addDataFieldToDataField

        public String addDataFieldToDataField​(String userId,
                                              String externalSourceGUID,
                                              String externalSourceName,
                                              String parentDataFieldGUID,
                                              int dataFieldPosition,
                                              String dataFieldName,
                                              String dataFieldType,
                                              String dataFieldDescription,
                                              List<String> dataFieldAliases,
                                              int dataFieldSortOrder,
                                              String defaultValue,
                                              Map<String,​String> additionalProperties,
                                              String methodName)
                                       throws InvalidParameterException,
                                              UserNotAuthorizedException,
                                              PropertyServerException
        Add a new data field and link it to an existing data field.
        Parameters:
        userId - identifier of calling user
        externalSourceGUID - unique identifier of the external source (null for local)
        externalSourceName - unique name of the external source (null for local)
        parentDataFieldGUID - unique identifier of the data field that this new one is to be attached to
        dataFieldPosition - the position of the data field in the schema (if there is ordering of fields)
        dataFieldName - the name of the data field
        dataFieldType - the type of the data field
        dataFieldDescription - a description of the data field
        dataFieldAliases - any aliases associated with the data field
        dataFieldSortOrder - any sort order
        defaultValue - default value of the field
        additionalProperties - any additional properties
        methodName - calling method
        Returns:
        unique identifier of new data field
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user id not authorized to issue this request
        PropertyServerException - there was a problem saving data fields in the annotation store.
      • updateDataField

        public void updateDataField​(String userId,
                                    String externalSourceGUID,
                                    String externalSourceName,
                                    String dataFieldGUID,
                                    boolean isMergeUpdate,
                                    String dataFieldName,
                                    String dataFieldType,
                                    String dataFieldDescription,
                                    List<String> dataFieldAliases,
                                    int dataFieldSortOrder,
                                    String defaultValue,
                                    Map<String,​String> additionalProperties,
                                    String methodName)
                             throws InvalidParameterException,
                                    UserNotAuthorizedException,
                                    PropertyServerException
        Replace the current properties of a data field.
        Parameters:
        userId - identifier of calling user
        externalSourceGUID - unique identifier of the external source (null for local)
        externalSourceName - unique name of the external source (null for local)
        dataFieldGUID - unique identifier of the data field
        isMergeUpdate - flag to indicate whether all properties should be updated, or just the properties specified.
        dataFieldName - the name of the data field
        dataFieldType - the type of the data field
        dataFieldDescription - a description of the data field
        dataFieldAliases - any aliases associated with the data field
        dataFieldSortOrder - any sort order
        defaultValue - default value of the field
        additionalProperties - any additional properties
        methodName - calling method
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user id not authorized to issue this request
        PropertyServerException - there was a problem updating the data field in the annotation store.