Class OCFConverter<B>

  • Direct Known Subclasses:
    ConnectionConverter, ODFConverter

    public abstract class OCFConverter<B>
    extends OpenMetadataAPIGenericConverter<B>
    DigitalArchitectureOMASConverter provides the generic methods for the Data Manager beans converters. Generic classes have limited knowledge of the classes these are working on and this means creating a new instance of a class from within a generic is a little involved. This class provides the generic method for creating and initializing a Data Manager bean.
    • Constructor Detail

      • OCFConverter

        protected OCFConverter​(OMRSRepositoryHelper repositoryHelper,
                               String serviceName,
                               String serverName)
        Constructor
        Parameters:
        repositoryHelper - helper object to parse entity
        serviceName - name of this component
        serverName - name of this server
    • Method Detail

      • setUpElementHeader

        protected void setUpElementHeader​(ElementHeader elementHeader,
                                          EntityDetail entity,
                                          String expectedTypeName,
                                          String methodName)
                                   throws PropertyServerException
        Extract the properties from the entity.
        Parameters:
        elementHeader - the header for the bean
        entity - entity containing the properties
        expectedTypeName - type that the entity must match (or it may be a subtype)
        methodName - calling method
        Throws:
        PropertyServerException - the supplied entity is not of the expected type
      • setUpElementHeader

        protected void setUpElementHeader​(ElementHeader elementHeader,
                                          InstanceHeader instanceHeader,
                                          List<Classification> classifications,
                                          String methodName)
                                   throws PropertyServerException
        Extract the properties from the entity.
        Parameters:
        elementHeader - the header for the bean
        instanceHeader - header of entity
        classifications - classifications from the entity
        methodName - calling method
        Throws:
        PropertyServerException - the supplied entity is not of the expected type
      • getEntityClassifications

        protected List<ElementClassification> getEntityClassifications​(List<Classification> entityClassifications)
        Extract the classifications from the entity.
        Parameters:
        entityClassifications - list of classifications from entity
        Returns:
        list of bean classifications
      • getClassification

        protected ElementClassification getClassification​(String classificationName,
                                                          List<ElementClassification> beanClassifications)
        Retrieve a specific named classification.
        Parameters:
        classificationName - name of classification
        beanClassifications - list of classifications retrieved from the repositories
        Returns:
        null or the requested classification
      • removeClassification

        protected List<ElementClassification> removeClassification​(String classificationName,
                                                                   List<ElementClassification> beanClassifications)
        Remove the requested classification from the bean classifications and return the resulting list.
        Parameters:
        classificationName - name of the classification
        beanClassifications - list of classifications retrieved from the repositories
        Returns:
        null or a list of classifications
      • removeSortOrder

        protected DataItemSortOrder removeSortOrder​(InstanceProperties instanceProperties)
        Extract and delete the sortOrder property from the supplied instance properties.
        Parameters:
        instanceProperties - properties from entity
        Returns:
        DataItemSortOrder enum
      • removeOwnerTypeFromProperties

        protected OwnerType removeOwnerTypeFromProperties​(InstanceProperties properties)
        Retrieve and delete the OwnerType enum property from the instance properties of an entity
        Parameters:
        properties - entity properties
        Returns:
        OwnerType enum value
      • getOwnerTypeFromProperties

        protected OwnerType getOwnerTypeFromProperties​(InstanceProperties properties)
        Retrieve the OwnerType enum property from the instance properties of a classification
        Parameters:
        properties - entity properties
        Returns:
        OwnerType enum value
      • getEmbeddedConnection

        protected Connection getEmbeddedConnection​(Class<B> beanClass,
                                                   EntityDetail primaryEntity,
                                                   List<EntityDetail> supplementaryEntities,
                                                   List<Relationship> relationships,
                                                   String methodName)
                                            throws PropertyServerException
        Using the supplied instances, return a new instance of the Connection bean. It may be a Connection or a VirtualConnection.
        Parameters:
        beanClass - class name for the bean
        primaryEntity - entity that is the root of the cluster of entities that make up the content of the bean
        supplementaryEntities - entities connected to the primary entity by the relationships
        relationships - relationships linking the entities
        methodName - calling method
        Returns:
        bean populated with properties from the instances supplied in the constructor
        Throws:
        PropertyServerException - there is a problem instantiating the bean