Interface OMRSRepositoryValidator


  • public interface OMRSRepositoryValidator
    OMRSRepositoryValidator provides methods to validate TypeDefs and Instances returned from an open metadata repository. It is typically used by OMRS repository connectors and repository event mappers.
    • Method Detail

      • validateEnterpriseTypeDefs

        void validateEnterpriseTypeDefs​(String sourceName,
                                        List<TypeDef> typeDefs,
                                        String methodName)
                                 throws RepositoryErrorException
        Return a boolean flag indicating whether the list of TypeDefs passed are compatible with the all known typedefs. A valid TypeDef is one that matches name, GUID and version to the full list of TypeDefs. If a new TypeDef is present, it is added to the enterprise list.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefs - list of TypeDefs.
        methodName - calling method
        Throws:
        RepositoryErrorException - a conflicting or invalid TypeDef has been returned
      • validateEnterpriseAttributeTypeDefs

        void validateEnterpriseAttributeTypeDefs​(String sourceName,
                                                 List<AttributeTypeDef> attributeTypeDefs,
                                                 String methodName)
                                          throws RepositoryErrorException
        Return a boolean flag indicating whether the list of TypeDefs passed are compatible with the all known typedefs. A valid TypeDef is one that matches name, GUID and version to the full list of TypeDefs. If a new TypeDef is present, it is added to the enterprise list.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDefs - list of AttributeTypeDefs.
        methodName - calling method
        Throws:
        RepositoryErrorException - a conflicting or invalid AttributeTypeDef has been returned
      • isActiveType

        boolean isActiveType​(String sourceName,
                             String typeGUID,
                             String typeName)
        Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the type
        typeName - unique name of the type
        Returns:
        boolean flag
      • isActiveTypeId

        boolean isActiveTypeId​(String sourceName,
                               String typeGUID)
        Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the type
        Returns:
        boolean flag
      • isOpenType

        boolean isOpenType​(String sourceName,
                           String typeGUID,
                           String typeName)
        Return boolean indicating whether the TypeDef is one of the open metadata types.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the type
        typeName - unique name of the type
        Returns:
        boolean flag
      • isOpenTypeId

        boolean isOpenTypeId​(String sourceName,
                             String typeGUID)
        Return boolean indicating whether the TypeDef is one of the open metadata types.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the type
        Returns:
        boolean flag
      • isKnownType

        boolean isKnownType​(String sourceName,
                            String typeGUID,
                            String typeName)
        Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the type
        typeName - unique name of the type
        Returns:
        boolean flag
      • isKnownTypeId

        boolean isKnownTypeId​(String sourceName,
                              String typeGUID)
        Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the type
        Returns:
        boolean flag
      • validTypeId

        boolean validTypeId​(String sourceName,
                            String typeGUID,
                            String typeName)
        Return boolean indicating whether the TypeDef identifiers are from a single known type or not.
        Parameters:
        sourceName - source of the request (used for logging)
        typeGUID - unique identifier of the TypeDef
        typeName - unique name of the TypeDef
        Returns:
        boolean result
      • validTypeDefId

        boolean validTypeDefId​(String sourceName,
                               String typeDefGUID,
                               String typeDefName,
                               TypeDefCategory category)
        Return boolean indicating whether the TypeDef identifiers are from a single known type or not.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefGUID - unique identifier of the TypeDef
        typeDefName - unique name of the TypeDef
        category - category for the TypeDef
        Returns:
        boolean result
      • validAttributeTypeDefId

        boolean validAttributeTypeDefId​(String sourceName,
                                        String attributeTypeDefGUID,
                                        String attributeTypeDefName,
                                        AttributeTypeDefCategory category)
        Return boolean indicating whether the AttributeTypeDef identifiers are from a single known type or not.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDefGUID - unique identifier of the AttributeTypeDef
        attributeTypeDefName - unique name of the AttributeTypeDef
        category - category for the AttributeTypeDef
        Returns:
        boolean result
      • validTypeDefId

        boolean validTypeDefId​(String sourceName,
                               String typeDefGUID,
                               String typeDefName,
                               String typeDefVersion,
                               TypeDefCategory category)
        Return boolean indicating whether the TypeDef identifiers are from a single known type or not.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefGUID - unique identifier of the TypeDef
        typeDefName - unique name of the TypeDef
        typeDefVersion - version of the type
        category - category for the TypeDef
        Returns:
        boolean result
      • validAttributeTypeDefId

        boolean validAttributeTypeDefId​(String sourceName,
                                        String attributeTypeDefGUID,
                                        String attributeTypeDefName,
                                        String attributeTypeDefVersion,
                                        AttributeTypeDefCategory category)
        Return boolean indicating whether the TypeDef identifiers are from a single known type or not.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDefGUID - unique identifier of the TypeDef
        attributeTypeDefName - unique name of the TypeDef
        attributeTypeDefVersion - version of the type
        category - category for the TypeDef
        Returns:
        boolean result
      • validTypeDef

        boolean validTypeDef​(String sourceName,
                             TypeDef typeDef)
        Return boolean indicating whether the supplied TypeDef is valid or not.
        Parameters:
        sourceName - source of the TypeDef (used for logging)
        typeDef - TypeDef to test
        Returns:
        boolean result
      • validAttributeTypeDef

        boolean validAttributeTypeDef​(String sourceName,
                                      AttributeTypeDef attributeTypeDef)
        Return boolean indicating whether the supplied AttributeTypeDef is valid or not.
        Parameters:
        sourceName - source of the request (used for logging)
        attributeTypeDef - TypeDef to test
        Returns:
        boolean result
      • validTypeDefSummary

        boolean validTypeDefSummary​(String sourceName,
                                    TypeDefSummary typeDefSummary)
        Return boolean indicating whether the supplied TypeDefSummary is valid or not.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefSummary - TypeDefSummary to test.
        Returns:
        boolean result.
      • validEntity

        boolean validEntity​(String sourceName,
                            EntitySummary entity)
        Test that the supplied entity is valid.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to test
        Returns:
        boolean result
      • validEntity

        boolean validEntity​(String sourceName,
                            EntityProxy entity)
        Test that the supplied entity is valid.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to test
        Returns:
        boolean result
      • validEntity

        boolean validEntity​(String sourceName,
                            EntityDetail entity)
        Test that the supplied entity is valid.
        Parameters:
        sourceName - source of the request (used for logging)
        entity - entity to test
        Returns:
        boolean result
      • validRelationship

        boolean validRelationship​(String sourceName,
                                  Relationship relationship)
        Test that the supplied relationship is valid.
        Parameters:
        sourceName - source of the request (used for logging)
        relationship - relationship to test
        Returns:
        boolean result
      • validInstanceId

        boolean validInstanceId​(String sourceName,
                                String typeDefGUID,
                                String typeDefName,
                                TypeDefCategory category,
                                String instanceGUID)
        Verify that the identifiers for an instance are correct.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefGUID - unique identifier for the type.
        typeDefName - unique name for the type.
        category - expected category of the instance.
        instanceGUID - unique identifier for the instance.
        Returns:
        boolean indicating whether the identifiers are ok.
      • validateUserId

        void validateUserId​(String sourceName,
                            String userId,
                            String methodName)
                     throws InvalidParameterException
        Validate that the supplied user Id is not null.
        Parameters:
        sourceName - name of source of request.
        userId - userId passed on call to this metadata collection.
        methodName - name of method requesting the validation.
        Throws:
        InvalidParameterException - the userId is invalid
      • validateTypeDefIds

        void validateTypeDefIds​(String sourceName,
                                String guidParameterName,
                                String nameParameterName,
                                String guid,
                                String name,
                                String methodName)
                         throws InvalidParameterException
        Validate that a TypeDef's identifiers are not null.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        nameParameterName - name of the parameter that passed the name.
        guid - unique identifier for a type or an instance passed on the request
        name - name of TypeDef.
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
      • getValidTypeDefFromIds

        TypeDef getValidTypeDefFromIds​(String sourceName,
                                       String guidParameterName,
                                       String nameParameterName,
                                       String guid,
                                       String name,
                                       String methodName)
                                throws InvalidParameterException
        Validate that a TypeDef's identifiers are not null and return the type.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        nameParameterName - name of the parameter that passed the name.
        guid - unique identifier for a type or an instance passed on the request
        name - name of TypeDef.
        methodName - method receiving the call
        Returns:
        retrieved type
        Throws:
        InvalidParameterException - no guid provided
      • validateAttributeTypeDefIds

        void validateAttributeTypeDefIds​(String sourceName,
                                         String guidParameterName,
                                         String nameParameterName,
                                         String guid,
                                         String name,
                                         String methodName)
                                  throws InvalidParameterException
        Validate that an AttributeTypeDef's identifiers are not null.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        nameParameterName - name of the parameter that passed the name.
        guid - unique identifier for a type or an instance passed on the request
        name - name of TypeDef.
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid, or name provided
      • getValidAttributeTypeDefFromIds

        AttributeTypeDef getValidAttributeTypeDefFromIds​(String sourceName,
                                                         String guidParameterName,
                                                         String nameParameterName,
                                                         String guid,
                                                         String name,
                                                         String methodName)
                                                  throws InvalidParameterException
        Validate that an AttributeTypeDef's identifiers are not null and are recognized and return the type.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        nameParameterName - name of the parameter that passed the name.
        guid - unique identifier for a type or an instance passed on the request
        name - name of TypeDef.
        methodName - method receiving the call
        Returns:
        retrieved type
        Throws:
        InvalidParameterException - no guid, or name provided
      • validateTypeGUID

        void validateTypeGUID​(String sourceName,
                              String guidParameterName,
                              String guid,
                              String methodName)
                       throws InvalidParameterException,
                              TypeErrorException
        Validate that type's identifier is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        guid - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
        TypeErrorException - guid is not for a recognized type
      • validateOptionalTypeGUID

        void validateOptionalTypeGUID​(String sourceName,
                                      String guidParameterName,
                                      String guid,
                                      String methodName)
                               throws TypeErrorException
        Validate that type's identifier is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        guid - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        TypeErrorException - unknown type guid
      • validateOptionalTypeGUIDs

        void validateOptionalTypeGUIDs​(String sourceName,
                                       String guidParameterName,
                                       String guid,
                                       String subtypeParameterName,
                                       List<String> subtypeGuids,
                                       String methodName)
                                throws TypeErrorException
        Validate that the types and subtypes (if specified) fit each other.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid
        guid - unique identifier for a type passed on the request
        subtypeParameterName - name of the parameter that passed a list of subtype guids
        subtypeGuids - list of unique identifiers for the subtypes passed on the request
        methodName - method receiving the call
        Throws:
        TypeErrorException - unknown type guid, or subtype guids that are not subtypes of the provided guid
      • validateInstanceTypeGUID

        void validateInstanceTypeGUID​(String sourceName,
                                      String guidParameterName,
                                      String guid,
                                      String methodName)
                               throws TypeErrorException
        Validate that if a type's identifier is passed then it is valid.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        guid - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        TypeErrorException - invalid type provided
      • validateTypeName

        void validateTypeName​(String sourceName,
                              String nameParameterName,
                              String name,
                              String methodName)
                       throws InvalidParameterException
        Validate that type's name is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        nameParameterName - name of the parameter that passed the name.
        name - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no name provided
      • validateTypeDefCategory

        void validateTypeDefCategory​(String sourceName,
                                     String nameParameterName,
                                     TypeDefCategory category,
                                     String methodName)
                              throws InvalidParameterException
        Validate that a TypeDef's category is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        nameParameterName - name of the parameter that passed the name.
        category - category of TypeDef
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no name provided
      • validateAttributeTypeDefCategory

        void validateAttributeTypeDefCategory​(String sourceName,
                                              String nameParameterName,
                                              AttributeTypeDefCategory category,
                                              String methodName)
                                       throws InvalidParameterException
        Validate that a AttributeTypeDef's category is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        nameParameterName - name of the parameter that passed the name.
        category - category of TypeDef
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no name provided
      • validateActiveType

        void validateActiveType​(String sourceName,
                                String typeParameterName,
                                TypeDefSummary typeDefSummary,
                                TypeDefCategory category,
                                String methodName)
                         throws TypeErrorException,
                                InvalidParameterException
        Validate that the supplied type is a valid active type.
        Parameters:
        sourceName - source of the request (used for logging)
        typeParameterName - the name of the parameter that passed the type
        typeDefSummary - the type to test
        category - the expected category of the type
        methodName - the name of the method that supplied the type
        Throws:
        InvalidParameterException - the type is null or contains invalid values
        TypeErrorException - the type is not active
      • validateKnownTypeDef

        void validateKnownTypeDef​(String sourceName,
                                  String parameterName,
                                  TypeDef typeDef,
                                  String methodName)
                           throws TypeDefNotKnownException
        Validate the content of a new TypeDef is known.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the typeDef.
        typeDef - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        TypeDefNotKnownException - no recognized typeDef provided
      • validateUnknownTypeDef

        void validateUnknownTypeDef​(String sourceName,
                                    String parameterName,
                                    TypeDef typeDef,
                                    String methodName)
                             throws TypeDefKnownException,
                                    TypeDefConflictException
        Validate the content of a new TypeDef is known.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the typeDef.
        typeDef - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        TypeDefKnownException - the TypeDef is already defined
        TypeDefConflictException - the TypeDef is already defined but differently
      • validateUnknownAttributeTypeDef

        void validateUnknownAttributeTypeDef​(String sourceName,
                                             String parameterName,
                                             AttributeTypeDef attributeTypeDef,
                                             String methodName)
                                      throws TypeDefKnownException,
                                             TypeDefConflictException
        Validate the content of a new TypeDef is known.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the typeDef.
        attributeTypeDef - unique identifier for an attribute type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        TypeDefKnownException - the TypeDef is already defined
        TypeDefConflictException - the TypeDef is already defined but differently
      • validateTypeDefForInstance

        void validateTypeDefForInstance​(String sourceName,
                                        String parameterName,
                                        TypeDef typeDef,
                                        String methodName)
                                 throws TypeErrorException,
                                        RepositoryErrorException
        Validate the content of a TypeDef associated with a metadata instance.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the typeDef.
        typeDef - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        TypeErrorException - no typeDef provided
        RepositoryErrorException - the TypeDef from the repository is in error.
      • validateTypeForInstanceDelete

        void validateTypeForInstanceDelete​(String sourceName,
                                           String typeDefGUID,
                                           String typeDefName,
                                           InstanceHeader instance,
                                           String methodName)
                                    throws InvalidParameterException,
                                           RepositoryErrorException
        Validate that the supplied TypeDef GUID and name matches the type associated with a metadata instance.
        Parameters:
        sourceName - source of the request (used for logging)
        typeDefGUID - the supplied typeDef GUID.
        typeDefName - the supplied typeDef name.
        instance - instance retrieved from the store with the supplied instance guid
        methodName - method making this call
        Throws:
        InvalidParameterException - incompatibility detected between the TypeDef and the instance's type
        RepositoryErrorException - the instance from the repository is in error.
      • validateTypeDefGallery

        void validateTypeDefGallery​(String sourceName,
                                    String parameterName,
                                    TypeDefGallery gallery,
                                    String methodName)
                             throws InvalidParameterException
        Validate that type's name is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the name.
        gallery - typeDef gallery
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no name provided
      • validateExternalId

        void validateExternalId​(String sourceName,
                                String standard,
                                String organization,
                                String identifier,
                                String methodName)
                         throws InvalidParameterException
        Validate that the type's name is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        standard - name of the standard null means any.
        organization - name of the organization null means any.
        identifier - identifier of the element in the standard null means any.
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no name provided
      • validateGUID

        void validateGUID​(String sourceName,
                          String guidParameterName,
                          String guid,
                          String methodName)
                   throws InvalidParameterException
        Validate that an entity's identifier is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        guid - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
      • validateHomeMetadataGUID

        void validateHomeMetadataGUID​(String sourceName,
                                      String guidParameterName,
                                      String guid,
                                      String methodName)
                               throws InvalidParameterException
        Validate that a home metadata collection identifier is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        guidParameterName - name of the parameter that passed the guid.
        guid - unique identifier for a type or an instance passed on the request
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
      • validateHomeMetadataGUID

        void validateHomeMetadataGUID​(String sourceName,
                                      InstanceHeader instance,
                                      String methodName)
                               throws RepositoryErrorException
        Validate that a home metadata collection identifier in an instance is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance to test.
        methodName - method receiving the call
        Throws:
        RepositoryErrorException - no guid provided
      • validateHomeMetadataGUID

        void validateHomeMetadataGUID​(String sourceName,
                                      Classification classification,
                                      String methodName)
                               throws RepositoryErrorException
        Validate that a home metadata collection identifier in an classification is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        classification - classification to test.
        methodName - method receiving the call
        Throws:
        RepositoryErrorException - no guid provided
      • validateAsOfTime

        void validateAsOfTime​(String sourceName,
                              String parameterName,
                              Date asOfTime,
                              String methodName)
                       throws InvalidParameterException
        Validate that the asOfTime parameter is not for the future.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the guid.
        asOfTime - unique name for a classification type
        methodName - method receiving the call
        Throws:
        InvalidParameterException - asOfTime is for the future
      • validateAsOfTimeNotNull

        void validateAsOfTimeNotNull​(String sourceName,
                                     String parameterName,
                                     Date asOfTime,
                                     String methodName)
                              throws InvalidParameterException
        Validate that the asOfTime parameter is not null or for the future.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the guid.
        asOfTime - unique name for a classification type
        methodName - method receiving the call
        Throws:
        InvalidParameterException - asOfTime is for the future
      • validateDateRange

        void validateDateRange​(String sourceName,
                               String parameterName,
                               Date fromTime,
                               Date toTime,
                               String methodName)
                        throws InvalidParameterException
        Validate that the time parameters are not inverted ('from' later than 'to').
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the guid.
        fromTime - the earliest point in time from which to retrieve historical versions of the instance (inclusive)
        toTime - the latest point in time from which to retrieve historical versions of the instance (exclusive)
        methodName - method receiving the call
        Throws:
        InvalidParameterException - 'fromTime' is later than 'toTime'
      • validatePageSize

        void validatePageSize​(String sourceName,
                              String parameterName,
                              int pageSize,
                              String methodName)
                       throws PagingErrorException
        Validate that a page size parameter is not negative.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the guid.
        pageSize - number of elements to return on a request
        methodName - method receiving the call
        Throws:
        PagingErrorException - pageSize is negative
      • validateClassificationName

        TypeDef validateClassificationName​(String sourceName,
                                           String parameterName,
                                           String classificationName,
                                           String methodName)
                                    throws InvalidParameterException
        Validate that a classification name is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the guid.
        classificationName - unique name for a classification type
        methodName - method receiving the call
        Returns:
        type definition for the classification
        Throws:
        InvalidParameterException - classification name is null or invalid
      • validateClassificationProperties

        void validateClassificationProperties​(String sourceName,
                                              String classificationName,
                                              String propertiesParameterName,
                                              InstanceProperties classificationProperties,
                                              String methodName)
                                       throws PropertyErrorException
        Validate that a classification is valid for the entity.
        Parameters:
        sourceName - source of the request (used for logging)
        classificationName - unique name for a classification type
        propertiesParameterName - name of the parameter that passed the properties.
        classificationProperties - properties to test
        methodName - method receiving the call
        Throws:
        PropertyErrorException - classification name is null
      • validateClassification

        void validateClassification​(String sourceName,
                                    String classificationParameterName,
                                    String classificationName,
                                    String entityTypeName,
                                    String methodName)
                             throws InvalidParameterException,
                                    ClassificationErrorException
        Validate that a classification is valid for the entity.
        Parameters:
        sourceName - source of the request (used for logging)
        classificationParameterName - name of the parameter that passed the guid.
        classificationName - unique name for a classification type
        entityTypeName - name of entity type
        methodName - method receiving the call
        Throws:
        InvalidParameterException - classification name is null
        ClassificationErrorException - the classification is invalid for this entity
      • validateMatchCriteria

        void validateMatchCriteria​(String sourceName,
                                   String parameterName,
                                   TypeDefProperties matchCriteria,
                                   String methodName)
                            throws InvalidParameterException
        Validate that a TypeDef match criteria set of properties is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the match criteria.
        matchCriteria - match criteria properties
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
      • validateMatchCriteria

        void validateMatchCriteria​(String sourceName,
                                   String matchCriteriaParameterName,
                                   String matchPropertiesParameterName,
                                   MatchCriteria matchCriteria,
                                   InstanceProperties matchProperties,
                                   String methodName)
                            throws InvalidParameterException
        Validate that a metadata instance match criteria and set of properties are either both null or both not null.
        Parameters:
        sourceName - source of the request (used for logging)
        matchCriteriaParameterName - name of the parameter that passed the match criteria.
        matchPropertiesParameterName - name of the parameter that passed the match criteria.
        matchCriteria - match criteria enum
        matchProperties - match properties
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
      • validateSearchCriteria

        void validateSearchCriteria​(String sourceName,
                                    String parameterName,
                                    String searchCriteria,
                                    String methodName)
                             throws InvalidParameterException
        Validate that a search criteria is not null.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the search criteria.
        searchCriteria - match criteria properties
        methodName - method receiving the call
        Throws:
        InvalidParameterException - no guid provided
      • validateSearchProperties

        void validateSearchProperties​(String sourceName,
                                      String parameterName,
                                      SearchProperties matchProperties,
                                      String methodName)
                               throws InvalidParameterException
        Validate the property-based search conditions.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the property-based conditions
        matchProperties - property-based conditions
        methodName - method receiving the call
        Throws:
        InvalidParameterException - property-based conditions are invalid
      • validateSearchClassifications

        void validateSearchClassifications​(String sourceName,
                                           String parameterName,
                                           SearchClassifications matchClassifications,
                                           String methodName)
                                    throws InvalidParameterException
        Validate the classification-based search conditions.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the parameter that passed the classification-based conditions
        matchClassifications - classification-based conditions
        methodName - method receiving the call
        Throws:
        InvalidParameterException - classification-based conditions are invalid
      • validatePropertiesForType

        void validatePropertiesForType​(String sourceName,
                                       String parameterName,
                                       TypeDef typeDef,
                                       InstanceProperties properties,
                                       String methodName)
                                throws PropertyErrorException
        Validate that the properties for a metadata instance match its TypeDef.
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the properties parameter.
        typeDef - type information to validate against.
        properties - proposed properties for instance.
        methodName - method receiving the call.
        Throws:
        PropertyErrorException - invalid property
      • validateNewPropertiesForType

        void validateNewPropertiesForType​(String sourceName,
                                          String parameterName,
                                          TypeDef typeDef,
                                          InstanceProperties properties,
                                          String methodName)
                                   throws PropertyErrorException
        Validate that the properties for a metadata instance match its TypeDef
        Parameters:
        sourceName - source of the request (used for logging)
        parameterName - name of the properties parameter.
        typeDef - type information to validate against.
        properties - proposed properties
        methodName - method receiving the call
        Throws:
        PropertyErrorException - invalid property
      • verifyInstanceType

        boolean verifyInstanceType​(String sourceName,
                                   String instanceTypeGUID,
                                   InstanceHeader instance)
        Verify whether the instance passed to this method is of the type indicated by the type guid. A null type guid matches all instances (ie result is true). A null instance returns false.
        Parameters:
        sourceName - name of caller.
        instanceTypeGUID - unique identifier of the type (or null).
        instance - instance to test.
        Returns:
        boolean
      • verifyInstanceType

        boolean verifyInstanceType​(String sourceName,
                                   String instanceTypeGUID,
                                   List<String> subtypeGUIDs,
                                   InstanceHeader instance)
        Verify whether the instance passed to this method is of the type indicated by the type guid and restricted by the list of subtype guids. A null type guid matches all instances (ie result is true). A null instance returns false.
        Parameters:
        sourceName - name of caller.
        instanceTypeGUID - unique identifier of the type (or null).
        subtypeGUIDs - list of unique identifiers of the subtypes to include (or null).
        instance - instance to test.
        Returns:
        boolean
      • validateInstanceType

        void validateInstanceType​(String sourceName,
                                  InstanceHeader instance)
                           throws RepositoryErrorException
        Verify that the instance retrieved from the repository has a valid instance type.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - the retrieved instance
        Throws:
        RepositoryErrorException - logic error in the repository corrupted instance
      • verifyInstanceHasRightStatus

        boolean verifyInstanceHasRightStatus​(List<InstanceStatus> validStatuses,
                                             InstanceHeader instance)
        Verify that the supplied instance is in one of the supplied statuses. Note that if the supplied statuses are null, then only statuses that are not DELETE are considered valid.
        Parameters:
        validStatuses - list of statuses the instance should be in any one of them
        instance - instance to test
        Returns:
        boolean result
      • validateInstanceStatus

        void validateInstanceStatus​(String sourceName,
                                    String instanceStatusParameterName,
                                    InstanceStatus instanceStatus,
                                    TypeDef typeDef,
                                    String methodName)
                             throws StatusNotSupportedException
        Validates an instance status where null is permissible.
        Parameters:
        sourceName - source of the request (used for logging)
        instanceStatusParameterName - name of the initial status parameter
        instanceStatus - initial status value
        typeDef - type of the instance
        methodName - method called
        Throws:
        StatusNotSupportedException - the initial status is invalid for this type
      • validateInstanceStatusForDelete

        void validateInstanceStatusForDelete​(String sourceName,
                                             InstanceHeader instance,
                                             String methodName)
                                      throws InvalidParameterException
        Verify that an instance is not already deleted since the repository is processing a delete request and it does not want to look stupid.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance about to be deleted
        methodName - name of method called
        Throws:
        InvalidParameterException - the instance is already deleted
      • validateEntityIsNotDeleted

        void validateEntityIsNotDeleted​(String sourceName,
                                        InstanceHeader instance,
                                        String methodName)
                                 throws EntityNotKnownException
        Verify the status of an entity to check it has not been deleted. This method is used when retrieving metadata instances from a store that supports soft delete.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance to validate
        methodName - name of calling method
        Throws:
        EntityNotKnownException - the entity is in deleted status
      • validateEntityIsDeleted

        void validateEntityIsDeleted​(String sourceName,
                                     InstanceHeader instance,
                                     String methodName)
                              throws EntityNotDeletedException
        Verify the status of an entity to check it has been deleted.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance to validate
        methodName - name of calling method
        Throws:
        EntityNotDeletedException - the entity is not in deleted status
      • validateEntityCanBeUpdated

        void validateEntityCanBeUpdated​(String sourceName,
                                        String metadataCollectionId,
                                        InstanceHeader instance,
                                        String methodName)
                                 throws InvalidParameterException
        Verify that an entity instance can be updated by the metadataCollection. This method is used when the metadataCollection is called to update the status properties or classification of an entity instance.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the metadata collection
        instance - instance to validate
        methodName - name of calling method
        Throws:
        InvalidParameterException - the entity is in deleted status
      • validateEntityCanBeRehomed

        void validateEntityCanBeRehomed​(String sourceName,
                                        String metadataCollectionId,
                                        InstanceHeader instance,
                                        String methodName)
                                 throws InvalidParameterException
        Verify that an entity instance can be rehomed by the metadataCollection. This method is used when the metadataCollection is called to rehome an entity instance.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the metadata collection
        instance - instance to validate
        methodName - name of calling method
        Throws:
        InvalidParameterException - the entity is in deleted status
      • validateRelationshipIsNotDeleted

        void validateRelationshipIsNotDeleted​(String sourceName,
                                              InstanceHeader instance,
                                              String methodName)
                                       throws RelationshipNotKnownException
        Verify the status of a relationship to check it has not been deleted. This method is used when retrieving metadata instances from a store that supports soft delete.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance to test
        methodName - name of calling method
        Throws:
        RelationshipNotKnownException - the relationship is in deleted status
      • validateRelationshipIsDeleted

        void validateRelationshipIsDeleted​(String sourceName,
                                           InstanceHeader instance,
                                           String methodName)
                                    throws RelationshipNotDeletedException
        Verify the status of a relationship to check it has been deleted.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance to test
        methodName - name of calling method
        Throws:
        RelationshipNotDeletedException - the relationship is not in deleted status
      • validateRelationshipCanBeUpdated

        void validateRelationshipCanBeUpdated​(String sourceName,
                                              String metadataCollectionId,
                                              InstanceHeader instance,
                                              String methodName)
                                       throws InvalidParameterException
        Verify that a relationship instance can be updated by the metadataCollection. This method is used when the metadataCollection is called to update the status or properties of a relationship instance.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the metadata collection
        instance - instance to validate
        methodName - name of calling method
        Throws:
        InvalidParameterException - the entity is in deleted status
      • validateRelationshipCanBeRehomed

        void validateRelationshipCanBeRehomed​(String sourceName,
                                              String metadataCollectionId,
                                              InstanceHeader instance,
                                              String methodName)
                                       throws InvalidParameterException
        Verify that a relationship instance can be rehomed by the metadataCollection. This method is used when the metadataCollection is called to rehome a relationship instance.
        Parameters:
        sourceName - source of the request (used for logging)
        metadataCollectionId - unique identifier for the metadata collection
        instance - instance to validate
        methodName - name of calling method
        Throws:
        InvalidParameterException - the entity is in deleted status
      • validateRelationshipEnds

        void validateRelationshipEnds​(String sourceName,
                                      EntityProxy entityOneProxy,
                                      EntityProxy entityTwoProxy,
                                      TypeDef typeDef,
                                      String methodName)
                               throws InvalidParameterException
        Validate that the types of the two ends of a relationship match the relationship's TypeDef.
        Parameters:
        sourceName - source of the request (used for logging)
        entityOneProxy - content of end one
        entityTwoProxy - content of end two
        typeDef - typeDef for the relationship
        methodName - name of the method making the request
        Throws:
        InvalidParameterException - types do not align
      • verifyEntityIsClassified

        boolean verifyEntityIsClassified​(List<String> requiredClassifications,
                                         EntitySummary entity)
        Return a boolean indicating whether the supplied entity is classified with one or more of the supplied classifications.
        Parameters:
        requiredClassifications - list of required classification null means that there are no specific classification requirements and so results in a true response.
        entity - entity to test.
        Returns:
        boolean result
      • countMatchingPropertyValues

        int countMatchingPropertyValues​(InstanceProperties matchProperties,
                                        InstanceProperties instanceProperties)
                                 throws InvalidParameterException
        Count the number of matching property values that an instance has. They may come from an entity, classification or relationship.
        Parameters:
        matchProperties - the properties to match.
        instanceProperties - the properties from the instance.
        Returns:
        integer count of the matching properties.
        Throws:
        InvalidParameterException - invalid search criteria
      • countMatchingHeaderPropertyValues

        int countMatchingHeaderPropertyValues​(InstanceProperties matchProperties,
                                              InstanceAuditHeader instanceHeader,
                                              InstanceProperties instanceProperties)
                                       throws InvalidParameterException
        Count the number of matching property values that an instance has. They may come from an entity, or relationship.
        Parameters:
        matchProperties - the properties to match.
        instanceHeader - the header properties from the instance.
        instanceProperties - the effectivity dates.
        Returns:
        integer count of the matching properties.
        Throws:
        InvalidParameterException - invalid search criteria
      • verifyMatchingInstancePropertyValues

        boolean verifyMatchingInstancePropertyValues​(InstanceProperties matchProperties,
                                                     InstanceAuditHeader instanceHeader,
                                                     InstanceProperties instanceProperties,
                                                     MatchCriteria matchCriteria)
                                              throws InvalidParameterException
        Determine if the instance properties match the match criteria.
        Parameters:
        matchProperties - the properties to match.
        instanceHeader - the header of the instance.
        instanceProperties - the properties from the instance.
        matchCriteria - rule on how the match should occur.
        Returns:
        boolean flag indicating whether the two sets of properties match
        Throws:
        InvalidParameterException - invalid search criteria
      • getNumericRepresentation

        BigDecimal getNumericRepresentation​(InstancePropertyValue value)
        Retrieve a numeric representation of the provided value, or null if it cannot be converted to a number.
        Parameters:
        value - to convert
        Returns:
        BigDecimal
      • verifyMatchingInstancePropertyValues

        boolean verifyMatchingInstancePropertyValues​(SearchProperties matchProperties,
                                                     InstanceAuditHeader instanceHeader,
                                                     InstanceProperties instanceProperties)
                                              throws InvalidParameterException
        Determine if the instance properties match the property-based conditions.
        Parameters:
        matchProperties - the property-based conditions to match.
        instanceHeader - the header of the instance.
        instanceProperties - the properties from the instance.
        Returns:
        boolean flag indicating whether the two sets of properties match
        Throws:
        InvalidParameterException - invalid search criteria
      • verifyMatchingClassifications

        boolean verifyMatchingClassifications​(SearchClassifications matchClassifications,
                                              EntitySummary entity)
                                       throws InvalidParameterException
        Determine if the instance properties match the classification-based conditions.
        Parameters:
        matchClassifications - the classification-based conditions to match.
        entity - the entity instance.
        Returns:
        boolean flag indicating whether the classifications match
        Throws:
        InvalidParameterException - invalid search criteria
      • validateReferenceInstanceHeader

        void validateReferenceInstanceHeader​(String sourceName,
                                             String localMetadataCollectionId,
                                             String instanceParameterName,
                                             InstanceHeader instance,
                                             String methodName)
                                      throws InvalidParameterException,
                                             RepositoryErrorException
        Validates that an instance has the correct header for it to be a reference copy.
        Parameters:
        sourceName - source of the request (used for logging)
        localMetadataCollectionId - the unique identifier for the local repository' metadata collection.
        instanceParameterName - the name of the parameter that provided the instance.
        instance - the instance to test
        methodName - the name of the method that supplied the instance.
        Throws:
        RepositoryErrorException - problem with repository
        InvalidParameterException - the instance is null or linked to local metadata repository
      • validateEntityProxy

        void validateEntityProxy​(String sourceName,
                                 String localMetadataCollectionId,
                                 String proxyParameterName,
                                 EntityProxy entityProxy,
                                 String methodName)
                          throws InvalidParameterException
        Validates an entity proxy. It must be a reference copy (ie owned by a different repository).
        Parameters:
        sourceName - source of the request (used for logging)
        localMetadataCollectionId - unique identifier for this repository's metadata collection
        proxyParameterName - name of the parameter used to provide the parameter
        entityProxy - proxy to add
        methodName - name of the method that adds the proxy
        Throws:
        InvalidParameterException - the entity proxy is null or for an entity homed in this repository
      • verifyInstancePropertiesMatchSearchCriteria

        boolean verifyInstancePropertiesMatchSearchCriteria​(String sourceName,
                                                            InstanceProperties properties,
                                                            String searchCriteria,
                                                            String methodName)
                                                     throws RepositoryErrorException
        Search for property values matching the search criteria (a regular expression)
        Parameters:
        sourceName - source of the request (used for logging)
        properties - list of properties associated with the in instance
        searchCriteria - regular expression for testing the property values
        methodName - name of the method requiring the search.
        Returns:
        boolean indicating whether the search criteria is located in any of the string parameter values.
        Throws:
        RepositoryErrorException - the properties are not properly set up in the instance
      • verifyInstancePropertiesMatchPropertyValue

        boolean verifyInstancePropertiesMatchPropertyValue​(String sourceName,
                                                           InstanceProperties properties,
                                                           String searchPropertyValue,
                                                           String methodName)
                                                    throws RepositoryErrorException
        Search for property values matching the supplied property value
        Parameters:
        sourceName - source of the request (used for logging)
        properties - list of properties associated with the in instance
        searchPropertyValue - property value as a string
        methodName - name of the method requiring the search.
        Returns:
        boolean indicating whether the search criteria is located in any of the string parameter values.
        Throws:
        RepositoryErrorException - the properties are not properly set up in the instance
      • getStringFromPropertyValue

        String getStringFromPropertyValue​(InstancePropertyValue instancePropertyValue)
        Return the string form of a property value. Can be used as propertyValue on find property value calls.
        Parameters:
        instancePropertyValue - value to extract the string from
        Returns:
        extracted string value.
      • getStringValuesFromInstancePropertiesAsArray

        String getStringValuesFromInstancePropertiesAsArray​(InstanceProperties instanceProperties)
        Return the string form of the instance properties. Can be used as propertyValue on find property value calls.
        Parameters:
        instanceProperties - value to extract the string from
        Returns:
        extracted string value.
      • getStringValuesFromInstancePropertiesAsMap

        String getStringValuesFromInstancePropertiesAsMap​(InstanceProperties instanceProperties)
        Return the string form of the instance properties. Can be used as propertyValue on find property value calls.
        Parameters:
        instanceProperties - value to extract the string from
        Returns:
        extracted string value.
      • getStringValuesFromInstancePropertiesAsStruct

        String getStringValuesFromInstancePropertiesAsStruct​(InstanceProperties instanceProperties)
        Return the string form of the instance properties. Can be used as propertyValue on find property value calls.
        Parameters:
        instanceProperties - value to extract the string from
        Returns:
        extracted string value.
      • isATypeOf

        boolean isATypeOf​(String sourceName,
                          InstanceAuditHeader instance,
                          String typeName,
                          String localMethodName)
        Returns a boolean indicating that the instance is of the supplied type. It tests the base type and all the super types.
        Parameters:
        sourceName - source of the request (used for logging)
        instance - instance to test
        typeName - name of the type
        localMethodName - local method that is calling isATypeOf
        Returns:
        true if typeName is instance type or a supertype of it, otherwise false
      • validateAtMostOneEntityResult

        void validateAtMostOneEntityResult​(List<EntityDetail> findResults,
                                           String typeName,
                                           String serviceName,
                                           String methodName)
                                    throws RepositoryErrorException
        Validate that either zero or one entities were returned from a find request. This is typically when searching for entities of a specific type using one of its unique properties.
        Parameters:
        findResults - list of entities returned from the search.
        typeName - name of the type of entities requested.
        serviceName - service that requested the entities.
        methodName - calling method.
        Throws:
        RepositoryErrorException - results are not as expected
      • validateAtMostOneRelationshipResult

        void validateAtMostOneRelationshipResult​(List<Relationship> findResults,
                                                 String typeName,
                                                 String serviceName,
                                                 String methodName)
                                          throws RepositoryErrorException
        Validate that either zero or one relationships were returned from a find request. This is typically when searching for relationships of a specific type where the cardinality is set to AT_MOST_ONE in the RelationshipEndCardinality.
        Parameters:
        findResults - list of relationships returned from the search.
        typeName - name of the type of relationships requested.
        serviceName - service that requested the relationships.
        methodName - calling method.
        Throws:
        RepositoryErrorException - results are not as expected