Class DynamicArchiveService.ArchiveDestination
- java.lang.Object
-
- org.odpi.openmetadata.adapters.connectors.dynamicarchivers.DynamicArchiveService.ArchiveDestination
-
- All Implemented Interfaces:
OpenMetadataArchiveBuilder,OpenMetadataArchiveCache
- Enclosing class:
- DynamicArchiveService
protected class DynamicArchiveService.ArchiveDestination extends Object implements OpenMetadataArchiveBuilder, OpenMetadataArchiveCache
Details of one of the archive destination that this archive service is managing. It is able to support an archive that builds in memory and is written out in one go - or one that stores one element at a time.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedArchiveDestination(OpenMetadataArchiveStoreConnector store)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClassification(ClassificationEntityExtension classification)Add a new classification to the archive.voidaddClassificationDef(ClassificationDef classificationDef)Add a new ClassificationDef to the archive.voidaddCollectionDef(CollectionDef collectionDef)Add a new CollectionDef to the archive.voidaddEntity(EntityDetail entity)Add a new entity to the archive.voidaddEntityDef(EntityDef entityDef)Add a new EntityDef to the archive.voidaddEnumDef(EnumDef enumDef)Add a new EnumDef to the archive.voidaddPrimitiveDef(PrimitiveDef primitiveDef)Add a new PrimitiveDef to the archive.voidaddRelationship(Relationship relationship)Add a new relationship to the archive.voidaddRelationshipDef(RelationshipDef relationshipDef)Add a new RelationshipDef to the archive.voidaddTypeDefPatch(TypeDefPatch typeDefPatch)Add a new patch to the archive.OpenMetadataArchivePropertiesgetArchiveProperties()Return the archive properties as will appear in the archive.ClassificationEntityExtensiongetClassification(String entityGUID, String classificationName)Retrieve a classification extension from the archive.ClassificationDefgetClassificationDef(String classificationDef)Retrieve the relationshipDef or null if it is not defined.CollectionDefgetCollectionDef(String collectionDefName)Retrieve a CollectionDef from the archive.EntityDetailgetEntity(String guid)Retrieve an entity from the archive.EntityDefgetEntityDef(String entityDefName)Retrieve the entityDef or null if it is not defined.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.TypeDefPatchgetPatchForType(String typeName)Create a skeleton patch for a TypeDefPatch.PrimitiveDefgetPrimitiveDef(String primitiveDefName)Retrieve a PrimitiveDef from the archive.RelationshipgetRelationship(String guid)Retrieve a relationship from the archive.RelationshipDefgetRelationshipDef(String relationshipDefName)Retrieve the relationshipDef or null if it is not defined.TypeDefgetTypeDefByName(String typeName)Return the requested type definition if known.voidsetArchiveProperties(String archiveGUID, String archiveName, String archiveDescription, OpenMetadataArchiveType archiveType, String archiveVersion, String originatorName, String originatorLicense, Date creationDate, List<OpenMetadataArchive> dependsOnArchives)Set up archive header.
-
-
-
Constructor Detail
-
ArchiveDestination
protected ArchiveDestination(OpenMetadataArchiveStoreConnector store)
Simple constructor.- Parameters:
store- connector to the store
-
-
Method Detail
-
getOpenMetadataArchive
public OpenMetadataArchive getOpenMetadataArchive()
Once the content of the archive has been added to the archive builder, an archive object can be retrieved.- Specified by:
getOpenMetadataArchivein interfaceOpenMetadataArchiveCache- Returns:
- open metadata archive object with all of 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.- Specified by:
setArchivePropertiesin 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).
-
getArchiveProperties
public OpenMetadataArchiveProperties getArchiveProperties()
Return the archive properties as will appear in the archive. Null is returned if archive properties not set up.- Specified by:
getArchivePropertiesin interfaceOpenMetadataArchiveBuilder- Returns:
- property bean
-
addPrimitiveDef
public void addPrimitiveDef(PrimitiveDef primitiveDef)
Add a new PrimitiveDef to the archive.- Specified by:
addPrimitiveDefin interfaceOpenMetadataArchiveBuilder- Parameters:
primitiveDef- type to add nulls are ignored
-
getPrimitiveDef
public PrimitiveDef getPrimitiveDef(String primitiveDefName)
Retrieve a PrimitiveDef from the archive.- Specified by:
getPrimitiveDefin interfaceOpenMetadataArchiveBuilder- Parameters:
primitiveDefName- primitive to retrieve- Returns:
- PrimitiveDef type
-
addCollectionDef
public void addCollectionDef(CollectionDef collectionDef)
Add a new CollectionDef to the archive.- Specified by:
addCollectionDefin interfaceOpenMetadataArchiveBuilder- Parameters:
collectionDef- type to add
-
getCollectionDef
public CollectionDef getCollectionDef(String collectionDefName)
Retrieve a CollectionDef from the archive.- Specified by:
getCollectionDefin interfaceOpenMetadataArchiveBuilder- Parameters:
collectionDefName- type to retrieve- Returns:
- CollectionDef type
-
addEnumDef
public void addEnumDef(EnumDef enumDef)
Add a new EnumDef to the archive.- Specified by:
addEnumDefin interfaceOpenMetadataArchiveBuilder- Parameters:
enumDef- type to add
-
getEnumDef
public EnumDef getEnumDef(String enumDefName)
Get an existing EnumDef from the archive.- Specified by:
getEnumDefin interfaceOpenMetadataArchiveBuilder- Parameters:
enumDefName- type to retrieve- Returns:
- EnumDef object
-
addClassificationDef
public void addClassificationDef(ClassificationDef classificationDef)
Add a new ClassificationDef to the archive.- Specified by:
addClassificationDefin interfaceOpenMetadataArchiveBuilder- Parameters:
classificationDef- type to add
-
addEntityDef
public void addEntityDef(EntityDef entityDef)
Add a new EntityDef to the archive.- Specified by:
addEntityDefin interfaceOpenMetadataArchiveBuilder- Parameters:
entityDef- type to add
-
getEntityDef
public EntityDef getEntityDef(String entityDefName)
Retrieve the entityDef or null if it is not defined.- Specified by:
getEntityDefin interfaceOpenMetadataArchiveBuilder- Parameters:
entityDefName- name of the entity- Returns:
- the retrieved entity def
-
getRelationshipDef
public RelationshipDef getRelationshipDef(String relationshipDefName)
Retrieve the relationshipDef or null if it is not defined.- Specified by:
getRelationshipDefin interfaceOpenMetadataArchiveBuilder- Parameters:
relationshipDefName- name of the relationship- Returns:
- the retrieved relationship def
-
getClassificationDef
public ClassificationDef getClassificationDef(String classificationDef)
Retrieve the relationshipDef or null if it is not defined.- Specified by:
getClassificationDefin interfaceOpenMetadataArchiveBuilder- Parameters:
classificationDef- name of the classification- Returns:
- the retrieved classification def
-
addRelationshipDef
public void addRelationshipDef(RelationshipDef relationshipDef)
Add a new RelationshipDef to the archive.- Specified by:
addRelationshipDefin interfaceOpenMetadataArchiveBuilder- Parameters:
relationshipDef- type to add
-
getPatchForType
public TypeDefPatch getPatchForType(String typeName)
Create a skeleton patch for a TypeDefPatch.- Specified by:
getPatchForTypein interfaceOpenMetadataArchiveBuilder- Parameters:
typeName- name of type- Returns:
- TypeDefPatch
-
addTypeDefPatch
public void addTypeDefPatch(TypeDefPatch typeDefPatch)
Add a new patch to the archive.- Specified by:
addTypeDefPatchin interfaceOpenMetadataArchiveBuilder- Parameters:
typeDefPatch- patch
-
getTypeDefByName
public TypeDef getTypeDefByName(String typeName)
Return the requested type definition if known.- Specified by:
getTypeDefByNamein interfaceOpenMetadataArchiveBuilder- Parameters:
typeName- name ot type- Returns:
- type definition
-
addEntity
public void addEntity(EntityDetail entity)
Add a new entity to the archive.- Specified by:
addEntityin interfaceOpenMetadataArchiveBuilder- Parameters:
entity- instance to add
-
getEntity
public EntityDetail getEntity(String guid)
Retrieve an entity from the archive.- Specified by:
getEntityin interfaceOpenMetadataArchiveBuilder- Parameters:
guid- unique identifier- Returns:
- requested entity
-
addRelationship
public void addRelationship(Relationship relationship)
Add a new relationship to the archive.- Specified by:
addRelationshipin interfaceOpenMetadataArchiveBuilder- Parameters:
relationship- instance to add
-
getRelationship
public Relationship getRelationship(String guid)
Retrieve a relationship from the archive.- Specified by:
getRelationshipin interfaceOpenMetadataArchiveBuilder- Parameters:
guid- unique identifier- Returns:
- requested relationship
-
addClassification
public void addClassification(ClassificationEntityExtension classification)
Add a new classification to the archive.- Specified by:
addClassificationin interfaceOpenMetadataArchiveBuilder- Parameters:
classification- instance to add
-
getClassification
public ClassificationEntityExtension getClassification(String entityGUID, String classificationName)
Retrieve a classification extension from the archive.- Specified by:
getClassificationin interfaceOpenMetadataArchiveBuilder- Parameters:
entityGUID- unique identifier of entityclassificationName- name of the classification- Returns:
- requested classification extension
-
-