Interface OMRSRepositoryHelper

  • All Superinterfaces:
    OMRSRepositoryPropertiesHelper

    public interface OMRSRepositoryHelper
    extends OMRSRepositoryPropertiesHelper
    OMRSRepositoryHelper provides methods to repository connectors and repository event mappers to help them build valid type definitions (TypeDefs), entities and relationships. It is a facade to the repository content manager which holds an in memory cache of all the active TypeDefs in the local server. OMRSRepositoryHelper's purpose is to create an object that the repository connectors and event mappers can create, use and discard without needing to know how to connect to the repository content manager.
    • Method Detail

      • getActiveTypeDefGallery

        TypeDefGallery getActiveTypeDefGallery()
        Return the list of typeDefs and attributeTypeDefs active in the local repository.
        Returns:
        TypeDef gallery
      • getActiveTypeDefs

        List<TypeDef> getActiveTypeDefs()
        Return the list of typeDefs active in the local repository.
        Returns:
        TypeDef list
      • getActiveAttributeTypeDefs

        List<AttributeTypeDef> getActiveAttributeTypeDefs()
        Return the list of attributeTypeDefs active in the local repository.
        Returns:
        AttributeTypeDef list
      • getKnownTypeDefGallery

        TypeDefGallery getKnownTypeDefGallery()
        Return the list of types active in the connected cohorts.
        Returns:
        TypeDef gallery
      • getKnownTypeDefs

        List<TypeDef> getKnownTypeDefs()
        Return the list of typeDefs active in the connected cohorts.
        Returns:
        TypeDef list
      • getKnownAttributeTypeDefs

        List<AttributeTypeDef> getKnownAttributeTypeDefs()
        Return the list of attributeTypeDefs active in the connected cohorts.
        Returns:
        AttributeTypeDef list
      • getTypeDefByName

        TypeDef getTypeDefByName​(String sourceName,
                                 String typeDefName)
        Return the TypeDef identified by the name supplied by the caller. This is used in the connectors when validating the actual types of the repository with the known open metadata types looking specifically for types of the same name but with different content.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefName - unique name for the TypeDef
        Returns:
        TypeDef object or null if TypeDef is not known.
      • getUniqueProperties

        InstanceProperties getUniqueProperties​(String sourceName,
                                               String typeName,
                                               InstanceProperties allProperties)
        Return an instance properties that only contains the properties that uniquely identify the entity. This is used when creating entity proxies.
        Parameters:
        sourceName - caller
        typeName - name of instance's type
        allProperties - all of the instance's properties
        Returns:
        just the unique properties
      • getOtherEndName

        String getOtherEndName​(String sourceName,
                               String anchorEntityGUID,
                               Relationship relationship)
        Return the attribute name for the related entity.
        Parameters:
        sourceName - source of the request (used for logging)
        anchorEntityGUID - unique identifier of the anchor entity
        relationship - relationship to another entity
        Returns:
        proxy to the other entity.
      • getOtherEnd

        EntityProxy getOtherEnd​(String sourceName,
                                String anchorEntityGUID,
                                Relationship relationship)
        Return the entity proxy for the related entity.
        Parameters:
        sourceName - source of the request (used for logging)
        anchorEntityGUID - unique identifier of the anchor entity
        relationship - relationship to another entity
        Returns:
        proxy to the other entity.
      • getAttributeTypeDefByName

        AttributeTypeDef getAttributeTypeDefByName​(String sourceName,
                                                   String attributeTypeDefName)
        Return the AttributeTypeDef identified by the name supplied by the caller. This is used in the connectors when validating the actual types of the repository with the known open metadata types looking specifically for types of the same name but with different content.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDefName - unique name for the TypeDef
        Returns:
        AttributeTypeDef object or null if AttributeTypeDef is not known.
      • getTypeDef

        TypeDef getTypeDef​(String sourceName,
                           String parameterName,
                           String typeDefGUID,
                           String methodName)
                    throws TypeErrorException
        Return the TypeDef identified by the guid supplied by the caller. This call is used when retrieving a type that only the guid is known.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of guid parameter
        typeDefGUID - unique identifier for the TypeDef
        methodName - calling method
        Returns:
        TypeDef object
        Throws:
        TypeErrorException - unknown or invalid type
      • getAttributeTypeDef

        AttributeTypeDef getAttributeTypeDef​(String sourceName,
                                             String attributeTypeDefGUID,
                                             String methodName)
                                      throws TypeErrorException
        Return the AttributeTypeDef identified by the guid and name supplied by the caller. This call is used when retrieving a type that only the guid is known.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDefGUID - unique identifier for the AttributeTypeDef
        methodName - calling method
        Returns:
        TypeDef object
        Throws:
        TypeErrorException - unknown or invalid type
      • getTypeDef

        TypeDef getTypeDef​(String sourceName,
                           String guidParameterName,
                           String nameParameterName,
                           String typeDefGUID,
                           String typeDefName,
                           String methodName)
                    throws TypeErrorException
        Return the TypeDef identified by the guid and name supplied by the caller. This call is used when retrieving a type that should exist. For example, retrieving the type of a metadata instance.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of guid parameter
        nameParameterName - name of type name parameter
        typeDefGUID - unique identifier for the TypeDef
        typeDefName - unique name for the TypeDef
        methodName - calling method
        Returns:
        TypeDef object
        Throws:
        TypeErrorException - unknown or invalid type
      • getAttributeTypeDef

        AttributeTypeDef getAttributeTypeDef​(String sourceName,
                                             String attributeTypeDefGUID,
                                             String attributeTypeDefName,
                                             String methodName)
                                      throws TypeErrorException
        Return the AttributeTypeDef identified by the guid and name supplied by the caller. This call is used when retrieving a type that should exist. For example, retrieving the type definition of a metadata instance's property.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDefGUID - unique identifier for the AttributeTypeDef
        attributeTypeDefName - unique name for the AttributeTypeDef
        methodName - calling method
        Returns:
        TypeDef object
        Throws:
        TypeErrorException - unknown or invalid type
      • addEnumPropertyToInstance

        InstanceProperties addEnumPropertyToInstance​(String sourceName,
                                                     InstanceProperties properties,
                                                     String propertyName,
                                                     String enumTypeGUID,
                                                     String enumTypeName,
                                                     int ordinal,
                                                     String methodName)
                                              throws TypeErrorException
        Add the supplied property to an instance properties object. If the instance property object supplied is null, a new instance properties object is created.
        Parameters:
        sourceName - name of caller
        properties - properties object to add property to, may be null.
        propertyName - name of property
        enumTypeGUID - unique Id of Enum requested
        enumTypeName - unique name of enum requested
        ordinal - numeric value of property
        methodName - calling method name
        Returns:
        instance properties object.
        Throws:
        TypeErrorException - the enum type is not recognized
      • isTypeOf

        boolean isTypeOf​(String sourceName,
                         String actualTypeName,
                         String expectedTypeName)
        Validate that the type of an instance is of the expected/desired type. The actual instance may be a subtype of the expected type of course.
        Parameters:
        sourceName - source of the request (used for logging)
        actualTypeName - name of the entity type
        expectedTypeName - name of the expected type
        Returns:
        boolean if they match (a null in either results in false)
      • getSubTypesOf

        List<String> getSubTypesOf​(String sourceName,
                                   String superTypeName)
        Return the list of type names for all of the subtypes of an entity type.
        Parameters:
        sourceName - source of the request (used for logging)
        superTypeName - name of the super type - this value is not included in the result.
        Returns:
        list of type names (a null means the type is not know or it has no sub types)
      • getAllPropertiesForTypeDef

        List<TypeDefAttribute> getAllPropertiesForTypeDef​(String sourceName,
                                                          TypeDef typeDef,
                                                          String methodName)
        Return the names of all of the properties in the supplied TypeDef and all of its super-types.
        Parameters:
        sourceName - name of caller.
        typeDef - TypeDef to query.
        methodName - calling method.
        Returns:
        list of property names.
      • getAllTypeDefsForProperty

        Set<String> getAllTypeDefsForProperty​(String sourceName,
                                              String propertyName,
                                              String methodName)
        Return the names of all of the type definitions that define the supplied property name.
        Parameters:
        sourceName - name of the caller.
        propertyName - property name to query.
        methodName - calling method.
        Returns:
        set of names of the TypeDefs that define a property with this name
      • applyPatch

        TypeDef applyPatch​(String sourceName,
                           TypeDef originalTypeDef,
                           TypeDefPatch typeDefPatch)
                    throws InvalidParameterException,
                           PatchErrorException
        Returns an updated TypeDef that has had the supplied patch applied. It throws an exception if any part of the patch is incompatible with the original TypeDef. For example, if there is a mismatch between the type or version that either represents.
        Parameters:
        sourceName - source of the TypeDef (used for logging)
        originalTypeDef - typeDef to update
        typeDefPatch - patch to apply
        Returns:
        updated TypeDef
        Throws:
        InvalidParameterException - the original typeDef or typeDefPatch is null
        PatchErrorException - the patch is either badly formatted, or does not apply to the supplied TypeDef
      • registerMetadataCollection

        void registerMetadataCollection​(String metadataCollectionId,
                                        String metadataCollectionName)
        Remember the metadata collection name for this metadata collection Id. If the metadata collection id is null, it is ignored.
        Parameters:
        metadataCollectionId - unique identifier (guid) for the metadata collection.
        metadataCollectionName - display name for the metadata collection (can be null).
      • getMetadataCollectionName

        String getMetadataCollectionName​(String metadataCollectionId)
        Return the metadata collection name (or null) for a metadata collection id.
        Parameters:
        metadataCollectionId - unique identifier (guid) for the metadata collection.
        Returns:
        display name
      • getSkeletonEntity

        @Deprecated
        EntityDetail getSkeletonEntity​(String sourceName,
                                       String metadataCollectionId,
                                       InstanceProvenanceType provenanceType,
                                       String userName,
                                       String typeName)
                                throws TypeErrorException
        Deprecated.
        Return an entity with the header and type information filled out. The caller only needs to add properties and classifications to complete the set up of the entity.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        Returns:
        partially filled out entity needs classifications and properties
        Throws:
        TypeErrorException - the type name is not recognized.
      • getSkeletonEntity

        EntityDetail getSkeletonEntity​(String sourceName,
                                       String metadataCollectionId,
                                       String metadataCollectionName,
                                       InstanceProvenanceType provenanceType,
                                       String userName,
                                       String typeName)
                                throws TypeErrorException
        Return an entity with the header and type information filled out. The caller only needs to add properties and classifications to complete the set up of the entity.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        metadataCollectionName - unique name for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        Returns:
        partially filled out entity needs classifications and properties
        Throws:
        TypeErrorException - the type name is not recognized.
      • getSkeletonEntitySummary

        @Deprecated
        EntitySummary getSkeletonEntitySummary​(String sourceName,
                                               String metadataCollectionId,
                                               InstanceProvenanceType provenanceType,
                                               String userName,
                                               String typeName)
                                        throws TypeErrorException
        Deprecated.
        Return an entity with the header and type information filled out. The caller only needs to classifications to complete the set up of the entity.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        Returns:
        partially filled out entity needs classifications
        Throws:
        TypeErrorException - the type name is not recognized.
      • getSkeletonEntitySummary

        EntitySummary getSkeletonEntitySummary​(String sourceName,
                                               String metadataCollectionId,
                                               String metadataCollectionName,
                                               InstanceProvenanceType provenanceType,
                                               String userName,
                                               String typeName)
                                        throws TypeErrorException
        Return an entity with the header and type information filled out. The caller only needs to classifications to complete the set up of the entity.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        metadataCollectionName - unique name for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        Returns:
        partially filled out entity needs classifications
        Throws:
        TypeErrorException - the type name is not recognized.
      • getSkeletonClassification

        Classification getSkeletonClassification​(String sourceName,
                                                 String userName,
                                                 String classificationTypeName,
                                                 String entityTypeName)
                                          throws TypeErrorException
        Return a classification with the header and type information filled out. The caller only needs to add properties and possibility origin information if it is propagated to complete the set up of the classification.
        Parameters:
        sourceName - source of the request (used for logging)
        userName - name of the creator
        classificationTypeName - name of the classification type
        entityTypeName - name of the type for the entity that this classification is to be attached to.
        Returns:
        partially filled out classification needs properties and possibly origin information
        Throws:
        TypeErrorException - the type name is not recognized as a classification type.
      • getSkeletonClassification

        Classification getSkeletonClassification​(String sourceName,
                                                 String metadataCollectionId,
                                                 InstanceProvenanceType provenanceType,
                                                 String userName,
                                                 String classificationTypeName,
                                                 String entityTypeName)
                                          throws TypeErrorException
        Return a classification with the header and type information filled out. The caller only needs to add properties and possibility origin information if it is propagated to complete the set up of the classification.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - type of home for the new classification
        userName - name of the creator
        classificationTypeName - name of the classification type
        entityTypeName - name of the type for the entity that this classification is to be attached to.
        Returns:
        partially filled out classification needs properties and possibly origin information
        Throws:
        TypeErrorException - the type name is not recognized as a classification type.
      • getSkeletonClassification

        Classification getSkeletonClassification​(String sourceName,
                                                 String metadataCollectionId,
                                                 String metadataCollectionName,
                                                 InstanceProvenanceType provenanceType,
                                                 String userName,
                                                 String classificationTypeName,
                                                 String entityTypeName)
                                          throws TypeErrorException
        Return a classification with the header and type information filled out. The caller only needs to add properties and possibility origin information if it is propagated to complete the set up of the classification.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        metadataCollectionName - unique name for the home metadata collection
        provenanceType - type of home for the new classification
        userName - name of the creator
        classificationTypeName - name of the classification type
        entityTypeName - name of the type for the entity that this classification is to be attached to.
        Returns:
        partially filled out classification needs properties and possibly origin information
        Throws:
        TypeErrorException - the type name is not recognized as a classification type.
      • getSkeletonRelationship

        Relationship getSkeletonRelationship​(String sourceName,
                                             String metadataCollectionId,
                                             InstanceProvenanceType provenanceType,
                                             String userName,
                                             String typeName)
                                      throws TypeErrorException
        Return a relationship with the header and type information filled out. The caller only needs to add properties to complete the set up of the relationship.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin type of the relationship
        userName - name of the creator
        typeName - name of the relationship's type
        Returns:
        partially filled out relationship needs properties
        Throws:
        TypeErrorException - the type name is not recognized as a relationship type.
      • getSkeletonRelationship

        Relationship getSkeletonRelationship​(String sourceName,
                                             String metadataCollectionId,
                                             String metadataCollectionName,
                                             InstanceProvenanceType provenanceType,
                                             String userName,
                                             String typeName)
                                      throws TypeErrorException
        Return a relationship with the header and type information filled out. The caller only needs to add properties to complete the set up of the relationship.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        metadataCollectionName - unique name for the home metadata collection
        provenanceType - origin type of the relationship
        userName - name of the creator
        typeName - name of the relationship's type
        Returns:
        partially filled out relationship needs properties
        Throws:
        TypeErrorException - the type name is not recognized as a relationship type.
      • getNewInstanceType

        InstanceType getNewInstanceType​(String sourceName,
                                        TypeDefSummary typeDefSummary)
                                 throws TypeErrorException
        Return a relationship with the header and type information filled out. The caller only needs to add properties to complete the set up of the relationship.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefSummary - details of the new type
        Returns:
        instance type
        Throws:
        TypeErrorException - the type name is not recognized as a relationship type.
      • getNewEntity

        EntityDetail getNewEntity​(String sourceName,
                                  String metadataCollectionId,
                                  InstanceProvenanceType provenanceType,
                                  String userName,
                                  String typeName,
                                  InstanceProperties properties,
                                  List<Classification> classifications)
                           throws TypeErrorException
        Return a filled out entity. It just needs to add the classifications.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        properties - properties for the entity
        classifications - list of classifications for the entity
        Returns:
        an entity that is filled out
        Throws:
        TypeErrorException - the type name is not recognized as an entity type
      • getNewEntity

        EntityDetail getNewEntity​(String sourceName,
                                  String metadataCollectionId,
                                  String metadataCollectionName,
                                  InstanceProvenanceType provenanceType,
                                  String userName,
                                  String typeName,
                                  InstanceProperties properties,
                                  List<Classification> classifications)
                           throws TypeErrorException
        Return a filled out entity. It just needs to add the classifications.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionName - unique name for the home metadata collection
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        properties - properties for the entity
        classifications - list of classifications for the entity
        Returns:
        an entity that is filled out
        Throws:
        TypeErrorException - the type name is not recognized as an entity type
      • getNewRelationship

        Relationship getNewRelationship​(String sourceName,
                                        String metadataCollectionId,
                                        InstanceProvenanceType provenanceType,
                                        String userName,
                                        String typeName,
                                        InstanceProperties properties)
                                 throws TypeErrorException
        Return a filled out relationship which just needs the entity proxies added.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the relationship
        userName - name of the creator
        typeName - name of the type
        properties - properties for the relationship
        Returns:
        a relationship that is filled out
        Throws:
        TypeErrorException - the type name is not recognized as a relationship type
      • getNewRelationship

        Relationship getNewRelationship​(String sourceName,
                                        String metadataCollectionId,
                                        String metadataCollectionName,
                                        InstanceProvenanceType provenanceType,
                                        String userName,
                                        String typeName,
                                        InstanceProperties properties)
                                 throws TypeErrorException
        Return a filled out relationship which just needs the entity proxies added.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        metadataCollectionName - unique name for the home metadata collection
        provenanceType - origin of the relationship
        userName - name of the creator
        typeName - name of the type
        properties - properties for the relationship
        Returns:
        a relationship that is filled out
        Throws:
        TypeErrorException - the type name is not recognized as a relationship type
      • getNewClassification

        Classification getNewClassification​(String sourceName,
                                            String metadataCollectionId,
                                            InstanceProvenanceType provenanceType,
                                            String userName,
                                            String typeName,
                                            String entityTypeName,
                                            ClassificationOrigin classificationOrigin,
                                            String classificationOriginGUID,
                                            InstanceProperties properties)
                                     throws TypeErrorException
        Return a classification with the header and type information filled out. The caller only needs to add properties to complete the set up of the classification.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the classification
        userName - name of the creator
        typeName - name of the type
        entityTypeName - name of the type for the entity that this classification is to be attached to.
        classificationOrigin - is this explicitly assigned or propagated
        classificationOriginGUID - if propagated this the GUID of the origin
        properties - properties for the classification
        Returns:
        partially filled out classification needs properties and possibly origin information
        Throws:
        TypeErrorException - the type name is not recognized as a classification type.
      • getNewClassification

        Classification getNewClassification​(String sourceName,
                                            String metadataCollectionId,
                                            String metadataCollectionName,
                                            InstanceProvenanceType provenanceType,
                                            String userName,
                                            String typeName,
                                            String entityTypeName,
                                            ClassificationOrigin classificationOrigin,
                                            String classificationOriginGUID,
                                            InstanceProperties properties)
                                     throws TypeErrorException
        Return a classification with the header and type information filled out. The caller only needs to add properties to complete the set up of the classification.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        metadataCollectionName - unique name for the home metadata collection
        provenanceType - origin of the classification
        userName - name of the creator
        typeName - name of the type
        entityTypeName - name of the type for the entity that this classification is to be attached to.
        classificationOrigin - is this explicitly assigned or propagated
        classificationOriginGUID - if propagated this the GUID of the origin
        properties - properties for the classification
        Returns:
        partially filled out classification needs properties and possibly origin information
        Throws:
        TypeErrorException - the type name is not recognized as a classification type.
      • getNewClassification

        @Deprecated
        Classification getNewClassification​(String sourceName,
                                            String userName,
                                            String typeName,
                                            String entityTypeName,
                                            ClassificationOrigin classificationOrigin,
                                            String classificationOriginGUID,
                                            InstanceProperties properties)
                                     throws TypeErrorException
        Deprecated.
        Return a classification with the header and type information filled out. The caller only needs to add properties to complete the set up of the classification. This method is deprecated because it does not take the provenance information. The implementation of this method sets the provenance information to "LOCAL_COHORT".
        Parameters:
        sourceName - source of the request (used for logging)
        userName - name of the creator
        typeName - name of the type
        entityTypeName - name of the type for the entity that this classification is to be attached to
        classificationOrigin - source of the classification (assigned or propagated)
        classificationOriginGUID - unique identifier of element that originated the classification if propagated
        properties - properties for the classification
        Returns:
        partially filled out classification needs properties and possibly origin information
        Throws:
        TypeErrorException - the type name is not recognized as a classification type.
      • checkEntityNotClassifiedEntity

        void checkEntityNotClassifiedEntity​(String sourceName,
                                            EntitySummary entity,
                                            String classificationName,
                                            String methodName)
                                     throws ClassificationErrorException
        Throws an exception if an entity is classified with the supplied classification name. It is typically used when adding new classifications to entities.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to update
        classificationName - classification to retrieve
        methodName - calling method
        Throws:
        ClassificationErrorException - the classification is not attached to the entity
      • addClassificationToList

        List<Classification> addClassificationToList​(String sourceName,
                                                     List<Classification> classificationList,
                                                     Classification newClassification,
                                                     String methodName)
        Add a classification to an existing entity.
        Parameters:
        sourceName - source of the request (used for logging)
        classificationList - entity classifications to update
        newClassification - classification to add
        methodName - calling method
        Returns:
        updated entity
      • addClassificationToEntity

        EntityDetail addClassificationToEntity​(String sourceName,
                                               EntityDetail entity,
                                               Classification newClassification,
                                               String methodName)
        Add a classification to an existing entity.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to update
        newClassification - classification to update
        methodName - calling method
        Returns:
        updated entity
      • getClassificationFromEntity

        Classification getClassificationFromEntity​(String sourceName,
                                                   EntitySummary entity,
                                                   String classificationName,
                                                   String methodName)
                                            throws ClassificationErrorException
        Return the named classification from an existing entity and throws an exception if it is not.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to update
        classificationName - classification to retrieve
        methodName - calling method
        Returns:
        located classification
        Throws:
        ClassificationErrorException - the classification is not attached to the entity
      • getHomeClassificationsFromEntity

        List<Classification> getHomeClassificationsFromEntity​(String sourceName,
                                                              EntityDetail entity,
                                                              String metadataCollectionId,
                                                              String methodName)
        Return the classifications from the requested metadata collection. Not, this method does not cope with metadata collection ids of null.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to update
        metadataCollectionId - metadata collection to retrieve
        methodName - calling method
        Returns:
        located classification
      • updateClassificationInEntity

        EntityDetail updateClassificationInEntity​(String sourceName,
                                                  String userName,
                                                  EntityDetail entity,
                                                  Classification newClassification,
                                                  String methodName)
        Replace an existing classification with a new one
        Parameters:
        sourceName - source of the request (used for logging)
        userName - name of the editor
        entity - entity to update
        newClassification - classification to update
        methodName - calling method
        Returns:
        updated entity
      • deleteClassificationFromEntity

        EntityDetail deleteClassificationFromEntity​(String sourceName,
                                                    EntityDetail entity,
                                                    String oldClassificationName,
                                                    String methodName)
                                             throws ClassificationErrorException
        Return a oldClassification with the header and type information filled out. The caller only needs to add properties to complete the set up of the oldClassification.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to update
        oldClassificationName - classification to remove
        methodName - calling method
        Returns:
        updated entity
        Throws:
        ClassificationErrorException - the entity was not classified with this classification
      • mergeInstanceProperties

        InstanceProperties mergeInstanceProperties​(String sourceName,
                                                   InstanceProperties existingProperties,
                                                   InstanceProperties newProperties)
        Merge two sets of instance properties.
        Parameters:
        sourceName - source of the request (used for logging)
        existingProperties - current set of properties
        newProperties - properties to add/update
        Returns:
        merged properties
      • incrementVersion

        Relationship incrementVersion​(String userId,
                                      InstanceAuditHeader originalInstance,
                                      Relationship updatedInstance)
        Changes the control information to reflect an update in an instance.
        Parameters:
        userId - user making the change.
        originalInstance - original instance before the change
        updatedInstance - new version of the instance that needs updating
        Returns:
        updated instance
      • incrementVersion

        Classification incrementVersion​(String userId,
                                        InstanceAuditHeader originalInstance,
                                        Classification updatedInstance)
        Changes the control information to reflect an update in an instance.
        Parameters:
        userId - user making the change.
        originalInstance - original instance before the change
        updatedInstance - new version of the instance that needs updating
        Returns:
        updated instance
      • incrementVersion

        EntityDetail incrementVersion​(String userId,
                                      InstanceAuditHeader originalInstance,
                                      EntityDetail updatedInstance)
        Changes the control information to reflect an update in an instance.
        Parameters:
        userId - user making the change.
        originalInstance - original instance before the change
        updatedInstance - new version of the instance that needs updating
        Returns:
        updated instance
      • getNewEntityProxy

        EntityProxy getNewEntityProxy​(String sourceName,
                                      String metadataCollectionId,
                                      InstanceProvenanceType provenanceType,
                                      String userName,
                                      String typeName,
                                      InstanceProperties properties,
                                      List<Classification> classifications)
                               throws TypeErrorException
        Return a filled out entity proxy.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the home metadata collection
        provenanceType - origin of the entity
        userName - name of the creator
        typeName - name of the type
        properties - properties for the entity
        classifications - list of classifications for the entity
        Returns:
        an entity proxy that is filled out
        Throws:
        TypeErrorException - the type name is not recognized as an entity type
      • relatedEntity

        boolean relatedEntity​(String sourceName,
                              String entityGUID,
                              Relationship relationship)
        Return boolean true if entity is linked by this relationship.
        Parameters:
        sourceName - name of source requesting help
        entityGUID - unique identifier of entity
        relationship - relationship to test
        Returns:
        boolean indicating whether the entity is mentioned in the relationship
      • getEnd1EntityGUID

        String getEnd1EntityGUID​(Relationship relationship)
        Return the guid of an entity linked to end 1 of the relationship.
        Parameters:
        relationship - relationship to parse
        Returns:
        String unique identifier
      • getEnd2EntityGUID

        String getEnd2EntityGUID​(Relationship relationship)
        Return the guid of an entity linked to end 2 of the relationship.
        Parameters:
        relationship - relationship to parse
        Returns:
        String unique identifier
      • formatEntityResults

        List<EntityDetail> formatEntityResults​(List<EntityDetail> fullResults,
                                               int fromElement,
                                               String sequencingProperty,
                                               SequencingOrder sequencingOrder,
                                               int pageSize)
                                        throws PagingErrorException,
                                               PropertyErrorException
        Use the paging and sequencing parameters to format the results for a repository call that returns a list of entity instances.
        Parameters:
        fullResults - - the full list of results in an arbitrary order
        fromElement - - the starting element number of the instances to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.
        sequencingProperty - - String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).
        sequencingOrder - - Enum defining how the results should be ordered.
        pageSize - - the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.
        Returns:
        results array as requested
        Throws:
        PropertyErrorException - the sequencing property specified is not valid for any of the requested types of entity.
        PagingErrorException - the paging/sequencing parameters are set up incorrectly.
      • formatRelationshipResults

        List<Relationship> formatRelationshipResults​(List<Relationship> fullResults,
                                                     int fromElement,
                                                     String sequencingProperty,
                                                     SequencingOrder sequencingOrder,
                                                     int pageSize)
                                              throws PagingErrorException,
                                                     PropertyErrorException
        Use the paging and sequencing parameters to format the results for a repository call that returns a list of relationship instances.
        Parameters:
        fullResults - - the full list of results in an arbitrary order. This is supplied not empty.
        fromElement - - the starting element number of the instances to return. This is used when retrieving elements beyond the first page of results. Zero means start from the first element.
        sequencingProperty - - String name of the property that is to be used to sequence the results. Null means do not sequence on a property name (see SequencingOrder).
        sequencingOrder - - Enum defining how the results should be ordered.
        pageSize - - the maximum number of result entities that can be returned on this request. Zero means unrestricted return results size.
        Returns:
        results array as requested
        Throws:
        PropertyErrorException - the sequencing property specified is not valid for any of the requested types of relationship.
        PagingErrorException - the paging/sequencing parameters are set up incorrectly.
      • getExactMatchRegex

        String getExactMatchRegex​(String searchString)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, without being interpreted as a regular expression (i.e. the returned string will be interpreted as a literal -- used to find an exact match of the string, irrespective of whether it contains characters that may have special meanings to regular expressions). Note that usage of the string by methods that cannot handle regular expressions should first un-escape the string using the getUnqualifiedLiteralString helper method. Finally, note that this enforces a case-sensitive search.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression
        Returns:
        string that is interpreted literally rather than as a regular expression
        See Also:
        isExactMatchRegex(String), getUnqualifiedLiteralString(String), getExactMatchRegex(String, boolean)
      • getExactMatchRegex

        String getExactMatchRegex​(String searchString,
                                  boolean insensitive)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, without being interpreted as a regular expression (i.e. the returned string will be interpreted as a literal -- used to find an exact match of the string, irrespective of whether it contains characters that may have special meanings to regular expressions). Note that usage of the string by methods that cannot handle regular expressions should first un-escape the string using the getUnqualifiedLiteralString helper method.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression
        insensitive - set to true to have a case-insensitive exact match regular expression
        Returns:
        string that is interpreted literally rather than as a regular expression
        See Also:
        isExactMatchRegex(String), getUnqualifiedLiteralString(String)
      • isExactMatchRegex

        boolean isExactMatchRegex​(String searchString)
        Indicates whether the provided string should be treated as an exact match (true) or any other regular expression (false). Note that this method relies on the use of the getExactMatchRegex helper method having been used to qualify a string when it should be treated as a literal. That is, this method relies on the presence of the escape sequences used by Java's Pattern.quote() method. The method is not intended to work on all strings in general to arbitrarily detect whether they might be a regular expression or not. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted literally or as as a regular expression
        Returns:
        true if the provided string should be interpreted literally, false if it should be interpreted as a regex
        See Also:
        getExactMatchRegex(String), getUnqualifiedLiteralString(String)
      • isExactMatchRegex

        boolean isExactMatchRegex​(String searchString,
                                  boolean insensitive)
        Indicates whether the provided string should be treated as an exact match (true) or any other regular expression (false). Note that this method relies on the use of the getExactMatchRegex helper method having been used to qualify a string when it should be treated as a literal. That is, this method relies on the presence of the escape sequences used by Java's Pattern.quote() method. The method is not intended to work on all strings in general to arbitrarily detect whether they might be a regular expression or not. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted literally or as as a regular expression
        insensitive - when true, only return true if the string is a case-insensitive exact match regex; when false, only return true if the string is a case-sensitive exact match regex
        Returns:
        true if the provided string should be interpreted literally, false if it should be interpreted as a regex
        See Also:
        getExactMatchRegex(String, boolean), getUnqualifiedLiteralString(String)
      • getContainsRegex

        String getContainsRegex​(String searchString)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, to search for the string with a "contains" semantic. The passed string will NOT be treated as a regular expression; if you intend to use both a "contains" semantic and a regular expression within the string, simply construct your own regular expression directly (not with this helper method). Note that usage of the returned string by methods that cannot handle regular expressions should first un-escape the returned string using the getUnqualifiedLiteralString helper method. Finally, note that this enforces a case-sensitive search.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression, but also wrap to obtain a "contains" semantic
        Returns:
        string that is interpreted literally, wrapped for a "contains" semantic
        See Also:
        isContainsRegex(String), getUnqualifiedLiteralString(String), getContainsRegex(String, boolean)
      • getContainsRegex

        String getContainsRegex​(String searchString,
                                boolean insensitive)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, to search for the string with a "contains" semantic. The passed string will NOT be treated as a regular expression; if you intend to use both a "contains" semantic and a regular expression within the string, simply construct your own regular expression directly (not with this helper method). Note that usage of the returned string by methods that cannot handle regular expressions should first un-escape the returned string using the getUnqualifiedLiteralString helper method.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression, but also wrap to obtain a "contains" semantic
        insensitive - set to true to have a case-insensitive contains regular expression
        Returns:
        string that is interpreted literally, wrapped for a "contains" semantic
        See Also:
        isContainsRegex(String), getUnqualifiedLiteralString(String)
      • isContainsRegex

        boolean isContainsRegex​(String searchString)
        Indicates whether the provided string should be treated as a simple "contains" regular expression (true) or any other regular expression (false). Note that this method relies on the use of the getContainsRegex helper method having been used to qualify a string when it should be treated primarily as a literal with only very basic "contains" wrapping. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - - the string to check whether it should be interpreted as a simple "contains"
        Returns:
        true if the provided string should be interpreted as a simple "contains", false if it should be interpreted as a full regex
        See Also:
        getContainsRegex(String), getUnqualifiedLiteralString(String)
      • isContainsRegex

        boolean isContainsRegex​(String searchString,
                                boolean insensitive)
        Indicates whether the provided string should be treated as a simple "contains" regular expression (true) or any other regular expression (false). Note that this method relies on the use of the getContainsRegex helper method having been used to qualify a string when it should be treated primarily as a literal with only very basic "contains" wrapping. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted as a simple "contains"
        insensitive - when true, only return true if the string is a case-insensitive "contains" regex; when false, only return true if the string is a case-sensitive "contains" regex
        Returns:
        true if the provided string should be interpreted as a simple "contains", false if it should be interpreted as a full regex
        See Also:
        getContainsRegex(String, boolean), getUnqualifiedLiteralString(String)
      • getStartsWithRegex

        String getStartsWithRegex​(String searchString)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, to search for the string with a "startswith" semantic. The passed string will NOT be treated as a regular expression; if you intend to use both a "startswith" semantic and a regular expression within the string, simply construct your own regular expression directly (not with this helper method). Note that usage of the returned string by methods that cannot handle regular expressions should first un-escape the returned string using the getUnqualifiedLiteralString helper method. Finally, note that this enforces a case-sensitive search.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression, but also wrap to obtain a "startswith" semantic
        Returns:
        string that is interpreted literally, wrapped for a "startswith" semantic
        See Also:
        isStartsWithRegex(String), getUnqualifiedLiteralString(String), getStartsWithRegex(String, boolean)
      • getStartsWithRegex

        String getStartsWithRegex​(String searchString,
                                  boolean insensitive)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, to search for the string with a "startswith" semantic. The passed string will NOT be treated as a regular expression; if you intend to use both a "startswith" semantic and a regular expression within the string, simply construct your own regular expression directly (not with this helper method). Note that usage of the returned string by methods that cannot handle regular expressions should first un-escape the returned string using the getUnqualifiedLiteralString helper method.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression, but also wrap to obtain a "startswith" semantic
        insensitive - set to true to have a case-insensitive "startswith" regular expression
        Returns:
        string that is interpreted literally, wrapped for a "startswith" semantic
        See Also:
        isStartsWithRegex(String), getUnqualifiedLiteralString(String)
      • isStartsWithRegex

        boolean isStartsWithRegex​(String searchString)
        Indicates whether the provided string should be treated as a simple "startswith" regular expression (true) or any other regular expression (false). Note that this method relies on the use of the getStartsWithRegex helper method having been used to qualify a string when it should be treated primarily as a literal with only very basic "startswith" wrapping. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted as a simple "startswith"
        Returns:
        true if the provided string should be interpreted as a simple "startswith", false if it should be interpreted as a full regex
        See Also:
        getStartsWithRegex(String), getUnqualifiedLiteralString(String)
      • isStartsWithRegex

        boolean isStartsWithRegex​(String searchString,
                                  boolean insensitive)
        Indicates whether the provided string should be treated as a simple "startswith" regular expression (true) or any other regular expression (false). Note that this method relies on the use of the getStartsWithRegex helper method having been used to qualify a string when it should be treated primarily as a literal with only very basic "startswith" wrapping. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted as a simple "startswith"
        insensitive - when true, only return true if the string is a case-insensitive "startswith" regex; when false, only return true if the string is a case-sensitive "startswith" regex
        Returns:
        true if the provided string should be interpreted as a simple "startswith", false if it should be interpreted as a full regex
        See Also:
        getStartsWithRegex(String, boolean), getUnqualifiedLiteralString(String)
      • getEndsWithRegex

        String getEndsWithRegex​(String searchString)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, to search for the string with an "endswith" semantic. The passed string will NOT be treated as a regular expression; if you intend to use both a "endswith" semantic and a regular expression within the string, simply construct your own regular expression directly (not with this helper method). Note that usage of the returned string by methods that cannot handle regular expressions should first un-escape the returned string using the getUnqualifiedLiteralString helper method. Finally, note that this enforces a case-sensitive search.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression, but also wrap to obtain an "endswith" semantic
        Returns:
        string that is interpreted literally, wrapped for an "endswith" semantic
        See Also:
        isEndsWithRegex(String), getUnqualifiedLiteralString(String), getEndsWithRegex(String, boolean)
      • getEndsWithRegex

        String getEndsWithRegex​(String searchString,
                                boolean insensitive)
        Retrieve an escaped version of the provided string that can be passed to methods that expect regular expressions, to search for the string with an "endswith" semantic. The passed string will NOT be treated as a regular expression; if you intend to use both a "endswith" semantic and a regular expression within the string, simply construct your own regular expression directly (not with this helper method). Note that usage of the returned string by methods that cannot handle regular expressions should first un-escape the returned string using the getUnqualifiedLiteralString helper method.
        Parameters:
        searchString - the string to escape to avoid being interpreted as a regular expression, but also wrap to obtain an "endswith" semantic
        insensitive - set to true to have a case-insensitive "endswith" regular expression
        Returns:
        string that is interpreted literally, wrapped for an "endswith" semantic
        See Also:
        isEndsWithRegex(String), getUnqualifiedLiteralString(String)
      • isEndsWithRegex

        boolean isEndsWithRegex​(String searchString)
        Indicates whether the provided string should be treated as a simple "endswith" regular expression (true) or any other regular expression (false). Note that this method relies on the use of the getEndsWithRegex helper method having been used to qualify a string when it should be treated primarily as a literal with only very basic "endswith" wrapping. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted as a simple "endswith"
        Returns:
        true if the provided string should be interpreted as a simple "endswith", false if it should be interpreted as a full regex
        See Also:
        getEndsWithRegex(String), getUnqualifiedLiteralString(String)
      • isEndsWithRegex

        boolean isEndsWithRegex​(String searchString,
                                boolean insensitive)
        Indicates whether the provided string should be treated as a simple "endswith" regular expression (true) or any other regular expression (false). Note that this method relies on the use of the getEndsWithRegex helper method having been used to qualify a string when it should be treated primarily as a literal with only very basic "endswith" wrapping. Primarily a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted as a simple "endswith"
        insensitive - when true, only return true if the string is a case-insensitive "endswith" regex; when false, only return true if the string is a case-sensitive "endswith" regex
        Returns:
        true if the provided string should be interpreted as a simple "endswith", false if it should be interpreted as a full regex
        See Also:
        getEndsWithRegex(String, boolean), getUnqualifiedLiteralString(String)
      • getUnqualifiedLiteralString

        String getUnqualifiedLiteralString​(String searchString)
        Retrieve an unescaped version of the provided string that can be treated as a literal (not a regular expression). Primarily a helper method for methods that do not directly leverage regular expressions: so that they have a string they can treat as a literal without needing to un-escape the regex-meaningful characters injected by the various getXYZRegex helper methods. For example, this will translate the input of '.*\Qmy-search-string\E.*' into a return value of 'my-search-string'.
        Parameters:
        searchString - - the (potentially) wrapped and escaped string to un-escape and un-wrap
        Returns:
        the un-escaped, un-wrapped literal string
        See Also:
        getExactMatchRegex(String), getContainsRegex(String), getStartsWithRegex(String), getEndsWithRegex(String)
      • isCaseInsensitiveRegex

        boolean isCaseInsensitiveRegex​(String searchString)
        Indicates whether the provided string should be treated as a case-insensitive regular expression (true) or as a case-sensitive regular expression (false). Note that this method relies on the use of the getXYZRegex helper methods having been used to qualify a string with case-insensitivity. Primarily this is a helper method for methods that do not directly handle regular expressions (for those it should be possible to just directly use the string as-is and it will be correctly interpreted).
        Parameters:
        searchString - the string to check whether it should be interpreted as case-insensitive
        Returns:
        true if provided string should be interpreted as case-insensitive, false if it should be case-sensitive
        See Also:
        getExactMatchRegex(String, boolean), getStartsWithRegex(String, boolean), getEndsWithRegex(String, boolean), getContainsRegex(String, boolean)
      • getRelationshipDifferences

        RelationshipDifferences getRelationshipDifferences​(Relationship left,
                                                           Relationship right,
                                                           boolean ignoreModificationStamps)
        Calculate the differences between the two provided Relationship objects.
        Parameters:
        left - one of the Relationship objects to compare
        right - the other Relationship object to compare
        ignoreModificationStamps - true if we should ignore modification details (Version, UpdateTime, UpdatedBy) as differences, or false if we should include differences on these
        Returns:
        RelationshipDifferences
      • getEntityDetailDifferences

        EntityDetailDifferences getEntityDetailDifferences​(EntityDetail left,
                                                           EntityDetail right,
                                                           boolean ignoreModificationStamps)
        Calculate the differences between the two provided EntityDetail objects.
        Parameters:
        left - one of the EntityDetail objects to compare
        right - the other EntityDetail object to compare
        ignoreModificationStamps - true if we should ignore modification details (Version, UpdateTime, UpdatedBy) as differences, or false if we should include differences on these
        Returns:
        EntityDetailDifferences
      • getEntityProxyDifferences

        EntityProxyDifferences getEntityProxyDifferences​(EntityProxy left,
                                                         EntityProxy right,
                                                         boolean ignoreModificationStamps)
        Calculate the differences between the two provided EntityProxy objects.
        Parameters:
        left - one of the EntityProxy objects to compare
        right - the other EntityProxy object to compare
        ignoreModificationStamps - true if we should ignore modification details (Version, UpdateTime, UpdatedBy) as differences, or false if we should include differences on these
        Returns:
        EntityProxyDifferences
      • getEntitySummaryDifferences

        EntitySummaryDifferences getEntitySummaryDifferences​(EntitySummary left,
                                                             EntitySummary right,
                                                             boolean ignoreModificationStamps)
        Calculate the differences between the two provided EntitySummary objects.
        Parameters:
        left - one of the EntitySummary objects to compare
        right - the other EntitySummary object to compare
        ignoreModificationStamps - true if we should ignore modification details (Version, UpdateTime, UpdatedBy) as differences, or false if we should include differences on these
        Returns:
        EntitySummaryDifferences
      • getSearchClassificationsFromList

        SearchClassifications getSearchClassificationsFromList​(List<String> classificationNames)
        Convert the provided list of classification names into an equivalent SearchClassifications object.
        Parameters:
        classificationNames - list of classification names
        Returns:
        SearchClassifications