java.lang.Object
org.odpi.openmetadata.accessservices.dataengine.server.handlers.DataEngineCommonHandler

public class DataEngineCommonHandler extends Object
DataEngineCommonHandler manages objects from the property server. It runs server-side in the DataEngine OMAS and creates port entities with wire relationships through the OMRSRepositoryConnector.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DataEngineCommonHandler(String serviceName, String serverName, org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler invalidParameterHandler, org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<org.odpi.openmetadata.accessservices.dataengine.model.Referenceable> genericHandler, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper, DataEngineRegistrationHandler dataEngineRegistrationHandler, ClockService clockService)
    Construct the handler information needed to interact with the repository services
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail
    buildEntityDetail(String entityGUID, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
    Build an EntityDetail object based on the instance properties on an entity bean
    protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship
    buildRelationship(String entityGUID, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
    Build an Relationship object based on the instance properties of a relationship
    Optional<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail>
    findEntity(String userId, String qualifiedName, String entityTypeName)
    Find out if the entity is already stored in the repository.
    protected Optional<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship>
    findRelationship(String userId, String firstGUID, String secondGUID, String firstEntityTypeName, String secondEntityTypeName, String relationshipTypeName)
    Find out if the relationship is already stored in the repository.
    protected Set<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail>
    getEntitiesForRelationship(String userId, String guid, String relationshipTypeName, String resultingElementTypeName, String entityTypeName)
    Return the set of entities at the other end of the requested relationship type.
    Optional<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.
    protected Optional<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail>
    getEntityForRelationship(String userId, String entityGUID, String relationshipTypeName, String entityTypeName)
    Return the entity at the other end of the requested relationship type.
    protected Date
     
    protected int
    getOwnerTypeOrdinal(org.odpi.openmetadata.accessservices.dataengine.model.OwnerType ownerType)
    Return the owner type ordinal
    protected int
    getSortOrder(org.odpi.openmetadata.accessservices.dataengine.model.Attribute column)
    Return the ordinal for the order that the column is arranged in
    protected void
    removeEntity(String userId, String entityGUID, String entityTypeName, String externalSourceName)
    Remove entity
    void
    throwEntityNotDeletedException(org.odpi.openmetadata.accessservices.dataengine.ffdc.DataEngineErrorCode errorCode, String methodName, String... params)
     
    void
    throwInvalidParameterException(org.odpi.openmetadata.accessservices.dataengine.ffdc.DataEngineErrorCode errorCode, String methodName, String... params)
     
    protected void
    upsertExternalRelationship(String userId, String firstGUID, String secondGUID, String relationshipTypeName, String firstEntityTypeName, String secondEntityTypeName, String externalSourceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties relationshipProperties)
    Create or updates an external relationship between two entities.
    protected void
    validateDeleteSemantic(org.odpi.openmetadata.accessservices.dataengine.model.DeleteSemantic deleteSemantic, String methodName)
     

    Methods inherited from class java.lang.Object

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

    • DataEngineCommonHandler

      public DataEngineCommonHandler(String serviceName, String serverName, org.odpi.openmetadata.commonservices.ffdc.InvalidParameterHandler invalidParameterHandler, org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericHandler<org.odpi.openmetadata.accessservices.dataengine.model.Referenceable> genericHandler, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper, DataEngineRegistrationHandler dataEngineRegistrationHandler, ClockService clockService)
      Construct the handler information needed to interact with the repository services
      Parameters:
      serviceName - name of this service
      serverName - name of the local server
      invalidParameterHandler - handler for managing parameter errors
      genericHandler - manages calls to the repository services
      repositoryHelper - provides utilities for manipulating the repository services objects
      dataEngineRegistrationHandler - provides calls for retrieving external data engine guid
  • Method Details

    • buildEntityDetail

      protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail buildEntityDetail(String entityGUID, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
      Build an EntityDetail object based on the instance properties on an entity bean
      Parameters:
      entityGUID - unique identifier of entity to update
      instanceProperties - the properties of the entity
      Returns:
      an EntityDetail object containing the entity properties
    • buildRelationship

      protected org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship buildRelationship(String entityGUID, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties instanceProperties)
      Build an Relationship object based on the instance properties of a relationship
      Parameters:
      entityGUID - unique identifier of entity to update
      instanceProperties - the properties of the relationship
      Returns:
      an Relationship object containing the entity properties
    • findEntity

      public Optional<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> findEntity(String userId, String qualifiedName, String entityTypeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Find out if the entity is already stored in the repository. It uses the fully qualified name to retrieve the entity
      Parameters:
      userId - the name of the calling user
      qualifiedName - the qualifiedName name of the entity to be searched
      entityTypeName - the type name of the entity
      Returns:
      optional with entity details if found, empty optional if not found
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the bean properties are invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing the property server
    • getEntityDetails

      public Optional<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. It uses the unique identifier to retrieve the entity
      Parameters:
      userId - the user identifier
      entityDetailGUID - the entity unique identifier
      entityTypeName - the entity type name
      Returns:
      optional with entity details if found, empty optional if not found
      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.
    • upsertExternalRelationship

      protected void upsertExternalRelationship(String userId, String firstGUID, String secondGUID, String relationshipTypeName, String firstEntityTypeName, String secondEntityTypeName, String externalSourceName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties relationshipProperties) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Create or updates an external relationship between two entities. Verifies that the relationship is not present before creating it. If the relationship is present, verifies the instanceProperties for the relationship to be updated.
      Parameters:
      userId - the name of the calling user
      firstGUID - the unique identifier of the entity at first end
      secondGUID - the unique identifier of the entity at second end
      relationshipTypeName - type name for the relationship to create
      firstEntityTypeName - type name for the entity at first end
      secondEntityTypeName - type name for the entity at the second end
      externalSourceName - the unique name of the external source
      relationshipProperties - the properties for the relationship
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the bean properties are invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing the property server
    • findRelationship

      protected Optional<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Relationship> findRelationship(String userId, String firstGUID, String secondGUID, String firstEntityTypeName, String secondEntityTypeName, String relationshipTypeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Find out if the relationship is already stored in the repository. It will search for relationships that have the source firstGUID and target secondGUID
      Parameters:
      userId - the name of the calling user
      firstGUID - the unique identifier of the entity at first end
      secondGUID - the unique identifier of the entity at second end
      firstEntityTypeName - type name for the entity at first end
      secondEntityTypeName - type name for the entity at second end
      relationshipTypeName - type name for the relationship to create
      Returns:
      The found relationship or an empty Optional
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the bean properties are invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing the property server
    • removeEntity

      protected void removeEntity(String userId, String entityGUID, String entityTypeName, String externalSourceName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException
      Remove entity
      Parameters:
      userId - the name of the calling user
      entityGUID - the unique identifier of the port to be removed
      entityTypeName - the type name of the entity
      externalSourceName - the external data engine
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the bean properties are invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing the property server
    • getOwnerTypeOrdinal

      protected int getOwnerTypeOrdinal(org.odpi.openmetadata.accessservices.dataengine.model.OwnerType ownerType)
      Return the owner type ordinal
      Parameters:
      ownerType - OwnerType enum
      Returns:
      DataItemSortOrder enum ordinal
    • getSortOrder

      protected int getSortOrder(org.odpi.openmetadata.accessservices.dataengine.model.Attribute column)
      Return the ordinal for the order that the column is arranged in
      Parameters:
      column - the column to
      Returns:
      DataItemSortOrder enum ordinal
    • throwInvalidParameterException

      public void throwInvalidParameterException(org.odpi.openmetadata.accessservices.dataengine.ffdc.DataEngineErrorCode errorCode, String methodName, String... params) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
    • throwEntityNotDeletedException

      public void throwEntityNotDeletedException(org.odpi.openmetadata.accessservices.dataengine.ffdc.DataEngineErrorCode errorCode, String methodName, String... params) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotDeletedException
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.EntityNotDeletedException
    • getEntitiesForRelationship

      protected Set<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> getEntitiesForRelationship(String userId, String guid, String relationshipTypeName, String resultingElementTypeName, String entityTypeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException, org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException
      Return the set of entities at the other end of the requested relationship type.
      Parameters:
      userId - the name of the calling user
      guid - starting entity's GUID
      relationshipTypeName - type name for the relationship to follow
      resultingElementTypeName - resulting entity's type name
      entityTypeName - starting entity's type name
      Returns:
      retrieved entities or empty set
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the bean properties are invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing the property server
    • getEntityForRelationship

      protected Optional<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.EntityDetail> getEntityForRelationship(String userId, String entityGUID, String relationshipTypeName, String entityTypeName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException, org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException, org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Return the entity at the other end of the requested relationship type.
      Parameters:
      userId - the name of the calling user
      entityGUID - the unique identifier of the starting entity
      relationshipTypeName - the relationship type name
      entityTypeName - the entity of the starting end type name
      Returns:
      optional with entity details if found, empty optional if not found
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException - the bean properties are invalid
      org.odpi.openmetadata.frameworks.connectors.ffdc.UserNotAuthorizedException - user not authorized to issue this request
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - problem accessing the property server
    • validateDeleteSemantic

      protected void validateDeleteSemantic(org.odpi.openmetadata.accessservices.dataengine.model.DeleteSemantic deleteSemantic, String methodName) throws org.odpi.openmetadata.repositoryservices.ffdc.exception.FunctionNotSupportedException
      Throws:
      org.odpi.openmetadata.repositoryservices.ffdc.exception.FunctionNotSupportedException
    • getNow

      protected Date getNow()