Class SimpleCatalogArchiveHelper

  • Direct Known Subclasses:
    GovernanceArchiveHelper

    public class SimpleCatalogArchiveHelper
    extends Object
    SimpleCatalogArchiveHelper creates elements used when creating a simple catalog. This includes assets, their schemas and connections.
    • Constructor Detail

      • SimpleCatalogArchiveHelper

        protected SimpleCatalogArchiveHelper​(OpenMetadataArchiveBuilder archiveBuilder,
                                             String archiveGUID,
                                             String archiveRootName,
                                             String originatorName,
                                             Date creationDate,
                                             long versionNumber,
                                             String versionName)
        Typical constructor passes parameters used to build the open metadata archive's property header.
        Parameters:
        archiveGUID - unique identifier for this open metadata archive.
        archiveRootName - non-spaced root name of the open metadata archive elements.
        originatorName - name of the originator (person or organization) of the archive.
        creationDate - data that this archive was created.
        versionNumber - version number of the archive.
        versionName - version name for the archive.
    • Method Detail

      • saveGUIDs

        public void saveGUIDs()
        Save the GUIDs so that the GUIDs of the elements inside the archive are consistent each time the archive runs.
      • addAsset

        public String addAsset​(String typeName,
                               String qualifiedName,
                               String displayName,
                               String description,
                               Map<String,​String> additionalProperties,
                               Map<String,​Object> extendedProperties)
        Create an asset entity.
        Parameters:
        typeName - name of asset subtype to use - default is Asset
        qualifiedName - unique name for the asset
        displayName - display name for the asset
        description - description about the asset
        additionalProperties - any other properties
        extendedProperties - additional properties defined in the sub type
        Returns:
        id for the asset
      • addSoftwareCapability

        public String addSoftwareCapability​(String typeName,
                                            String qualifiedName,
                                            String displayName,
                                            String description,
                                            String capabilityType,
                                            String capabilityVersion,
                                            String patchLevel,
                                            String source,
                                            Map<String,​String> additionalProperties,
                                            Map<String,​Object> extendedProperties)
        Create a software capability entity.
        Parameters:
        typeName - name of software capability subtype to use - default is SoftwareCapability
        qualifiedName - unique name for the capability
        displayName - display name for the capability
        description - description about the capability
        additionalProperties - any other properties.
        Returns:
        id for the capability
      • addConnectionForAsset

        public void addConnectionForAsset​(String assetGUID,
                                          String assetSummary,
                                          String connectionGUID)
        Create the relationship between an asset and its connection.
        Parameters:
        assetGUID - unique identifier of the asset
        assetSummary - summary of the asset from the connection perspective
        connectionGUID - unique identifier of the connection to its content
      • addDataContentForDataSet

        public void addDataContentForDataSet​(String dataContentGUID,
                                             String dataSetGUID)
        Create the relationship between a data set and an asset that is providing all or part of its content.
        Parameters:
        dataContentGUID - unique identifier of the data store
        dataSetGUID - unique identifier of the consuming data set
      • addTopLevelSchemaType

        public String addTopLevelSchemaType​(String assetGUID,
                                            String typeName,
                                            String qualifiedName,
                                            String displayName,
                                            String description,
                                            Map<String,​String> additionalProperties)
        Create the top level schema type for an asset.
        Parameters:
        assetGUID - unique identifier of asset
        typeName - name of asset subtype to use - default is SchemaType
        qualifiedName - unique name for the schema type
        displayName - display name for the schema type
        description - description about the schema type
        additionalProperties - any other properties
        Returns:
        id for the schemaType
      • addAPIOperation

        public String addAPIOperation​(String apiSchemaTypeGUID,
                                      String qualifiedName,
                                      String displayName,
                                      String description,
                                      String path,
                                      String command,
                                      Map<String,​String> additionalProperties)
        Create the schema type for an API operation.
        Parameters:
        apiSchemaTypeGUID - unique identifier of top level schemaType
        qualifiedName - unique name for the schema type
        displayName - display name for the schema type
        description - description about the schema type
        path - the path name for the operation
        command - the command to issue eg GET, POST
        additionalProperties - any other properties
        Returns:
        id for the schemaType
      • addAPIParameterList

        public String addAPIParameterList​(String apiOperationGUID,
                                          String relationshipTypeName,
                                          String qualifiedName,
                                          String displayName,
                                          String description,
                                          boolean required,
                                          Map<String,​String> additionalProperties)
        Create a parameter list schema type for an API operation.
        Parameters:
        apiOperationGUID - unique identifier of top level schemaType
        relationshipTypeName - name of relationship type - default is APIRequest
        qualifiedName - unique name for the schema type
        displayName - display name for the schema type
        description - description about the schema type
        required - is this parameter list required
        additionalProperties - any other properties
        Returns:
        id for the schemaType
      • addSchemaTypeOption

        public void addSchemaTypeOption​(String schemaTypeChoiceGUID,
                                        String schemaTypeOptionGUID)
        Create the relationship between a SchemaTypeChoice element and a child element using the SchemaTypeOption relationship.
        Parameters:
        schemaTypeChoiceGUID - unique identifier of the parent element
        schemaTypeOptionGUID - unique identifier of the child element
      • addAttributeForSchemaType

        public void addAttributeForSchemaType​(String schemaTypeGUID,
                                              String schemaAttributeGUID)
        Create the relationship between a SchemaType element and a child SchemaAttribute element using the AttributeForSchema relationship.
        Parameters:
        schemaTypeGUID - unique identifier of the parent element
        schemaAttributeGUID - unique identifier of the child element
      • addNestedSchemaAttribute

        public void addNestedSchemaAttribute​(String parentSchemaAttributeGUID,
                                             String childSchemaAttributeGUID)
        Create the relationship between a SchemaAttribute element and a child SchemaAttribute element using the NestedSchemaAttribute relationship.
        Parameters:
        parentSchemaAttributeGUID - unique identifier of the parent element
        childSchemaAttributeGUID - unique identifier of the child element
      • addSchemaAttribute

        public String addSchemaAttribute​(String typeName,
                                         String schemaTypeName,
                                         String qualifiedName,
                                         String displayName,
                                         String description,
                                         String dataType,
                                         int length,
                                         int position,
                                         Map<String,​String> additionalProperties)
        Create the a schema attribute with a TypeEmbeddedAttribute classification.
        Parameters:
        typeName - name of schema attribute subtype to use - default is SchemaAttribute
        schemaTypeName - name of schema type subtype to use - default is PrimitiveSchemaType
        qualifiedName - unique name for the schema attribute
        displayName - display name for the schema attribute
        description - description about the schema attribute
        dataType - data type for the schema attribute
        length - length of the storage used by the schema attribute
        position - position in the schema at this level
        additionalProperties - any other properties.
        Returns:
        id for the schema attribute
      • addConnection

        public String addConnection​(String qualifiedName,
                                    String displayName,
                                    String description,
                                    String userId,
                                    String clearPassword,
                                    String encryptedPassword,
                                    Map<String,​String> securedProperties,
                                    Map<String,​Object> configurationProperties,
                                    Map<String,​String> additionalProperties,
                                    String connectorTypeGUID,
                                    String endpointGUID)
        Create a connection entity.
        Parameters:
        qualifiedName - unique name for the connection
        displayName - display name for the connection
        description - description about the connection
        userId - userId that the connector should use to connect to the platform that hosts the asset.
        clearPassword - possible password for the connector
        encryptedPassword - possible password for the connector
        securedProperties - properties hidden from the client
        configurationProperties - properties used to configure the connector
        additionalProperties - any other properties.
        connectorTypeGUID - unique identifier for the connector type
        endpointGUID - unique identifier for the endpoint of the asset
        Returns:
        id for the connection
      • addConnectorType

        public String addConnectorType​(String connectorCategoryGUID,
                                       String connectorTypeGUID,
                                       String qualifiedName,
                                       String displayName,
                                       String description,
                                       String supportedAssetTypeName,
                                       String expectedDataFormat,
                                       String connectorProviderClassName,
                                       String connectorFrameworkName,
                                       String connectorInterfaceLanguage,
                                       List<String> connectorInterfaces,
                                       String targetTechnologySource,
                                       String targetTechnologyName,
                                       List<String> targetTechnologyInterfaces,
                                       List<String> targetTechnologyVersions,
                                       List<String> recognizedSecuredProperties,
                                       List<String> recognizedConfigurationProperties,
                                       List<String> recognizedAdditionalProperties,
                                       Map<String,​String> additionalProperties)
        Create a connector type entity.
        Parameters:
        connectorCategoryGUID - unique identifier of connector category - or null is not categorized
        connectorTypeGUID - fixed unique identifier for connector type - comes from the Connector Provider
        qualifiedName - unique name for the connector type
        displayName - display name for the connector type
        description - description about the connector type
        supportedAssetTypeName - type of asset supported by this connector
        expectedDataFormat - format of the data stored in the resource
        connectorProviderClassName - code for this type of connector
        connectorFrameworkName - name of the framework that the connector implements - default "Open Connector Framework (OCF)"
        connectorInterfaceLanguage - programming language of the connector's interface
        connectorInterfaces - the interfaces that the connector implements
        targetTechnologySource - organization implementing the target technology
        targetTechnologyName - name of the target technology
        targetTechnologyInterfaces - called interfaces the target technology
        targetTechnologyVersions - supported versions of the target technology
        recognizedSecuredProperties - names of supported properties hidden from the client - for connection object.
        recognizedConfigurationProperties - names of supported properties used to configure the connector - for connection object.
        recognizedAdditionalProperties - names of any other properties for connection object.
        additionalProperties - any other properties.
        Returns:
        id for the connector type
      • addConnectorType

        protected String addConnectorType​(String connectorCategoryGUID,
                                          String qualifiedName,
                                          String displayName,
                                          String description,
                                          String supportedAssetTypeName,
                                          String expectedDataFormat,
                                          String connectorProviderClassName,
                                          String connectorFrameworkName,
                                          String connectorInterfaceLanguage,
                                          List<String> connectorInterfaces,
                                          String targetTechnologySource,
                                          String targetTechnologyName,
                                          List<String> targetTechnologyInterfaces,
                                          List<String> targetTechnologyVersions,
                                          List<String> recognizedSecuredProperties,
                                          List<String> recognizedConfigurationProperties,
                                          List<String> recognizedAdditionalProperties,
                                          Map<String,​String> additionalProperties)
        Create a connector type entity.
        Parameters:
        connectorCategoryGUID - unique identifier of connector category - or null is not categorized
        qualifiedName - unique name for the connector type
        displayName - display name for the connector type
        description - description about the connector type
        supportedAssetTypeName - type of asset supported by this connector
        expectedDataFormat - format of the data stored in the resource
        connectorProviderClassName - code for this type of connector
        connectorFrameworkName - name of the framework that the connector implements - default "Open Connector Framework (OCF)"
        connectorInterfaceLanguage - programming language of the connector's interface
        connectorInterfaces - the interfaces that the connector implements
        targetTechnologySource - organization implementing the target technology
        targetTechnologyName - name of the target technology
        targetTechnologyInterfaces - called interfaces the target technology
        targetTechnologyVersions - supported versions of the target technology
        recognizedSecuredProperties - names of supported properties hidden from the client - for connection object.
        recognizedConfigurationProperties - names of supported properties used to configure the connector - for connection object.
        recognizedAdditionalProperties - names of any other properties for connection object.
        additionalProperties - any other properties.
        Returns:
        id for the connector type
      • addConnectorCategory

        protected String addConnectorCategory​(String connectorTypeDirectoryGUID,
                                              String qualifiedName,
                                              String displayName,
                                              String description,
                                              String targetTechnologySource,
                                              String targetTechnologyName,
                                              Map<String,​Boolean> recognizedSecuredProperties,
                                              Map<String,​Boolean> recognizedConfigurationProperties,
                                              Map<String,​Boolean> recognizedAdditionalProperties,
                                              Map<String,​String> additionalProperties)
        Create a connector category entity.
        Parameters:
        connectorTypeDirectoryGUID - unique identifier of connector type directory that this connector connector belongs to - or null for an independent connector category
        qualifiedName - unique name for the connector category
        displayName - display name for the connector category
        description - description about the connector category
        targetTechnologySource - organization implementing the target technology
        targetTechnologyName - name of the target technology
        recognizedSecuredProperties - names of supported properties hidden from the client - for connection object.
        recognizedConfigurationProperties - names of supported properties used to configure the connector - for connection object.
        recognizedAdditionalProperties - names of any other properties for connection object.
        additionalProperties - any other properties.
        Returns:
        id for the connector type
      • addConnectorTypeDirectory

        protected String addConnectorTypeDirectory​(String qualifiedName,
                                                   String displayName,
                                                   String description,
                                                   Map<String,​String> additionalProperties)
        Create a connector category entity.
        Parameters:
        qualifiedName - unique name for the connector type directory
        displayName - display name for the connector type directory
        description - description about the connector type directory
        additionalProperties - any other properties.
        Returns:
        id for the connector type
      • addEndpoint

        public String addEndpoint​(String qualifiedName,
                                  String displayName,
                                  String description,
                                  String networkAddress,
                                  String protocol,
                                  Map<String,​String> additionalProperties)
        Create a endpoint entity.
        Parameters:
        qualifiedName - unique name for the endpoint
        displayName - display name for the endpoint
        description - description about the endpoint
        networkAddress - location of the asset
        protocol - protocol to use to connect to the asset
        additionalProperties - any other properties.
        Returns:
        id for the endpoint
      • addGlossary

        public String addGlossary​(String qualifiedName,
                                  String displayName,
                                  String description,
                                  String language,
                                  String usage,
                                  String externalLink,
                                  String scope)
        Create a glossary entity. If the external link is specified, the glossary entity is linked to an ExternalGlossaryLink entity. If the scope is specified, the glossary entity is classified as a CanonicalGlossary.
        Parameters:
        qualifiedName - unique name for the glossary
        displayName - display name for the glossary
        description - description about the glossary
        language - language that the glossary is written in
        usage - how the glossary should be used
        externalLink - link to material
        scope - scope of the content.
        Returns:
        id for the glossary
      • addCategory

        public String addCategory​(String glossaryId,
                                  String qualifiedName,
                                  String displayName,
                                  String description,
                                  String subjectArea)
        Add a glossary category to the archive and connect it to glossary.
        Parameters:
        glossaryId - identifier of the glossary.
        qualifiedName - unique name for the category.
        displayName - display name for the category.
        description - description of the category.
        subjectArea - name of the subject area if this category contains terms for the subject area.
        Returns:
        identifier of the category
      • addTerm

        public String addTerm​(String glossaryId,
                              List<String> categoryIds,
                              String qualifiedName,
                              String displayName,
                              String description)
        Add a term and link it to the glossary and an arbitrary number of categories.
        Parameters:
        glossaryId - unique identifier of the glossary
        categoryIds - unique identifiers of the categories
        qualifiedName - unique name of the term
        displayName - display name of the term
        description - description of the term
        Returns:
        unique identifier of the term
      • addTerm

        public String addTerm​(String glossaryId,
                              List<String> categoryIds,
                              String qualifiedName,
                              String displayName,
                              String description,
                              String examples,
                              boolean isSpineObject,
                              boolean isSpineAttribute,
                              boolean categoriesAsNames)
        Add a term and link it to the glossary and an arbitrary number of categories.
        Parameters:
        glossaryId - unique identifier of the glossary
        categoryIds - unique identifiers of the categories
        qualifiedName - unique name of the term
        displayName - display name of the term
        description - description of the term
        examples - examples of the term
        isSpineObject - term is a spine object
        isSpineAttribute - term is a spine attribute
        categoriesAsNames - when true the categories are specified as qualified names, otherwise they are guids.
        Returns:
        unique identifier of the term
      • addCategoryToCategory

        public void addCategoryToCategory​(String parentCategoryId,
                                          String childCategoryId)
        Link two categories together as part of the parent child hierarchy.
        Parameters:
        parentCategoryId - unique identifier for the parent category
        childCategoryId - unique identifier for the child category
      • addMoreInformationLink

        public void addMoreInformationLink​(String describedElementId,
                                           String describerElementId)
        Create a navigation link from one referenceable to another to show they provide more information.
        Parameters:
        describedElementId - unique identifier for the element that is referencing the other.
        describerElementId - unique identifier for the element being pointed to.
      • linkTermToReferenceable

        public void linkTermToReferenceable​(String termId,
                                            String referenceableId)
        Create a semantic assignment between a term and a Referenceable - for example a model element.
        Parameters:
        termId - identifier of term
        referenceableId - identifier of referenceable
      • addIsATypeOfRelationship

        public void addIsATypeOfRelationship​(String specialTermQName,
                                             String generalizedTermQName)
        Add an is-a-type-of relationship
        Parameters:
        specialTermQName - qualified name of the specialized term
        generalizedTermQName - qualified name of the generalized term
      • addHasARelationship

        public void addHasARelationship​(String conceptQName,
                                        String propertyQName)
      • addRelatedTermRelationship

        public void addRelatedTermRelationship​(String conceptQName,
                                               String propertyQName)
      • addCategoryHierarchy

        public void addCategoryHierarchy​(String childCategoryName,
                                         Set<String> parentNames)
        Add Category hierarchy relationship
        Parameters:
        childCategoryName - name of the child category
        parentNames - set of the names of the parent categories qualified names