Class DirectoryBasedOpenMetadataArchiveStoreConnector
java.lang.Object
org.odpi.openmetadata.frameworks.connectors.Connector
org.odpi.openmetadata.frameworks.connectors.ConnectorBase
org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.OpenMetadataArchiveStoreConnector
org.odpi.openmetadata.adapters.repositoryservices.archiveconnector.directory.DirectoryBasedOpenMetadataArchiveStoreConnector
- All Implemented Interfaces:
AuditLoggingComponent
,SecureConnectorExtension
,VirtualConnectorExtension
,OpenMetadataArchiveBuilder
,OpenMetadataArchiveStore
public class DirectoryBasedOpenMetadataArchiveStoreConnector
extends OpenMetadataArchiveStoreConnector
implements OpenMetadataArchiveBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
ConnectorBase.ProtectedConnection
-
Field Summary
Fields inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.OpenMetadataArchiveStoreConnector
auditLog
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
connectedAssetProperties, connectionBean, connectionProperties, connectorInstanceId, embeddedConnectors, messageFormatter, secretsStoreConnectorMap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClassification
(ClassificationEntityExtension classification) Add a new classification to the archive.void
addClassificationDef
(ClassificationDef classificationDef) Add a new ClassificationDef to the archive.void
addCollectionDef
(CollectionDef collectionDef) Add a new CollectionDef to the archive.void
addEntity
(EntityDetail entity) Add a new entity to the archive.void
addEntityDef
(EntityDef entityDef) Add a new EntityDef to the archive.void
addEnumDef
(EnumDef enumDef) Add a new EnumDef to the archive.void
addPrimitiveDef
(PrimitiveDef primitiveDef) Add a new PrimitiveDef to the archive.void
addRelationship
(Relationship relationship) Add a new relationship to the archive.void
addRelationshipDef
(RelationshipDef relationshipDef) Add a new RelationshipDef to the archive.void
addTypeDefPatch
(TypeDefPatch typeDefPatch) Add a new patch to the archive.void
Free up any resources held since the connector is no longer needed.Return the contents of the archive.Return the archive properties.getClassification
(String entityGUID, String classificationName) Retrieve a classification extension from the archive.getClassificationDef
(String classificationDefName) Retrieve the relationshipDef or null if it is not defined.getCollectionDef
(String collectionDefName) Retrieve a CollectionDef from the archive.Retrieve an entity from the archive.getEntityDef
(String entityDefName) Retrieve the entityDef or null if it is not defined.getEnumDef
(String enumDefName) Get an existing EnumDef from the archive.getPatchForType
(String typeName) Create a skeleton patch for a TypeDefPatch.getPrimitiveDef
(String primitiveDefName) Retrieve a PrimitiveDef from the archive.getRelationship
(String guid) Retrieve a relationship from the archive.getRelationshipDef
(String relationshipDefName) Retrieve the relationshipDef or null if it is not defined.getTypeDefByName
(String typeName) Return the requested type definition if known.void
initialize
(String connectorInstanceId, ConnectionProperties connectionProperties) Retrieve the archive store information from the endpoint.queryClassification
(String entityGUID, String classificationName) Retrieve a classification extension from the archive.queryEntity
(String guid) Retrieve an entity from the archive.queryRelationship
(String guid) Retrieve a relationship from the archive.void
setArchiveContents
(OpenMetadataArchive archiveContents) Set new contents into the archive.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 and initialize the maps assuming it is building a new archive.void
start()
Indicates that the connector is completely configured and can begin processing.Methods inherited from class org.odpi.openmetadata.repositoryservices.connectors.stores.archivestore.OpenMetadataArchiveStoreConnector
getConnectorComponentDescription, setAuditLog
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.ConnectorBase
disconnectConnectors, equals, getArrayConfigurationProperty, getAssetTypeName, getBooleanConfigurationProperty, getConnectedAssetProperties, getConnection, getConnectorInstanceId, getIntConfigurationProperty, getLongConfigurationProperty, getNetworkAddresses, getStringConfigurationProperty, getSuppliedPlaceholderProperties, hashCode, 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
-
Constructor Details
-
DirectoryBasedOpenMetadataArchiveStoreConnector
public DirectoryBasedOpenMetadataArchiveStoreConnector()Default constructor
-
-
Method Details
-
initialize
Retrieve the archive store information from the endpoint.- Overrides:
initialize
in classConnectorBase
- Parameters:
connectorInstanceId
- unique id for the connector instance useful for messages etcconnectionProperties
- POJO for the configuration used to create the connector.
-
start
Indicates that the connector is completely configured and can begin processing.- Overrides:
start
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-
getArchiveContents
Return the contents of the archive.- Specified by:
getArchiveContents
in interfaceOpenMetadataArchiveStore
- Returns:
- OpenMetadataArchive object
- Throws:
RepositoryErrorException
- there is a problem accessing the archive
-
getArchiveProperties
Return the archive properties.- Specified by:
getArchiveProperties
in interfaceOpenMetadataArchiveBuilder
- Returns:
- properties structure stored as a file encoded in JSON
-
setArchiveContents
Set new contents into the archive. This overrides any content previously stored.- Specified by:
setArchiveContents
in interfaceOpenMetadataArchiveStore
- Parameters:
archiveContents
- OpenMetadataArchive object
-
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 and initialize the maps assuming it is building a new archive. 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.- Specified by:
setArchiveProperties
in interfaceOpenMetadataArchiveBuilder
- 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).
-
addPrimitiveDef
Add a new PrimitiveDef to the archive.- Specified by:
addPrimitiveDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
primitiveDef
- type to add nulls are ignored
-
getPrimitiveDef
Retrieve a PrimitiveDef from the archive.- Specified by:
getPrimitiveDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
primitiveDefName
- primitive to retrieve- Returns:
- PrimitiveDef type
-
addCollectionDef
Add a new CollectionDef to the archive.- Specified by:
addCollectionDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
collectionDef
- type to add
-
getCollectionDef
Retrieve a CollectionDef from the archive.- Specified by:
getCollectionDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
collectionDefName
- type to retrieve- Returns:
- CollectionDef type
-
addEnumDef
Add a new EnumDef to the archive.- Specified by:
addEnumDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
enumDef
- type to add
-
getEnumDef
Get an existing EnumDef from the archive.- Specified by:
getEnumDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
enumDefName
- type to retrieve- Returns:
- EnumDef object
-
addClassificationDef
Add a new ClassificationDef to the archive.- Specified by:
addClassificationDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
classificationDef
- type to add
-
getClassificationDef
Retrieve the relationshipDef or null if it is not defined.- Specified by:
getClassificationDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
classificationDefName
- name of the classification- Returns:
- the retrieved classification def
-
addEntityDef
Add a new EntityDef to the archive.- Specified by:
addEntityDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
entityDef
- type to add
-
getEntityDef
Retrieve the entityDef or null if it is not defined.- Specified by:
getEntityDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
entityDefName
- name of the entity- Returns:
- the retrieved entity def
-
getRelationshipDef
Retrieve the relationshipDef or null if it is not defined.- Specified by:
getRelationshipDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
relationshipDefName
- name of the relationship- Returns:
- the retrieved relationship def
-
addRelationshipDef
Add a new RelationshipDef to the archive.- Specified by:
addRelationshipDef
in interfaceOpenMetadataArchiveBuilder
- Parameters:
relationshipDef
- type to add
-
getPatchForType
Create a skeleton patch for a TypeDefPatch.- Specified by:
getPatchForType
in interfaceOpenMetadataArchiveBuilder
- Parameters:
typeName
- name of type- Returns:
- TypeDefPatch
-
addTypeDefPatch
Add a new patch to the archive.- Specified by:
addTypeDefPatch
in interfaceOpenMetadataArchiveBuilder
- Parameters:
typeDefPatch
- patch
-
getTypeDefByName
Return the requested type definition if known.- Specified by:
getTypeDefByName
in interfaceOpenMetadataArchiveBuilder
- Parameters:
typeName
- name ot type- Returns:
- type definition
-
addEntity
Add a new entity to the archive.- Specified by:
addEntity
in interfaceOpenMetadataArchiveBuilder
- Parameters:
entity
- instance to add
-
getEntity
Retrieve an entity from the archive.- Specified by:
getEntity
in interfaceOpenMetadataArchiveBuilder
- Parameters:
guid
- unique identifier- Returns:
- requested entity
-
queryEntity
Retrieve an entity from the archive.- Specified by:
queryEntity
in interfaceOpenMetadataArchiveBuilder
- Parameters:
guid
- unique identifier- Returns:
- requested entity
-
addRelationship
Add a new relationship to the archive.- Specified by:
addRelationship
in interfaceOpenMetadataArchiveBuilder
- Parameters:
relationship
- instance to add
-
getRelationship
Retrieve a relationship from the archive.- Specified by:
getRelationship
in interfaceOpenMetadataArchiveBuilder
- Parameters:
guid
- unique identifier- Returns:
- requested relationship
-
queryRelationship
Retrieve a relationship from the archive.- Specified by:
queryRelationship
in interfaceOpenMetadataArchiveBuilder
- Parameters:
guid
- unique identifier- Returns:
- requested relationship
-
addClassification
Add a new classification to the archive.- Specified by:
addClassification
in interfaceOpenMetadataArchiveBuilder
- Parameters:
classification
- instance to add
-
getClassification
public ClassificationEntityExtension getClassification(String entityGUID, String classificationName) Retrieve a classification extension from the archive.- Specified by:
getClassification
in interfaceOpenMetadataArchiveBuilder
- Parameters:
entityGUID
- unique identifier of entityclassificationName
- name of the classification- Returns:
- requested classification extension
-
queryClassification
public ClassificationEntityExtension queryClassification(String entityGUID, String classificationName) Retrieve a classification extension from the archive.- Specified by:
queryClassification
in interfaceOpenMetadataArchiveBuilder
- Parameters:
entityGUID
- unique identifier of entityclassificationName
- name of the classification- Returns:
- requested classification extension
-
disconnect
Free up any resources held since the connector is no longer needed.- Overrides:
disconnect
in classConnectorBase
- Throws:
ConnectorCheckedException
- there is a problem within the connector.
-