Class AssetLineagePublisher
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.assetlineage.outtopic.AssetLineagePublisher
-
public class AssetLineagePublisher extends Object
AssetLineagePublisher is the connector responsible for publishing lineage context information about new and changed assets.
-
-
Constructor Summary
Constructors Constructor Description AssetLineagePublisher(OpenMetadataTopicConnector outTopicConnector, String serverName, String serverUserName, int batchSize)The constructor is given the connection to the out topic for Asset Lineage OMAS along with classes for testing and manipulating instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisEntityEligibleForPublishing(EntityDetail entityDetail)Checks if the entity is eligible to be send in a lineage event.voidpublishAssetContextEvent(RelationshipsContext assetContext)Publishes aLineageRelationshipsEventcontaining aLineageRelationshipvoidpublishClassificationContext(EntityDetail entityDetail, AssetLineageEventType assetLineageEventType)voidpublishEvent(AssetLineageEventHeader event)Output a new asset event.voidpublishGlossaryContext(String glossaryTermGUID)Build the context for a Glossary Term based on the glossary term GUID and publishes the event to the out topiccom.google.common.collect.Multimap<String,RelationshipsContext>publishGlossaryContext(EntityDetail entityDetail)Build the context for a Glossary Term and publishes the event to the out topicvoidpublishLineageEntityEvent(LineageEntity lineageEntity, AssetLineageEventType lineageEventType)Publish lineage entity eventvoidpublishLineageMappingRelationshipEvent(LineageRelationship lineageRelationship, AssetLineageEventType eventType)Publishes aLineageRelationshipEventcontaining aLineageRelationship.voidpublishLineageRelationshipEvent(LineageRelationship lineageRelationship, AssetLineageEventType eventType)Publishes aLineageRelationshipEventcontaining aLineageRelationshipvoidpublishLineageSummaryEvent(LineagePublishSummary summary)Publish LineageSyncEvent that contains LineagePublishSummary details.com.google.common.collect.Multimap<String,RelationshipsContext>publishProcessContext(EntityDetail entityDetail)Takes the context for a Process and publishes the event to the output topic
-
-
-
Constructor Detail
-
AssetLineagePublisher
public AssetLineagePublisher(OpenMetadataTopicConnector outTopicConnector, String serverName, String serverUserName, int batchSize) throws OCFCheckedExceptionBase
The constructor is given the connection to the out topic for Asset Lineage OMAS along with classes for testing and manipulating instances.- Parameters:
outTopicConnector- connection to the out topicserverName- name of the user of the server instanceserverUserName- name of this server instance- Throws:
OCFCheckedExceptionBase
-
-
Method Detail
-
publishProcessContext
public com.google.common.collect.Multimap<String,RelationshipsContext> publishProcessContext(EntityDetail entityDetail) throws OCFCheckedExceptionBase, com.fasterxml.jackson.core.JsonProcessingException
Takes the context for a Process and publishes the event to the output topic- Parameters:
entityDetail- entity to get context- Returns:
- the Process context
- Throws:
OCFCheckedExceptionBase- checked exception for reporting errors found when using OCF connectorscom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishGlossaryContext
public void publishGlossaryContext(String glossaryTermGUID) throws OCFCheckedExceptionBase, com.fasterxml.jackson.core.JsonProcessingException
Build the context for a Glossary Term based on the glossary term GUID and publishes the event to the out topic- Parameters:
glossaryTermGUID- glossary term GUID to get context- Throws:
OCFCheckedExceptionBase- checked exception for reporting errors found when using OCF connectorscom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishGlossaryContext
public com.google.common.collect.Multimap<String,RelationshipsContext> publishGlossaryContext(EntityDetail entityDetail) throws OCFCheckedExceptionBase, com.fasterxml.jackson.core.JsonProcessingException
Build the context for a Glossary Term and publishes the event to the out topic- Parameters:
entityDetail- glossary term to get context- Returns:
- the Glossary Term context
- Throws:
OCFCheckedExceptionBase- checked exception for reporting errors found when using OCF connectorscom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishClassificationContext
public void publishClassificationContext(EntityDetail entityDetail, AssetLineageEventType assetLineageEventType) throws OCFCheckedExceptionBase, com.fasterxml.jackson.core.JsonProcessingException
- Parameters:
entityDetail- entity to get contextassetLineageEventType- event type to get published- Throws:
OCFCheckedExceptionBase- checked exception for reporting errors found when using OCF connectorscom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishLineageRelationshipEvent
public void publishLineageRelationshipEvent(LineageRelationship lineageRelationship, AssetLineageEventType eventType) throws ConnectorCheckedException, com.fasterxml.jackson.core.JsonProcessingException
Publishes aLineageRelationshipEventcontaining aLineageRelationship- Parameters:
lineageRelationship- the LineageRelationship to be publishedeventType- the type on the event- Throws:
ConnectorCheckedException- unable to send the event due to connectivity issuecom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishAssetContextEvent
public void publishAssetContextEvent(RelationshipsContext assetContext) throws ConnectorCheckedException, com.fasterxml.jackson.core.JsonProcessingException
Publishes aLineageRelationshipsEventcontaining aLineageRelationship- Parameters:
assetContext- the LineageRelationship to be published- Throws:
ConnectorCheckedException- unable to send the event due to connectivity issuecom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishEvent
public void publishEvent(AssetLineageEventHeader event) throws com.fasterxml.jackson.core.JsonProcessingException, ConnectorCheckedException
Output a new asset event.- Parameters:
event- event to send- Throws:
ConnectorCheckedException- unable to send the event due to connectivity issuecom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishLineageSummaryEvent
public void publishLineageSummaryEvent(LineagePublishSummary summary) throws com.fasterxml.jackson.core.JsonProcessingException, ConnectorCheckedException
Publish LineageSyncEvent that contains LineagePublishSummary details.- Parameters:
summary- details about lineage processing and publish activity completed by Asset Lineage OMAS.- Throws:
ConnectorCheckedException- unable to send the event due to connectivity issuecom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishLineageEntityEvent
public void publishLineageEntityEvent(LineageEntity lineageEntity, AssetLineageEventType lineageEventType) throws ConnectorCheckedException, com.fasterxml.jackson.core.JsonProcessingException
Publish lineage entity event- Parameters:
lineageEntity- - lineage entitylineageEventType- - lineage event type- Throws:
ConnectorCheckedException- unable to send the event due to connectivity issuecom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event json
-
publishLineageMappingRelationshipEvent
public void publishLineageMappingRelationshipEvent(LineageRelationship lineageRelationship, AssetLineageEventType eventType) throws OCFCheckedExceptionBase, com.fasterxml.jackson.core.JsonProcessingException
Publishes aLineageRelationshipEventcontaining aLineageRelationship. For each end of the relationship it publishes aLineageRelationshipsEventcontaining the column context if available- Parameters:
lineageRelationship- the LineageRelationship to be publishedeventType- the type on the event- Throws:
ConnectorCheckedException- unable to send the event due to connectivity issuecom.fasterxml.jackson.core.JsonProcessingException- exception parsing the event jsonOCFCheckedExceptionBase
-
isEntityEligibleForPublishing
public boolean isEntityEligibleForPublishing(EntityDetail entityDetail) throws OCFCheckedExceptionBase
Checks if the entity is eligible to be send in a lineage event. The GlossaryTerm and GlossaryCategory entities are send out if has SemanticAssignment and/or TermCategorization relationships- Parameters:
entityDetail- entity to be checked- Returns:
- true if the entity has the lineage relationships created
- Throws:
UserNotAuthorizedException- security access problemPropertyServerException- problem accessing property serverOCFCheckedExceptionBase
-
-