Class OpenMetadataAPIGenericBuilder
java.lang.Object
org.odpi.openmetadata.commonservices.generichandlers.OpenMetadataAPIGenericBuilder
- Direct Known Subclasses:
AnnotationBuilder,AnnotationReviewBuilder,ContactDetailsBuilder,EmbeddedConnectionBuilder,InformalTagBuilder,ITInfrastructureBuilder,LikeBuilder,RatingBuilder,ReferenceableBuilder,SearchKeywordBuilder
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
ConstructorsConstructorDescriptionOpenMetadataAPIGenericBuilder(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 TypeMethodDescriptionorg.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertiesgetEntityClassificationProperties(String elementClassificationName, String methodName) Retrieve the requested classification and convert it to the OMRS format.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.InstanceAuditHeadergetExistingEntityClassificationHeader(String elementClassificationName, String methodName) Retrieve the requested classification and convert it to the OMRS format.org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertiesgetInstanceProperties(String methodName) Return the supplied bean properties in an InstanceProperties object.org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstancePropertiesgetInstanceProperties(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.InstanceStatusReturn the status that this entity should be created with.Return the bean's type idReturn the bean's type namebooleanisClassificationSet(String classificationName) Return whether a particular classification has been set up by the caller.voidsetAnchors(String userId, String anchorGUID, String methodName) Set up the "Anchors" classification for this entity.voidsetClassification(org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification newClassification) Add a classification to the entity.voidsetEffectivityDates(Date effectiveFrom, Date effectiveTo) Set up the effective dates for the entity.voidsetLatestChange(String userId, int latestChangeTargetOrdinal, int latestChangeActionOrdinal, String classificationName, String attachmentGUID, String attachmentTypeName, String relationshipTypeName, String actionDescription, String methodName) Set up the LatestChange classification for an anchor entity.voidsetTemplateClassifications(String userId, String externalSourceGUID, String externalSourceName, List<org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.Classification> templateClassifications, String methodName) Set up the list of classifications from a template entity.voidsetTemplateSubstitute(String userId, String methodName) Set up the "TemplateSubstitute" classification for this entity.
-
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 entitytypeName- type name to use for the entityrepositoryHelper- helper methodsserviceName- name of this OMASserverName- 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
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, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Set up the list of classifications from a template entity.- Parameters:
userId- calling userexternalSourceGUID- guid of the software capability entity that represented the external source - null for localexternalSourceName- name of the software capability entity that represented the external sourcetemplateClassifications- list of classifications from the templatemethodName- calling method- Throws:
org.odpi.openmetadata.frameworks.connectors.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.connectors.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 usermethodName- calling method- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- a null anchors GUID has been supplied
-
setAnchors
public void setAnchors(String userId, String anchorGUID, String methodName) throws org.odpi.openmetadata.frameworks.connectors.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 useranchorGUID- unique identifier of the anchor entity that this entity is linked to directly or indirectlymethodName- calling method- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.PropertyServerException- a null anchors GUID has been supplied
-
setEffectivityDates
Set up the effective dates for the entity. This determines- Parameters:
effectiveFrom- date that the element is effective fromeffectiveTo- date that the element is effective to
-
setLatestChange
public void setLatestChange(String userId, int latestChangeTargetOrdinal, int latestChangeActionOrdinal, String classificationName, String attachmentGUID, String attachmentTypeName, String relationshipTypeName, String actionDescription, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Set up the LatestChange classification for an anchor entity. This is typically used on the create of the anchor and other direct update actions on it. Other updates are made to it through the generic handler as attachments are added and changed.- Parameters:
userId- calling userlatestChangeTargetOrdinal- ordinal for the LatestChangeTarget enum valuelatestChangeActionOrdinal- ordinal for the LatestChangeAction enum valueclassificationName- name of a changed classificationattachmentGUID- unique identifier of an entity attached to the anchorattachmentTypeName- type name of the attached entityrelationshipTypeName- relationship used to attach the entityactionDescription- human readable description of the changemethodName- calling method- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- this classification is not supported
-
getTypeName
Return the bean's type name- Returns:
- string name
-
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.connectors.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.connectors.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.connectors.ffdc.InvalidParameterExceptionReturn the properties based on the parameters supplied. This is typically used for relationship and classification properties.- Parameters:
propertyMap- map of property names to valueseffectiveFrom- 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.connectors.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
-
getExistingEntityClassificationHeader
public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceAuditHeader getExistingEntityClassificationHeader(String elementClassificationName, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Retrieve the requested classification and convert it to the OMRS format.- Parameters:
elementClassificationName- name of the classification to retrieve/convertmethodName- calling method- Returns:
- null if the classification is not found for an OMRS Classification bean for the named classification
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- the classification name parameter is null
-
getEntityClassificationProperties
public org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.properties.instances.InstanceProperties getEntityClassificationProperties(String elementClassificationName, String methodName) throws org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException Retrieve the requested classification and convert it to the OMRS format.- Parameters:
elementClassificationName- name of the classification to retrieve/convertmethodName- calling method- Returns:
- null or the appropriate properties
- Throws:
org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException- the classification name parameter is null
-