java.lang.Object
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericConverter<B>
org.odpi.openmetadata.commonservices.generichandlers.OMFConverter<B>
Direct Known Subclasses:
CatalogTargetConverter, ControlFlowConverter, DataFlowConverter, ElementHeaderConverter, GovernanceEngineConverter, GovernanceServiceConverter, IntegrationConnectorConverter, IntegrationGroupConverter, MetadataElementConverter, MetadataRelationshipConverter, MetadataSourceConverter, OCFConnectionConverter, OpenMetadataStoreConverter, ProcessCallConverter, ReferenceableConverter, RelatedElementConverter, SAFConverter

public abstract class OMFConverter<B> extends OpenMetadataAPIGenericConverter<B>
OMFConverter provides the generic methods for the OCF 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 an OMF bean.
  • Field Details

    • karmaPointPlateau

      protected long karmaPointPlateau
  • Constructor Details

    • OMFConverter

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

      public OMFConverter(OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName, int karmaPointPlateau)
      Constructor
      Parameters:
      repositoryHelper - helper object to parse entity
      serviceName - name of this component
      serverName - local server name
      karmaPointPlateau - how many karma points to a plateau
  • Method Details

    • 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, String methodName) throws PropertyServerException
      Extract the properties from the entity.
      Parameters:
      elementHeader - the header for the bean
      instanceHeader - header of entity
      methodName - calling method
      Throws:
      PropertyServerException - the supplied entity is not of the expected type
    • getRelatedMetadataElementSummary

      public RelatedMetadataElementSummary getRelatedMetadataElementSummary(Class<B> beanClass, RelatedEntity relatedEntity, String methodName) throws PropertyServerException
      Extract the properties from the element.
      Parameters:
      beanClass - name of the class to create
      relatedEntity - from the repository
      methodName - calling method
      Returns:
      filled out element header
      Throws:
      PropertyServerException - there is a problem in the use of the generic handlers because the converter has been configured with a type of bean that is incompatible with the handler
    • 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 collection 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
    • removePermittedSynchronization

      protected PermittedSynchronization removePermittedSynchronization(InstanceProperties instanceProperties)
      Extract and delete the permittedSynchronization property from the supplied instance properties.
      Parameters:
      instanceProperties - properties from entity
      Returns:
      PermittedSynchronization enum
    • removePortType

      protected PortType removePortType(InstanceProperties instanceProperties)
      Extract and delete the portType property from the supplied instance properties.
      Parameters:
      instanceProperties - properties from entity
      Returns:
      PortType enum
    • getContactMethodTypeFromProperties

      protected ContactMethodType getContactMethodTypeFromProperties(InstanceProperties properties)
      Retrieve the ContactMethodType enum property from the instance properties of an entity
      Parameters:
      properties - entity properties
      Returns:
      ContactMethodType enum value