Class DynamicArchiveService

All Implemented Interfaces:
RepositoryGovernanceService, AuditLoggingComponent, SecureConnectorExtension, 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.
  • Field Details

  • Constructor Details

    • DynamicArchiveService

      public DynamicArchiveService()
  • Method Details

    • start

      public void start() throws ConnectorCheckedException
      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 class RepositoryGovernanceServiceConnector
      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 class RepositoryGovernanceServiceConnector
      Parameters:
      methodName - calling method
      error - 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 class RepositoryGovernanceServiceConnector
      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 entity
      classificationName - name of the classification
      Returns:
      requested classification extension