java.lang.Object
org.odpi.openmetadata.accessservices.assetlineage.handlers.HandlerHelper

public class HandlerHelper extends Object
The common handler provide common methods that is generic and reusable for other handlers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HandlerHelper(org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler invalidParameterHandler, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper, org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<org.odpi.openmetadata.accessservices.assetlineage.model.GenericStub> genericHandler, Converter converter, AssetLineageTypesValidator assetLineageTypesValidator, ClockService clockService)
    Construct the handler information needed to interact with the repository services
  • Method Summary

    Modifier and Type
    Method
    Description
    org.odpi.openmetadata.accessservices.assetlineage.model.RelationshipsContext
    buildContextForLineageClassifications(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
    Builds the classification context for an entity
    org.odpi.openmetadata.accessservices.assetlineage.model.RelationshipsContext
    buildContextForRelationships(String userId, String entityGUID, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> relationships)
    Builds the relationships context for an entity
    Optional<List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail>>
    findEntitiesByType(String userId, String entityTypeName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties searchProperties, org.odpi.openmetadata.accessservices.assetlineage.model.FindEntitiesParameters findEntitiesParameters)
    Retrieves a list of entities based on the search criteria passed
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail
    getEntityDetails(String userId, String entityDetailGUID, String entityTypeName)
    Fetch the entity using the identifier and the type name
    org.odpi.openmetadata.accessservices.assetlineage.model.LineageEntity
    getLineageEntity(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
    Return the entity detail in open lineage format
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties
    Create the search body for find entities searching entities updated after the given time
    boolean
    isDataStore(String serviceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
    Verifies if the entity is of type DataStore or subtype
    boolean
    isSchemaAttribute(String serviceName, String typeName)
    Verifies if the entity is of type SchemaAttribute or subtype
    boolean
    isTable(String serviceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
    Verifies if the entity is of type RelationalTable or subtype
    boolean
    isTopic(String serviceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
    Verifies if the entity is of type Topic or subtype
    void
    validateAsset(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail, String methodName, List<String> supportedZones)
    Validate asset's GUID and it being in the specific supported zones.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HandlerHelper

      public HandlerHelper(org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler invalidParameterHandler, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper, org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<org.odpi.openmetadata.accessservices.assetlineage.model.GenericStub> genericHandler, Converter converter, AssetLineageTypesValidator assetLineageTypesValidator, ClockService clockService)
      Construct the handler information needed to interact with the repository services
      Parameters:
      invalidParameterHandler - handler for invalid parameters
      repositoryHelper - helper used by the converters
      genericHandler - handler for calling the repository services
      converter - converter used for creating entities in Lineage Warehouse format
      assetLineageTypesValidator - service for validating types
      clockService - clock service
  • Method Details

    • getEntityDetails

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail getEntityDetails(String userId, String entityDetailGUID, String entityTypeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Fetch the entity using the identifier and the type name
      Parameters:
      userId - the user identifier
      entityDetailGUID - the entity identifier
      entityTypeName - the entity type name
      Returns:
      the entity
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - one of the parameters is null or invalid.
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem retrieving the entity.
    • findEntitiesByType

      public Optional<List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail>> findEntitiesByType(String userId, String entityTypeName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties searchProperties, org.odpi.openmetadata.accessservices.assetlineage.model.FindEntitiesParameters findEntitiesParameters) throws org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Retrieves a list of entities based on the search criteria passed
      Parameters:
      userId - the user id
      entityTypeName - the name of the entity type
      searchProperties - searchProperties used in the filtering
      findEntitiesParameters - filtering used to reduce the scope of the search
      Returns:
      Optional container for collection of EntityDetails (if any) matching the supplied parameters.
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user is not authorized to make this request.
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - something went wrong with the REST call stack.
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
    • getSearchPropertiesAfterUpdateTime

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.search.SearchProperties getSearchPropertiesAfterUpdateTime(Long time)
      Create the search body for find entities searching entities updated after the given time
      Parameters:
      time - date in milliseconds after which the entities were updated
      Returns:
      the search properties having the condition updateTime greater than the provided time
    • buildContextForRelationships

      public org.odpi.openmetadata.accessservices.assetlineage.model.RelationshipsContext buildContextForRelationships(String userId, String entityGUID, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> relationships) throws org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Builds the relationships context for an entity
      Parameters:
      userId - the unique identifier for the user
      entityGUID - the guid of the entity
      relationships - the list of relationships for which the context is built
      Returns:
      a set of GraphContext containing the lineage context for the relationships
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the invalid parameter exception
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - the property server exception
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - the user not authorized exception
    • buildContextForLineageClassifications

      public org.odpi.openmetadata.accessservices.assetlineage.model.RelationshipsContext buildContextForLineageClassifications(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
      Builds the classification context for an entity
      Parameters:
      entityDetail - the entity for retrieving the classifications attached to it
      Returns:
      a set of GraphContext containing the lineage context for the classifications
    • validateAsset

      public void validateAsset(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail, String methodName, List<String> supportedZones) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Validate asset's GUID and it being in the specific supported zones.
      Parameters:
      entityDetail - the entity detail
      methodName - the method name
      supportedZones - the supported zones
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the invalid parameter exception
    • getLineageEntity

      public org.odpi.openmetadata.accessservices.assetlineage.model.LineageEntity getLineageEntity(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
      Return the entity detail in open lineage format
      Parameters:
      entityDetail - the entity detail
      Returns:
      the entity detail in open lineage format
    • isDataStore

      public boolean isDataStore(String serviceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
      Verifies if the entity is of type DataStore or subtype
      Parameters:
      serviceName - the service name
      entityDetail - the entity detail
      Returns:
      true if the entity is of type Asset or subtype, false otherwise
    • isTable

      public boolean isTable(String serviceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
      Verifies if the entity is of type RelationalTable or subtype
      Parameters:
      serviceName - the service name
      entityDetail - the entity detail
      Returns:
      true if the entity is of type RelationalTable or subtype, false otherwise
    • isSchemaAttribute

      public boolean isSchemaAttribute(String serviceName, String typeName)
      Verifies if the entity is of type SchemaAttribute or subtype
      Parameters:
      serviceName - the service name
      typeName - type of the entity
      Returns:
      true if the entity is of type TabularColumn or subtype, false otherwise
    • isTopic

      public boolean isTopic(String serviceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail entityDetail)
      Verifies if the entity is of type Topic or subtype
      Parameters:
      serviceName - the service name
      entityDetail - the entity detail
      Returns:
      true if the entity is of type RelationalTable or subtype, false otherwise