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
,SecureConnectorExtension
,VirtualConnectorExtension
- Direct Known Subclasses:
GlossaryDynamicArchiverConnector
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
Modifier and TypeClassDescriptionprotected class
Details 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
Modifier and TypeFieldDescriptionprotected static final String
protected List<DynamicArchiveService.ArchiveDestination>
protected static final String
protected static final String
protected static final String
protected static final OpenMetadataArchiveType
protected static final Date
protected static final String
protected static final String
protected static final long
Fields inherited from class org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceServiceConnector
auditLog, repositoryGovernanceContext, repositoryGovernanceServiceName
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addClassification
(ClassificationEntityExtension classification) Add a new classification to the archive.protected void
addClassificationDef
(ClassificationDef classificationDef) Add a new ClassificationDef to the archive.protected void
addCollectionDef
(CollectionDef collectionDef) Add a new CollectionDef to the archive.protected void
addEntity
(EntityDetail entity) Add a new entity to the archive.protected void
addEntityDef
(EntityDef entityDef) Add a new EntityDef to the archive.protected void
addEnumDef
(EnumDef enumDef) Add a new EnumDef to the archive.protected void
addPrimitiveDef
(PrimitiveDef primitiveDef) Add a new PrimitiveDef to the archive.protected void
addRelationship
(Relationship relationship) Add a new relationship to the archive.protected void
addRelationshipDef
(RelationshipDef relationshipDef) Add a new RelationshipDef to the archive.protected void
addTypeDefPatch
(TypeDefPatch typeDefPatch) Add a new patch to the archive.protected OpenMetadataArchiveProperties
Return the archive properties as will appear in the archive.protected ClassificationEntityExtension
getClassification
(String entityGUID, String classificationName) Retrieve a classification extension from the archive.protected ClassificationDef
getClassificationDef
(String classificationDef) Retrieve the relationshipDef or null if it is not defined.protected CollectionDef
getCollectionDef
(String collectionDefName) Retrieve a CollectionDef from the archive.protected EntityDetail
Retrieve an entity from the archive.protected EntityDef
getEntityDef
(String entityDefName) Retrieve the entityDef or null if it is not defined.protected EnumDef
getEnumDef
(String enumDefName) Get an existing EnumDef from the archive.Once the content of the archive has been added to the archive builder, an archive object can be retrieved.protected TypeDefPatch
getPatchForType
(String typeName) Create a skeleton patch for a TypeDefPatch.protected PrimitiveDef
getPrimitiveDef
(String primitiveDefName) Retrieve a PrimitiveDef from the archive.protected Relationship
getRelationship
(String guid) Retrieve a relationship from the archive.protected RelationshipDef
getRelationshipDef
(String relationshipDefName) Retrieve the relationshipDef or null if it is not defined.protected TypeDef
getTypeDefByName
(String typeName) Return the requested type definition if known.protected void
handleUnexpectedException
(String methodName, Exception error) Provide a common exception for unexpected errors.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.void
start()
Indicates that the archive service is completely configured and can begin processing.protected void
validateContext
(RepositoryGovernanceContext governanceContext) Verify that the context has been set up for the subclassMethods inherited from class org.odpi.openmetadata.engineservices.repositorygovernance.connector.RepositoryGovernanceServiceConnector
getConnectorComponentDescription, getRepositoryGovernanceContext, setAuditLog, setRepositoryGovernanceContext, setRepositoryGovernanceServiceName
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnect, disconnectConnectors, equals, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, getIntConfigurationProperty, getLongConfigurationProperty, getNetworkAddresses, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, initialize, initializeConnectedAssetProperties, initializeEmbeddedConnectors, initializeSecretsStoreConnector, isActive, logExceptionRecord, logRecord, logRecord, throwMissingConfigurationProperty, throwMissingResource, throwNoAsset, throwWrongTypeOfAsset, throwWrongTypeOfResource, throwWrongTypeOfRootSchema, toString
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.Connector
clearStatisticProperty, clearStatisticTimestamp, getConnectorStatistics, getStatisticCounter, getStatisticProperty, getStatisticTimestamp, incrementStatisticCounter, initializeStatisticCounter, setStatisticProperty, setStatisticTimestamp
-
Field Details
-
archiveGUID
- See Also:
-
archiveName
- See Also:
-
archiveLicense
- See Also:
-
archiveDescription
- See Also:
-
archiveType
-
originatorName
- See Also:
-
creationDate
-
versionNumber
protected static final long versionNumber- See Also:
-
versionName
- See Also:
-
archiveDestinations
-
-
Constructor Details
-
DynamicArchiveService
public DynamicArchiveService()
-
-
Method Details
-
start
Indicates 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:
start
in 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:
handleUnexpectedException
in 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:
validateContext
in 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
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
Return the archive properties as will appear in the archive. Null is returned if archive properties not set up.- Returns:
- property bean
-
addPrimitiveDef
Add a new PrimitiveDef to the archive.- Parameters:
primitiveDef
- type to add nulls are ignored
-
getPrimitiveDef
Retrieve a PrimitiveDef from the archive.- Parameters:
primitiveDefName
- primitive to retrieve- Returns:
- PrimitiveDef type
-
addCollectionDef
Add a new CollectionDef to the archive.- Parameters:
collectionDef
- type to add
-
getCollectionDef
Retrieve a CollectionDef from the archive.- Parameters:
collectionDefName
- type to retrieve- Returns:
- CollectionDef type
-
addEnumDef
Add a new EnumDef to the archive.- Parameters:
enumDef
- type to add
-
getEnumDef
Get an existing EnumDef from the archive.- Parameters:
enumDefName
- type to retrieve- Returns:
- EnumDef object
-
addClassificationDef
Add a new ClassificationDef to the archive.- Parameters:
classificationDef
- type to add
-
getClassificationDef
Retrieve the relationshipDef or null if it is not defined.- Parameters:
classificationDef
- name of the classification- Returns:
- the retrieved classification def
-
addEntityDef
Add a new EntityDef to the archive.- Parameters:
entityDef
- type to add
-
getEntityDef
Retrieve the entityDef or null if it is not defined.- Parameters:
entityDefName
- name of the entity- Returns:
- the retrieved entity def
-
getRelationshipDef
Retrieve the relationshipDef or null if it is not defined.- Parameters:
relationshipDefName
- name of the relationship- Returns:
- the retrieved relationship def
-
addRelationshipDef
Add a new RelationshipDef to the archive.- Parameters:
relationshipDef
- type to add
-
getPatchForType
Create a skeleton patch for a TypeDefPatch.- Parameters:
typeName
- name of type- Returns:
- TypeDefPatch
-
addTypeDefPatch
Add a new patch to the archive.- Parameters:
typeDefPatch
- patch
-
getTypeDefByName
Return the requested type definition if known.- Parameters:
typeName
- name ot type- Returns:
- type definition
-
addEntity
Add a new entity to the archive.- Parameters:
entity
- instance to add
-
getEntity
Retrieve an entity from the archive.- Parameters:
guid
- unique identifier- Returns:
- requested entity
-
addRelationship
Add a new relationship to the archive.- Parameters:
relationship
- instance to add
-
getRelationship
Retrieve a relationship from the archive.- Parameters:
guid
- unique identifier- Returns:
- requested relationship
-
addClassification
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
-