Class OpenMetadataConverterBase<B>

java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.converters.OpenMetadataConverterBase<B>

public abstract class OpenMetadataConverterBase<B> extends Object
OpenMetadataConverterBase provides the generic methods for the bean converters used to provide translation between specific API beans and the Open Metadata services beans from the Governance Action Framework (GAF). 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 Open Metadata API bean.
  • Constructor Details

    • OpenMetadataConverterBase

      public OpenMetadataConverterBase(PropertyHelper propertyHelper, String serviceName, String serverName)
      Constructor captures the initial content
      Parameters:
      propertyHelper - helper object to parse element
      serviceName - name of this component
      serverName - name of this server
  • Method Details

    • getNewBean

      public B getNewBean(Class<B> beanClass, OpenMetadataElement openMetadataElement, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Using the supplied openMetadataElement, return a new instance of the bean. This is used for most beans that have a one to one correspondence with the repository instances.
      Parameters:
      beanClass - name of the class to create
      openMetadataElement - openMetadataElement containing the properties
      methodName - calling method
      Returns:
      bean populated with properties from the openMetadataElement supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getNewBean

      public B getNewBean(Class<B> beanClass, RelatedMetadataElement relatedMetadataElement, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Using the supplied relatedMetadataElement, return a new instance of the bean. This is used for most beans that have a one to one correspondence with the repository instances.
      Parameters:
      beanClass - name of the class to create
      relatedMetadataElement - relatedMetadataElement containing the properties
      methodName - calling method
      Returns:
      bean populated with properties from the relatedMetadataElement supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getNewBean

      public B getNewBean(Class<B> beanClass, OpenMetadataElement element, RelatedMetadataElements relationship, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Using the supplied instances, return a new instance of the bean. This is used for beans that contain a combination of the properties from an element and that of a connected relationship.
      Parameters:
      beanClass - name of the class to create
      element - element containing the properties
      relationship - relationship containing the properties
      methodName - calling method
      Returns:
      bean populated with properties from the instances supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getNewComplexBean

      public B getNewComplexBean(Class<B> beanClass, OpenMetadataElement primaryElement, List<RelatedMetadataElement> relationships, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Using the supplied instances, return a new instance of the bean. It is used for beans such as an Annotation or To Do bean which combine knowledge from the element and its linked relationships.
      Parameters:
      beanClass - name of the class to create
      primaryElement - element that is the root of the collection of entities that make up the content of the bean
      relationships - relationships linking the entities
      methodName - calling method
      Returns:
      bean populated with properties from the instances supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getNewComplexBean

      public B getNewComplexBean(Class<B> beanClass, OpenMetadataElement primaryElement, List<OpenMetadataElement> supplementaryEntities, List<RelatedMetadataElements> relationships, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Using the supplied instances, return a new instance of the bean. It is used for beans such as a connection bean which made up of 3 entities (Connection, ConnectorType and Endpoint) plus the relationships between them. The relationships may be omitted if they do not have any properties.
      Parameters:
      beanClass - name of the class to create
      primaryElement - element that is the root of the collection of entities that make up the content of the bean
      supplementaryEntities - entities connected to the primary element by the relationships
      relationships - relationships linking the entities
      methodName - calling method
      Returns:
      bean populated with properties from the instances supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getNewRelatedMetadataElementsBean

      public B getNewRelatedMetadataElementsBean(Class<B> beanClass, RelatedMetadataElements relationship, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Using the supplied relationship, return a new instance of the bean. It is used for beans that represent a simple relationship between two entities.
      Parameters:
      beanClass - name of the class to create
      relationship - relationship linking the entities
      methodName - calling method
      Returns:
      bean populated with properties from the instances supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getNewSchemaAttributeBean

      public <T> B getNewSchemaAttributeBean(Class<B> beanClass, OpenMetadataElement schemaAttributeElement, Class<T> typeClass, T schemaType, List<RelatedMetadataElements> schemaAttributeRelatedMetadataElements, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Extract the properties from the schema attribute element. Each API creates a specialization of this method for its beans.
      Type Parameters:
      T - bean type used to create the schema type
      Parameters:
      beanClass - name of the class to create
      schemaAttributeElement - element containing the properties for the main schema attribute
      typeClass - name of type used to describe the schema type
      schemaType - bean containing the properties of the schema type - this is filled out by the schema type converter
      schemaAttributeRelatedMetadataElements - relationships containing the links to other schema attributes
      methodName - calling method
      Returns:
      bean populated with properties from the instances supplied
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException - there is a problem instantiating the bean
    • getMetadataElementHeader

      public org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader getMetadataElementHeader(Class<B> beanClass, org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementControlHeader header, String elementGUID, List<AttachedClassification> classifications, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Extract the properties from the element.
      Parameters:
      beanClass - name of the class to create
      header - header from the element containing the properties
      elementGUID - unique identifier of the element
      classifications - classification if this is an element
      methodName - calling method
      Returns:
      filled out element header
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.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
    • getElementStub

      public org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub getElementStub(Class<B> beanClass, OpenMetadataElement element, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Extract the properties from the element.
      Parameters:
      beanClass - name of the class to create
      element - element containing the properties
      methodName - calling method
      Returns:
      filled out element header
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.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
    • getElementStub

      public org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStub getElementStub(Class<B> beanClass, RelatedMetadataElements relationship, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException
      Extract the properties from the relationship.
      Parameters:
      beanClass - name of the class to create
      relationship - relationship containing the properties
      methodName - calling method
      Returns:
      filled out element header
      Throws:
      org.odpi.openmetadata.frameworks.connectors.ffdc.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