Class DynamicArchiveService
- java.lang.Object
-
- org.odpi.openmetadata.frameworks.connectors.Connector
-
- org.odpi.openmetadata.frameworks.connectors.ConnectorBase
-
- org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceServiceConnector
-
- org.odpi.openmetadata.adapters.connectors.dynamicarchivers.DynamicArchiveService
-
- All Implemented Interfaces:
RepositoryGovernanceService,AuditLoggingComponent,VirtualConnectorExtension
- Direct Known Subclasses:
GlossaryDynamicArchiverConnector
public abstract class DynamicArchiveService extends RepositoryGovernanceServiceConnector
DynamicArchiveService describes a specific type of connector that is responsible for managing the content of a specific open metadata archive. Information about the available metadata is passed in the archive context. The returned archive context also contains the status of this service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classDynamicArchiveService.ArchiveDestinationDetails of one of the archive destination that this archive service is managing.-
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringarchiveDescriptionprotected List<DynamicArchiveService.ArchiveDestination>archiveDestinationsprotected static StringarchiveGUIDprotected static StringarchiveLicenseprotected static StringarchiveNameprotected static OpenMetadataArchiveTypearchiveTypeprotected static DatecreationDateprotected static StringoriginatorNameprotected static StringversionNameprotected static longversionNumber-
Fields inherited from class org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceServiceConnector
auditLog, embeddedConnectors, repositoryGovernanceContext, repositoryGovernanceServiceName
-
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, securedProperties
-
-
Constructor Summary
Constructors Constructor Description DynamicArchiveService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddClassification(ClassificationEntityExtension classification)Add a new classification to the archive.protected voidaddClassificationDef(ClassificationDef classificationDef)Add a new ClassificationDef to the archive.protected voidaddCollectionDef(CollectionDef collectionDef)Add a new CollectionDef to the archive.protected voidaddEntity(EntityDetail entity)Add a new entity to the archive.protected voidaddEntityDef(EntityDef entityDef)Add a new EntityDef to the archive.protected voidaddEnumDef(EnumDef enumDef)Add a new EnumDef to the archive.protected voidaddPrimitiveDef(PrimitiveDef primitiveDef)Add a new PrimitiveDef to the archive.protected voidaddRelationship(Relationship relationship)Add a new relationship to the archive.protected voidaddRelationshipDef(RelationshipDef relationshipDef)Add a new RelationshipDef to the archive.protected voidaddTypeDefPatch(TypeDefPatch typeDefPatch)Add a new patch to the archive.protected OpenMetadataArchivePropertiesgetArchiveProperties()Return the archive properties as will appear in the archive.protected ClassificationEntityExtensiongetClassification(String entityGUID, String classificationName)Retrieve a classification extension from the archive.protected ClassificationDefgetClassificationDef(String classificationDef)Retrieve the relationshipDef or null if it is not defined.protected CollectionDefgetCollectionDef(String collectionDefName)Retrieve a CollectionDef from the archive.protected EntityDetailgetEntity(String guid)Retrieve an entity from the archive.protected EntityDefgetEntityDef(String entityDefName)Retrieve the entityDef or null if it is not defined.protected EnumDefgetEnumDef(String enumDefName)Get an existing EnumDef from the archive.OpenMetadataArchivegetOpenMetadataArchive()Once the content of the archive has been added to the archive builder, an archive object can be retrieved.protected TypeDefPatchgetPatchForType(String typeName)Create a skeleton patch for a TypeDefPatch.protected PrimitiveDefgetPrimitiveDef(String primitiveDefName)Retrieve a PrimitiveDef from the archive.protected RelationshipgetRelationship(String guid)Retrieve a relationship from the archive.protected RelationshipDefgetRelationshipDef(String relationshipDefName)Retrieve the relationshipDef or null if it is not defined.protected TypeDefgetTypeDefByName(String typeName)Return the requested type definition if known.protected voidhandleUnexpectedException(String methodName, Exception error)Provide a common exception for unexpected errors.voidsetArchiveProperties(String archiveGUID, String archiveName, String archiveDescription, OpenMetadataArchiveType archiveType, String archiveVersion, String originatorName, String originatorLicense, Date creationDate, List<OpenMetadataArchive> dependsOnArchives)Set up archive header.voidstart()Indicates that the archive service is completely configured and can begin processing.protected voidvalidateContext(RepositoryGovernanceContext governanceContext)Verify that the context has been set up for the subclass-
Methods inherited from class org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceServiceConnector
getConnectorComponentDescription, getRepositoryGovernanceContext, initializeEmbeddedConnectors, setAuditLog, setRepositoryGovernanceContext, setRepositoryGovernanceServiceName
-
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnect, equals, getConnectedAssetProperties, getConnection, getConnectorInstanceId, hashCode, initialize, initializeConnectedAssetProperties, isActive, toString
-
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
-
-
-
-
Field Detail
-
archiveGUID
protected static final String archiveGUID
- See Also:
- Constant Field Values
-
archiveName
protected static final String archiveName
- See Also:
- Constant Field Values
-
archiveLicense
protected static final String archiveLicense
- See Also:
- Constant Field Values
-
archiveDescription
protected static final String archiveDescription
- See Also:
- Constant Field Values
-
archiveType
protected static final OpenMetadataArchiveType archiveType
-
originatorName
protected static final String originatorName
- See Also:
- Constant Field Values
-
creationDate
protected static final Date creationDate
-
versionNumber
protected static final long versionNumber
- See Also:
- Constant Field Values
-
versionName
protected static final String versionName
- See Also:
- Constant Field Values
-
archiveDestinations
protected List<DynamicArchiveService.ArchiveDestination> archiveDestinations
-
-
Method Detail
-
start
public void start() throws ConnectorCheckedExceptionIndicates that the archive service is completely configured and can begin processing. Any embedded connectors are started. This is the method where the function of the archive service is implemented in the subclass. This is a standard method from the Open Connector Framework (OCF) so be sure to call super.start() in your version.- Overrides:
startin classRepositoryGovernanceServiceConnector- Throws:
ConnectorCheckedException- there is a problem within the archive service.
-
handleUnexpectedException
protected void handleUnexpectedException(String methodName, Exception error) throws ConnectorCheckedException
Provide a common exception for unexpected errors.- Overrides:
handleUnexpectedExceptionin classRepositoryGovernanceServiceConnector- Parameters:
methodName- calling methoderror- caught exception- Throws:
ConnectorCheckedException- wrapped exception
-
validateContext
protected void validateContext(RepositoryGovernanceContext governanceContext) throws ConnectorCheckedException
Verify that the context has been set up for the subclass- Overrides:
validateContextin classRepositoryGovernanceServiceConnector- Parameters:
governanceContext- context from the subclass- Throws:
ConnectorCheckedException- error to say that the connector (governance action service) is not able to proceed because it has not been set up correctly.
-
getOpenMetadataArchive
public OpenMetadataArchive getOpenMetadataArchive()
Once the content of the archive has been added to the archive builder, an archive object can be retrieved.- Returns:
- open metadata archive object with all the supplied content in it.
-
setArchiveProperties
public void setArchiveProperties(String archiveGUID, String archiveName, String archiveDescription, OpenMetadataArchiveType archiveType, String archiveVersion, String originatorName, String originatorLicense, Date creationDate, List<OpenMetadataArchive> dependsOnArchives)
Set up archive header. It passes parameters used to build the open metadata archive's property header including the default license string. This determines the license and copyright for all instances in the archive that do not have their own explicit license string. The default license string will be inserted into each instance with a null license when it is loaded into an open metadata repository.- Parameters:
archiveGUID- unique identifier for this open metadata archive.archiveName- name of the open metadata archive.archiveDescription- description of the open metadata archive.archiveType- enum describing the type of archive this is.archiveVersion- descriptive name for the version of the archive.originatorName- name of the originator (person or organization) of the archive.originatorLicense- default license string for content.creationDate- data that this archive was created.dependsOnArchives- list of archives that this archive depends on (null for no dependencies).
-
getArchiveProperties
protected OpenMetadataArchiveProperties getArchiveProperties()
Return the archive properties as will appear in the archive. Null is returned if archive properties not set up.- Returns:
- property bean
-
addPrimitiveDef
protected void addPrimitiveDef(PrimitiveDef primitiveDef)
Add a new PrimitiveDef to the archive.- Parameters:
primitiveDef- type to add nulls are ignored
-
getPrimitiveDef
protected PrimitiveDef getPrimitiveDef(String primitiveDefName)
Retrieve a PrimitiveDef from the archive.- Parameters:
primitiveDefName- primitive to retrieve- Returns:
- PrimitiveDef type
-
addCollectionDef
protected void addCollectionDef(CollectionDef collectionDef)
Add a new CollectionDef to the archive.- Parameters:
collectionDef- type to add
-
getCollectionDef
protected CollectionDef getCollectionDef(String collectionDefName)
Retrieve a CollectionDef from the archive.- Parameters:
collectionDefName- type to retrieve- Returns:
- CollectionDef type
-
addEnumDef
protected void addEnumDef(EnumDef enumDef)
Add a new EnumDef to the archive.- Parameters:
enumDef- type to add
-
getEnumDef
protected EnumDef getEnumDef(String enumDefName)
Get an existing EnumDef from the archive.- Parameters:
enumDefName- type to retrieve- Returns:
- EnumDef object
-
addClassificationDef
protected void addClassificationDef(ClassificationDef classificationDef)
Add a new ClassificationDef to the archive.- Parameters:
classificationDef- type to add
-
getClassificationDef
protected ClassificationDef getClassificationDef(String classificationDef)
Retrieve the relationshipDef or null if it is not defined.- Parameters:
classificationDef- name of the classification- Returns:
- the retrieved classification def
-
addEntityDef
protected void addEntityDef(EntityDef entityDef)
Add a new EntityDef to the archive.- Parameters:
entityDef- type to add
-
getEntityDef
protected EntityDef getEntityDef(String entityDefName)
Retrieve the entityDef or null if it is not defined.- Parameters:
entityDefName- name of the entity- Returns:
- the retrieved entity def
-
getRelationshipDef
protected RelationshipDef getRelationshipDef(String relationshipDefName)
Retrieve the relationshipDef or null if it is not defined.- Parameters:
relationshipDefName- name of the relationship- Returns:
- the retrieved relationship def
-
addRelationshipDef
protected void addRelationshipDef(RelationshipDef relationshipDef)
Add a new RelationshipDef to the archive.- Parameters:
relationshipDef- type to add
-
getPatchForType
protected TypeDefPatch getPatchForType(String typeName)
Create a skeleton patch for a TypeDefPatch.- Parameters:
typeName- name of type- Returns:
- TypeDefPatch
-
addTypeDefPatch
protected void addTypeDefPatch(TypeDefPatch typeDefPatch)
Add a new patch to the archive.- Parameters:
typeDefPatch- patch
-
getTypeDefByName
protected TypeDef getTypeDefByName(String typeName)
Return the requested type definition if known.- Parameters:
typeName- name ot type- Returns:
- type definition
-
addEntity
protected void addEntity(EntityDetail entity)
Add a new entity to the archive.- Parameters:
entity- instance to add
-
getEntity
protected EntityDetail getEntity(String guid)
Retrieve an entity from the archive.- Parameters:
guid- unique identifier- Returns:
- requested entity
-
addRelationship
protected void addRelationship(Relationship relationship)
Add a new relationship to the archive.- Parameters:
relationship- instance to add
-
getRelationship
protected Relationship getRelationship(String guid)
Retrieve a relationship from the archive.- Parameters:
guid- unique identifier- Returns:
- requested relationship
-
addClassification
protected void addClassification(ClassificationEntityExtension classification)
Add a new classification to the archive.- Parameters:
classification- instance to add
-
getClassification
protected ClassificationEntityExtension getClassification(String entityGUID, String classificationName)
Retrieve a classification extension from the archive.- Parameters:
entityGUID- unique identifier of entityclassificationName- name of the classification- Returns:
- requested classification extension
-
-