Class OpenMetadataAPIGenericBuilder

java.lang.Object
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericBuilder
Direct Known Subclasses:
AnnotationBuilder, AnnotationReviewBuilder, ContactDetailsBuilder, EmbeddedConnectionBuilder, InformalTagBuilder, ITInfrastructureBuilder, LikeBuilder, RatingBuilder, ReferenceableBuilder, SearchKeywordBuilder

public class OpenMetadataAPIGenericBuilder extends Object
OpenMetadataAPIGenericBuilder provides the common functions for building new entities, relationships and classifications. Subtypes push details of their classifications to this supertype. They manage their instance properties.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpenMetadataAPIGenericBuilder(String typeGUID, String typeName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
    Constructor for working with classifications.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification>
    Return a list of entity classifications that can be stored in the metadata repository.
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties
    Return the supplied bean properties in an InstanceProperties object.
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties
    getInstanceProperties(Map<String,org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertyValue> propertyMap, Date effectiveFrom, Date effectiveTo)
    Return the properties based on the parameters supplied.
    org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus
    Return the status that this entity should be created with.
    Return the bean's type id
    Return the bean's type name
    boolean
    isClassificationSet(String classificationName)
    Return whether a particular classification has been set up by the caller.
    void
    setAnchors(String userId, String anchorGUID, String anchorTypeName, String anchorDomainName, String anchorScopeGUID, String methodName)
    Set up the "Anchors" classification for this entity.
    void
    Set up the "Anchors" classification for this entity.
    void
    setClassification(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification newClassification)
    Add a classification to the entity.
    void
    setEffectivityDates(Date effectiveFrom, Date effectiveTo)
    Set up the effective dates for the entity.
    void
    setTemplateClassifications(String userId, String externalSourceGUID, String externalSourceName, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> templateClassifications, Map<String,String> placeholderProperties, String methodName)
    Set up the list of classifications from a template entity.
    void
    setTemplateSubstitute(String userId, String methodName)
    Set up the "TemplateSubstitute" classification for this entity.

    Methods inherited from class java.lang.Object

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

    • OpenMetadataAPIGenericBuilder

      public OpenMetadataAPIGenericBuilder(String typeGUID, String typeName, org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.repositoryconnector.OMRSRepositoryHelper repositoryHelper, String serviceName, String serverName)
      Constructor for working with classifications.
      Parameters:
      typeGUID - type GUID to use for the entity
      typeName - type name to use for the entity
      repositoryHelper - helper methods
      serviceName - name of this OMAS
      serverName - name of local server
  • Method Details

    • setClassification

      public void setClassification(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification newClassification)
      Add a classification to the entity. This overrides any existing value for this classification.
      Parameters:
      newClassification - classification object ready for the repository
    • isClassificationSet

      public boolean isClassificationSet(String classificationName)
      Return whether a particular classification has been set up by the caller.
      Parameters:
      classificationName - name of the classification to test for
      Returns:
      boolean
    • setTemplateClassifications

      public void setTemplateClassifications(String userId, String externalSourceGUID, String externalSourceName, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> templateClassifications, Map<String,String> placeholderProperties, String methodName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException
      Set up the list of classifications from a template entity.
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      templateClassifications - list of classifications from the template
      placeholderProperties - map of placeholder names to placeholder values to substitute into the template properties
      methodName - calling method
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - the type of one of the classifications is not supported
    • setTemplateSubstitute

      public void setTemplateSubstitute(String userId, String methodName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Set up the "TemplateSubstitute" classification for this entity. This is used when a new entity is being created, and it is known to be created as a template substitute.
      Parameters:
      userId - calling user
      methodName - calling method
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - a null anchors GUID has been supplied
    • setAnchors

      public void setAnchors(String userId, OpenMetadataAPIAnchorHandler.AnchorIdentifiers anchorIdentifiers, String methodName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Set up the "Anchors" classification for this entity. This is used when a new entity is being created, and it is known to be connected to a specific anchor.
      Parameters:
      userId - calling user
      anchorIdentifiers - values for anchors classification
      methodName - calling method
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - a null anchors GUID has been supplied
    • setAnchors

      public void setAnchors(String userId, String anchorGUID, String anchorTypeName, String anchorDomainName, String anchorScopeGUID, String methodName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException
      Set up the "Anchors" classification for this entity. This is used when a new entity is being created, and it is known to be connected to a specific anchor.
      Parameters:
      userId - calling user
      anchorGUID - unique identifier of the anchor entity that this entity is linked to directly or indirectly
      anchorTypeName - unique name of the anchor entity's type
      anchorDomainName - unique name of the anchor entity's domain
      anchorScopeGUID - unique identifier of the anchor's scope
      methodName - calling method
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.PropertyServerException - a null anchors GUID has been supplied
    • setEffectivityDates

      public void setEffectivityDates(Date effectiveFrom, Date effectiveTo)
      Set up the effective dates for the entity. This determines
      Parameters:
      effectiveFrom - date that the element is effective from
      effectiveTo - date that the element is effective to
    • getTypeName

      public String getTypeName()
      Return the bean's type name
      Returns:
      string name
    • getTypeGUID

      public String getTypeGUID()
      Return the bean's type id
      Returns:
      string id
    • getInstanceStatus

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceStatus getInstanceStatus()
      Return the status that this entity should be created with.
      Returns:
      instance status enum
    • getInstanceProperties

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties getInstanceProperties(String methodName) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException
      Return the supplied bean properties in an InstanceProperties object.
      Parameters:
      methodName - name of the calling method
      Returns:
      InstanceProperties object
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - there is a problem with the properties
    • getInstanceProperties

      public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties getInstanceProperties(Map<String,org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertyValue> propertyMap, Date effectiveFrom, Date effectiveTo) throws org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException
      Return the properties based on the parameters supplied. This is typically used for relationship and classification properties.
      Parameters:
      propertyMap - map of property names to values
      effectiveFrom - date to make the element active in the governance program (null for now)
      effectiveTo - date to remove the element from the governance program (null = until deleted)
      Returns:
      repository services properties
      Throws:
      org.odpi.openmetadata.frameworks.openmetadata.ffdc.InvalidParameterException - problem mapping properties
    • getEntityClassifications

      public List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> getEntityClassifications()
      Return a list of entity classifications that can be stored in the metadata repository.
      Returns:
      list of entity classification objects