Class OpenMetadataConverterBase<B>
java.lang.Object
org.odpi.openmetadata.frameworks.governanceaction.converters.OpenMetadataConverterBase<B>
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 Summary
ConstructorsConstructorDescriptionOpenMetadataConverterBase(PropertyHelper propertyHelper, String serviceName, String serverName) Constructor captures the initial content -
Method Summary
Modifier and TypeMethodDescriptionorg.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStubgetElementStub(Class<B> beanClass, OpenMetadataElement element, String methodName) Extract the properties from the element.org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementStubgetElementStub(Class<B> beanClass, RelatedMetadataElements relationship, String methodName) Extract the properties from the relationship.org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeadergetMetadataElementHeader(Class<B> beanClass, org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementControlHeader header, String elementGUID, List<AttachedClassification> classifications, String methodName) Extract the properties from the element.getNewBean(Class<B> beanClass, OpenMetadataElement openMetadataElement, String methodName) Using the supplied openMetadataElement, return a new instance of the bean.getNewBean(Class<B> beanClass, OpenMetadataElement element, RelatedMetadataElements relationship, String methodName) Using the supplied instances, return a new instance of the bean.getNewBean(Class<B> beanClass, RelatedMetadataElement relatedMetadataElement, String methodName) Using the supplied relatedMetadataElement, return a new instance of the bean.getNewComplexBean(Class<B> beanClass, OpenMetadataElement primaryElement, List<OpenMetadataElement> supplementaryEntities, List<RelatedMetadataElements> relationships, String methodName) Using the supplied instances, return a new instance of the bean.getNewComplexBean(Class<B> beanClass, OpenMetadataElement primaryElement, List<RelatedMetadataElement> relationships, String methodName) Using the supplied instances, return a new instance of the bean.getNewRelatedMetadataElementsBean(Class<B> beanClass, RelatedMetadataElements relationship, String methodName) Using the supplied relationship, return a new instance of the bean.<T> BgetNewSchemaAttributeBean(Class<B> beanClass, OpenMetadataElement schemaAttributeElement, Class<T> typeClass, T schemaType, List<RelatedMetadataElements> schemaAttributeRelatedMetadataElements, String methodName) Extract the properties from the schema attribute element.
-
Constructor Details
-
OpenMetadataConverterBase
public OpenMetadataConverterBase(PropertyHelper propertyHelper, String serviceName, String serverName) Constructor captures the initial content- Parameters:
propertyHelper- helper object to parse elementserviceName- name of this componentserverName- 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 createopenMetadataElement- openMetadataElement containing the propertiesmethodName- 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 createrelatedMetadataElement- relatedMetadataElement containing the propertiesmethodName- 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 createelement- element containing the propertiesrelationship- relationship containing the propertiesmethodName- 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 createprimaryElement- element that is the root of the collection of entities that make up the content of the beanrelationships- relationships linking the entitiesmethodName- 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 createprimaryElement- element that is the root of the collection of entities that make up the content of the beansupplementaryEntities- entities connected to the primary element by the relationshipsrelationships- relationships linking the entitiesmethodName- 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 createrelationship- relationship linking the entitiesmethodName- 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 createschemaAttributeElement- element containing the properties for the main schema attributetypeClass- name of type used to describe the schema typeschemaType- bean containing the properties of the schema type - this is filled out by the schema type converterschemaAttributeRelatedMetadataElements- relationships containing the links to other schema attributesmethodName- 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 createheader- header from the element containing the propertieselementGUID- unique identifier of the elementclassifications- classification if this is an elementmethodName- 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 createelement- element containing the propertiesmethodName- 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 createrelationship- relationship containing the propertiesmethodName- 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
-