java.lang.Object
org.odpi.openmetadata.repositoryservices.connectors.stores.metadatacollectionstore.utilities.OMRSRepositoryPropertiesUtilities
org.odpi.openmetadata.repositoryservices.localrepository.repositorycontentmanager.OMRSRepositoryContentHelper
All Implemented Interfaces:
OMRSRepositoryHelper, OMRSRepositoryPropertiesHelper

public class OMRSRepositoryContentHelper extends OMRSRepositoryPropertiesUtilities implements OMRSRepositoryHelper
OMRSRepositoryContentHelper 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. OMRSRepositoryContentHelper'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.
  • Constructor Details

    • OMRSRepositoryContentHelper

      public OMRSRepositoryContentHelper(OMRSRepositoryContentManager repositoryContentManager)
      Creates a repository helper linked to the supplied repository content manager.
      Parameters:
      repositoryContentManager - object associated with the local repository.
  • Method Details

    • getActiveTypeDefGallery

      public TypeDefGallery getActiveTypeDefGallery()
      Return the list of typedefs active in the local repository.
      Specified by:
      getActiveTypeDefGallery in interface OMRSRepositoryHelper
      Returns:
      TypeDef gallery
    • getActiveTypeDefs

      public List<TypeDef> getActiveTypeDefs()
      Return the list of typeDefs active in the local repository.
      Specified by:
      getActiveTypeDefs in interface OMRSRepositoryHelper
      Returns:
      TypeDef list
    • getKnownTypeDefs

      public List<TypeDef> getKnownTypeDefs()
      Return the list of typeDefs known in the cohort.
      Specified by:
      getKnownTypeDefs in interface OMRSRepositoryHelper
      Returns:
      TypeDef list
    • getActiveAttributeTypeDefs

      public List<AttributeTypeDef> getActiveAttributeTypeDefs()
      Return the list of attributeTypeDefs active in the local repository.
      Specified by:
      getActiveAttributeTypeDefs in interface OMRSRepositoryHelper
      Returns:
      AttributeTypeDef list
    • getKnownAttributeTypeDefs

      public List<AttributeTypeDef> getKnownAttributeTypeDefs()
      Return the list of attributeTypeDefs active in the local repository.
      Specified by:
      getKnownAttributeTypeDefs in interface OMRSRepositoryHelper
      Returns:
      AttributeTypeDef list
    • getKnownTypeDefGallery

      public TypeDefGallery getKnownTypeDefGallery()
      Return the list of typedefs known by the local repository.
      Specified by:
      getKnownTypeDefGallery in interface OMRSRepositoryHelper
      Returns:
      TypeDef gallery
    • getUniqueProperties

      public 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.
      Specified by:
      getUniqueProperties in interface OMRSRepositoryHelper
      Parameters:
      sourceName - caller
      typeName - name of instance's type
      allProperties - all the instance's properties
      Returns:
      just the unique properties
    • getTypeDefByName

      public 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. It is looking specifically for types of the same name but with different content.
      Specified by:
      getTypeDefByName in interface OMRSRepositoryHelper
      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.
    • getSuperTypes

      public List<TypeDefLink> getSuperTypes(String sourceName, String typeDefName)
      Gets super types for given type name.
      Specified by:
      getSuperTypes in interface OMRSRepositoryHelper
      Parameters:
      sourceName - the source of the request (used for logging)
      typeDefName - unique name for the TypeDef
      Returns:
      the super types
    • getOtherEndName

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

      public EntityProxy getOtherEnd(String sourceName, String anchorEntityGUID, Relationship relationship)
      Return the entity proxy for the related entity.
      Specified by:
      getOtherEnd in interface OMRSRepositoryHelper
      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

      public 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. It is looking specifically for types of the same name but with different content.
      Specified by:
      getAttributeTypeDefByName in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getTypeDef in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getAttributeTypeDef in interface OMRSRepositoryHelper
      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

      public 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 metadata instance's type.
      Specified by:
      getTypeDef in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getAttributeTypeDef in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      addEnumPropertyToInstance in interface OMRSRepositoryHelper
      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
    • applyPatch

      public 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.
      Specified by:
      applyPatch in interface OMRSRepositoryHelper
      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
    • getSubTypesOf

      public List<String> getSubTypesOf(String sourceName, String superTypeName)
      Return the list of type names for all the subtypes of an entity type.
      Specified by:
      getSubTypesOf in interface OMRSRepositoryHelper
      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 known, or it has no subtypes)
    • getAllPropertiesForTypeDef

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

      public Set<String> getAllTypeDefsForProperty(String sourceName, String propertyName, String methodName)
      Return the names of all the type definitions that define the supplied property name.
      Specified by:
      getAllTypeDefsForProperty in interface OMRSRepositoryHelper
      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
    • isTypeOf

      public boolean isTypeOf(String sourceName, String actualTypeName, String expectedTypeName)
      Validate that the instance's type is of the expected/desired value. The actual instance may be a subtype of the expected type of course.
      Specified by:
      isTypeOf in interface OMRSRepositoryHelper
      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 actualTypeName results in false; a null in expectedType results in true)
    • registerMetadataCollection

      public 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.
      Specified by:
      registerMetadataCollection in interface OMRSRepositoryHelper
      Parameters:
      metadataCollectionId - unique identifier (guid) for the metadata collection.
      metadataCollectionName - display name for the metadata collection (can be null).
    • getMetadataCollectionName

      public String getMetadataCollectionName(String metadataCollectionId)
      Return the metadata collection name (or null) for a metadata collection id.
      Specified by:
      getMetadataCollectionName in interface OMRSRepositoryHelper
      Parameters:
      metadataCollectionId - unique identifier (guid) for the metadata collection.
      Returns:
      display name
    • getSkeletonEntity

      @Deprecated public 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 setup of the entity.
      Specified by:
      getSkeletonEntity in interface OMRSRepositoryHelper
      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

      public 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 setup of the entity.
      Specified by:
      getSkeletonEntity in interface OMRSRepositoryHelper
      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
      metadataCollectionName - unique name for the home metadata collection
      Returns:
      partially filled out entity needs classifications and properties
      Throws:
      TypeErrorException - the type name is not recognized.
    • getSkeletonEntitySummary

      @Deprecated public 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 setup of the entity.
      Specified by:
      getSkeletonEntitySummary in interface OMRSRepositoryHelper
      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

      public 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 setup of the entity.
      Specified by:
      getSkeletonEntitySummary in interface OMRSRepositoryHelper
      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

      public 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 setup of the classification.
      Specified by:
      getSkeletonClassification in interface OMRSRepositoryHelper
      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

      public 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 setup of the classification.
      Specified by:
      getSkeletonClassification in interface OMRSRepositoryHelper
      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
      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

      public 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 setup of the classification.
      Specified by:
      getSkeletonClassification in interface OMRSRepositoryHelper
      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

      public 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 setup of the relationship.
      Specified by:
      getSkeletonRelationship in interface OMRSRepositoryHelper
      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

      public 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 setup of the relationship.
      Specified by:
      getSkeletonRelationship in interface OMRSRepositoryHelper
      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

      public 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 setup of the relationship.
      Specified by:
      getNewInstanceType in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getNewEntity in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getNewEntity in interface OMRSRepositoryHelper
      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

      public Relationship getNewRelationship(String sourceName, String metadataCollectionId, InstanceProvenanceType provenanceType, String userName, String typeName, InstanceProperties properties) throws TypeErrorException
      Return a filled out relationship, caller just needs the entity proxies added.
      Specified by:
      getNewRelationship in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getNewRelationship in interface OMRSRepositoryHelper
      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

      public 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 setup of the classification.
      Specified by:
      getNewClassification in interface OMRSRepositoryHelper
      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 - source of the classification
      classificationOriginGUID - if the classification is propagated, this is the unique identifier of the entity where the classification originated. Otherwise, it is null
      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 public 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 setup 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".
      Specified by:
      getNewClassification in interface OMRSRepositoryHelper
      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.
      properties - properties for the classification
      classificationOrigin - source of the classification (assigned or propagated)
      classificationOriginGUID - unique identifier of element that originated the classification if propagated
      Returns:
      partially filled out classification needs properties and possibly origin information
      Throws:
      TypeErrorException - the type name is not recognized as a classification type.
    • getNewClassification

      public 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 setup of the classification.
      Specified by:
      getNewClassification in interface OMRSRepositoryHelper
      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.
    • checkEntityNotClassifiedEntity

      @Deprecated public void checkEntityNotClassifiedEntity(String sourceName, EntitySummary entity, String classificationName, String methodName) throws ClassificationErrorException
      Deprecated.
      Throws an exception if an entity is classified with the supplied classification name. It is typically used when adding new classifications to entities.
      Specified by:
      checkEntityNotClassifiedEntity in interface OMRSRepositoryHelper
      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
    • checkEntityNotClassifiedEntity

      public Classification checkEntityNotClassifiedEntity(String sourceName, EntitySummary entity, String classificationName, InstanceProperties classificationProperties, AuditLog auditLog, 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.
      Specified by:
      checkEntityNotClassifiedEntity in interface OMRSRepositoryHelper
      Parameters:
      sourceName - source of the request (used for logging)
      entity - entity to update
      classificationName - classification to retrieve
      classificationProperties - list of properties to set in the classification.
      auditLog - optional logging destination
      methodName - calling method
      Returns:
      duplicate classification
      Throws:
      ClassificationErrorException - the classification is not attached to the entity
    • addClassificationToList

      public List<Classification> addClassificationToList(String sourceName, List<Classification> classificationList, Classification newClassification, String methodName)
      Add a classification to an existing entity.
      Specified by:
      addClassificationToList in interface OMRSRepositoryHelper
      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

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

      public EntityProxy addClassificationToEntity(String sourceName, EntityProxy entity, Classification newClassification, String methodName)
      Add a classification to an existing entity proxy
      Specified by:
      addClassificationToEntity in interface OMRSRepositoryHelper
      Parameters:
      sourceName - source of the request (used for logging)
      entity - entity to update
      newClassification - classification to update
      methodName - calling method
      Returns:
      updated entity
    • getClassificationProperties

      public InstanceProperties getClassificationProperties(String sourceName, List<Classification> classifications, String classificationName, String methodName)
      Return the properties from a named classification or null if classification not present or without properties.
      Specified by:
      getClassificationProperties in interface OMRSRepositoryHelper
      Parameters:
      sourceName - source of the request (used for logging)
      classifications - list of classifications for an entity
      classificationName - classification to retrieve
      methodName - calling method
      Returns:
      located properties - or null if none
    • getClassificationFromEntity

      public Classification getClassificationFromEntity(String sourceName, EntitySummary entity, String classificationName, String methodName) throws ClassificationErrorException
      Return the named classification from an existing entity.
      Specified by:
      getClassificationFromEntity in interface OMRSRepositoryHelper
      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

      public List<Classification> getHomeClassificationsFromEntity(String sourceName, EntityDetail entity, String metadataCollectionId, String methodName)
      Return the classifications from the requested metadata collection. If the metadata collection is not set up in the header of the classification it is assumed that it is homed locally.
      Specified by:
      getHomeClassificationsFromEntity in interface OMRSRepositoryHelper
      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

      public EntityDetail updateClassificationInEntity(String sourceName, String userName, EntityDetail entity, Classification newClassification, String methodName)
      Replace an existing classification with a new one
      Specified by:
      updateClassificationInEntity in interface OMRSRepositoryHelper
      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
    • updateClassificationInEntity

      public EntityProxy updateClassificationInEntity(String sourceName, String userName, EntityProxy entity, Classification newClassification, String methodName)
      Replace an existing classification with a new one
      Specified by:
      updateClassificationInEntity in interface OMRSRepositoryHelper
      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

      public 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 setup of the oldClassification.
      Specified by:
      deleteClassificationFromEntity in interface OMRSRepositoryHelper
      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
    • deleteClassificationFromEntity

      public EntityProxy deleteClassificationFromEntity(String sourceName, EntityProxy 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 setup of the oldClassification.
      Specified by:
      deleteClassificationFromEntity in interface OMRSRepositoryHelper
      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

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

      public Relationship incrementVersion(String userId, InstanceAuditHeader originalInstance, Relationship updatedInstance)
      Changes the control information to reflect an update in an instance.
      Specified by:
      incrementVersion in interface OMRSRepositoryHelper
      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

      public Classification incrementVersion(String userId, InstanceAuditHeader originalInstance, Classification updatedInstance)
      Changes the control information to reflect an update in an instance.
      Specified by:
      incrementVersion in interface OMRSRepositoryHelper
      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

      public EntityDetail incrementVersion(String userId, InstanceAuditHeader originalInstance, EntityDetail updatedInstance)
      Changes the control information to reflect an update in an instance.
      Specified by:
      incrementVersion in interface OMRSRepositoryHelper
      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

      public EntityProxy getNewEntityProxy(String sourceName, EntityDetail entity) throws RepositoryErrorException
      Generate an entity proxy from an entity and its TypeDef.
      Specified by:
      getNewEntityProxy in interface OMRSRepositoryHelper
      Parameters:
      sourceName - source of the request (used for logging)
      entity - entity instance
      Returns:
      new entity proxy
      Throws:
      RepositoryErrorException - logic error in the repository corrupted entity
    • getNewEntityProxy

      public EntityProxy getNewEntityProxy(String sourceName, String metadataCollectionId, InstanceProvenanceType provenanceType, String userName, String typeName, InstanceProperties properties, List<Classification> classifications) throws TypeErrorException
      Return a filled out entity.
      Specified by:
      getNewEntityProxy in interface OMRSRepositoryHelper
      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 proxy
      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
    • relatedEntity

      public boolean relatedEntity(String sourceName, String entityGUID, Relationship relationship)
      Return boolean true if entity is linked by this relationship.
      Specified by:
      relatedEntity in interface OMRSRepositoryHelper
      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
    • getTypeName

      Returns the type name from an instance (entity, relationship or classification).
      Specified by:
      getTypeName in interface OMRSRepositoryHelper
      Parameters:
      instance - instance to read
      Returns:
      String type name
      Throws:
      InvalidParameterException - if the parameters are null or invalid
      RepositoryErrorException - if the instance does not have a type name
    • getEnd1EntityGUID

      public String getEnd1EntityGUID(Relationship relationship)
      Return the guid of an entity linked to end 1 of the relationship.
      Specified by:
      getEnd1EntityGUID in interface OMRSRepositoryHelper
      Parameters:
      relationship - relationship to parse
      Returns:
      String unique identifier
    • getEnd2EntityGUID

      public String getEnd2EntityGUID(Relationship relationship)
      Return the guid of an entity linked to end 2 of the relationship.
      Specified by:
      getEnd2EntityGUID in interface OMRSRepositoryHelper
      Parameters:
      relationship - relationship to parse
      Returns:
      String unique identifier
    • formatEntityResults

      public 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.
      Specified by:
      formatEntityResults in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      formatRelationshipResults in interface OMRSRepositoryHelper
      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

      public 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.
      Specified by:
      getExactMatchRegex in interface OMRSRepositoryHelper
      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:
    • getExactMatchRegex

      public 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.
      Specified by:
      getExactMatchRegex in interface OMRSRepositoryHelper
      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

      public 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).
      Specified by:
      isExactMatchRegex in interface OMRSRepositoryHelper
      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:
    • isExactMatchRegex

      public 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).
      Specified by:
      isExactMatchRegex in interface OMRSRepositoryHelper
      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:
    • getContainsRegex

      public 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.
      Specified by:
      getContainsRegex in interface OMRSRepositoryHelper
      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:
    • getContainsRegex

      public 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.
      Specified by:
      getContainsRegex in interface OMRSRepositoryHelper
      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

      public 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).
      Specified by:
      isContainsRegex in interface OMRSRepositoryHelper
      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:
    • isContainsRegex

      public 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).
      Specified by:
      isContainsRegex in interface OMRSRepositoryHelper
      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:
    • getStartsWithRegex

      public 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.
      Specified by:
      getStartsWithRegex in interface OMRSRepositoryHelper
      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:
    • getStartsWithRegex

      public 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.
      Specified by:
      getStartsWithRegex in interface OMRSRepositoryHelper
      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

      public 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).
      Specified by:
      isStartsWithRegex in interface OMRSRepositoryHelper
      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:
    • isStartsWithRegex

      public 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).
      Specified by:
      isStartsWithRegex in interface OMRSRepositoryHelper
      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:
    • getEndsWithRegex

      public 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.
      Specified by:
      getEndsWithRegex in interface OMRSRepositoryHelper
      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:
    • getEndsWithRegex

      public 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.
      Specified by:
      getEndsWithRegex in interface OMRSRepositoryHelper
      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

      public 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).
      Specified by:
      isEndsWithRegex in interface OMRSRepositoryHelper
      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:
    • isEndsWithRegex

      public 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).
      Specified by:
      isEndsWithRegex in interface OMRSRepositoryHelper
      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:
    • getUnqualifiedLiteralString

      public 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'.
      Specified by:
      getUnqualifiedLiteralString in interface OMRSRepositoryHelper
      Parameters:
      searchString - - the (potentially) wrapped and escaped string to un-escape and un-wrap
      Returns:
      the un-escaped, un-wrapped literal string
      See Also:
    • isCaseInsensitiveRegex

      public 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).
      Specified by:
      isCaseInsensitiveRegex in interface OMRSRepositoryHelper
      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:
    • getRelationshipDifferences

      public RelationshipDifferences getRelationshipDifferences(Relationship left, Relationship right, boolean ignoreModificationStamps)
      Calculate the differences between the two provided Relationship objects.
      Specified by:
      getRelationshipDifferences in interface OMRSRepositoryHelper
      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

      public EntityDetailDifferences getEntityDetailDifferences(EntityDetail left, EntityDetail right, boolean ignoreModificationStamps)
      Calculate the differences between the two provided EntityDetail objects.
      Specified by:
      getEntityDetailDifferences in interface OMRSRepositoryHelper
      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

      public EntityProxyDifferences getEntityProxyDifferences(EntityProxy left, EntityProxy right, boolean ignoreModificationStamps)
      Calculate the differences between the two provided EntityProxy objects.
      Specified by:
      getEntityProxyDifferences in interface OMRSRepositoryHelper
      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

      public EntitySummaryDifferences getEntitySummaryDifferences(EntitySummary left, EntitySummary right, boolean ignoreModificationStamps)
      Calculate the differences between the two provided EntitySummary objects.
      Specified by:
      getEntitySummaryDifferences in interface OMRSRepositoryHelper
      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

      public SearchClassifications getSearchClassificationsFromList(List<String> classificationNames)
      Convert the provided list of classification names into an equivalent SearchClassifications object.
      Specified by:
      getSearchClassificationsFromList in interface OMRSRepositoryHelper
      Parameters:
      classificationNames - list of classification names
      Returns:
      SearchClassifications