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 Details

    • 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 Details

    • getPreviousDataFieldsForAsset

      public List<B> getPreviousDataFieldsForAsset(String userId, String discoveryReportGUID, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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.
    • getNestedDataFields

      public List<B> getNestedDataFields(String userId, String parentDataFieldGUID, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Return any data fields attached to this data field.
      Parameters:
      userId - identifier of calling user
      parentDataFieldGUID - parent data field identifier
      startingFrom - starting position in the list
      pageSize - maximum number of data fields that can be returned.
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      list of DataField objects
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      UserNotAuthorizedException - user not authorized to issue this request.
      PropertyServerException - there was a problem that occurred within the property server.
    • getLinkedDataFields

      public List<B> getLinkedDataFields(String userId, String dataFieldGUID, int startingFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Return any peer data fields attached to this data field.
      Parameters:
      userId - identifier of calling user
      dataFieldGUID - starting data field identifier
      startingFrom - starting position in the list
      pageSize - maximum number of data fields that can be returned.
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      list of DataField objects
      Throws:
      InvalidParameterException - one of the parameters is null or invalid.
      UserNotAuthorizedException - user not authorized to issue this request.
      PropertyServerException - there was a problem that occurred within the property server.
    • getDataField

      public B getDataField(String userId, String dataFieldGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Return a specific data field stored in the metadata repositories. This includes information from the entity
      Parameters:
      userId - calling user
      dataFieldGUID - unique identifier of the data field
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      data field object
      Throws:
      InvalidParameterException - one of the parameters is invalid
      UserNotAuthorizedException - the user id not authorized to issue this request
      PropertyServerException - there was a problem retrieving the data field 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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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.
    • linkDataFields

      public void linkDataFields(String userId, String externalSourceGUID, String externalSourceName, String linkFromDataFieldGUID, String linkToDataFieldGUID, int relationshipEnd, String relationshipTypeName, Map<String,String> additionalProperties, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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)
      linkFromDataFieldGUID - unique identifier of the data field that is at end 1 of the relationship
      linkToDataFieldGUID - unique identifier of the data field that is at end 2 of the relationship
      relationshipEnd - the logical end of the relationship. Use 0 if this does not make sense.
      relationshipTypeName - the name of this relationship between data fields.
      additionalProperties - any additional properties
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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 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, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, 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
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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.
    • deleteDataField

      public void deleteDataField(String userId, String externalSourceGUID, String externalSourceName, String dataFieldGUID, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove a data field from the metadata repositories.
      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
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      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 deleting the data field from the annotation store.