Class OMRSRepositoryContentValidator
java.lang.Object
org.odpi.openmetadata.repositoryservices.localrepository.repositorycontentmanager.OMRSRepositoryContentValidator
- All Implemented Interfaces:
- OMRSRepositoryValidator
OMRSRepositoryContentValidator 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.
- 
Constructor SummaryConstructorsConstructorDescriptionOMRSRepositoryContentValidator(OMRSRepositoryContentManager repositoryContentManager) Typical constructor used by the OMRS to create a repository validator for a repository connector.
- 
Method SummaryModifier and TypeMethodDescriptionintcountMatchingHeaderPropertyValues(InstanceProperties matchProperties, InstanceAuditHeader instanceHeader, InstanceProperties instanceProperties) Count the number of matching property values that an instance has.intcountMatchingPropertyValues(InstanceProperties matchProperties, InstanceProperties instanceProperties, MatchCriteria matchCriteria) Count the number of matching property values that an instance has.Retrieve a numeric representation of the provided value, or null if it cannot be converted to a number.getStringFromPropertyValue(InstancePropertyValue instancePropertyValue) Return the string form of a property value.getStringValuesFromInstancePropertiesAsArray(InstanceProperties instanceProperties) Return the string form of the instance properties.getStringValuesFromInstancePropertiesAsMap(InstanceProperties instanceProperties) Return the string form of the instance properties.getStringValuesFromInstancePropertiesAsStruct(InstanceProperties instanceProperties) Return the string form of the instance properties.getValidAttributeTypeDefFromIds(String sourceName, String guidParameterName, String nameParameterName, String guid, String name, String methodName) Validate that an AttributeTypeDef's identifiers are not null and are recognized.getValidTypeDefFromIds(String sourceName, String guidParameterName, String nameParameterName, String guid, String name, String methodName) Validate that a TypeDef's identifiers are not null and return the type.booleanisActiveType(String sourceName, String typeGUID, String typeName) Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.booleanisActiveTypeId(String sourceName, String typeGUID) Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.booleanisATypeOf(String sourceName, InstanceAuditHeader instance, String typeName, String localMethodName) Returns a boolean indicating that the instance is of the supplied type.booleanisKnownType(String sourceName, String typeGUID, String typeName) Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.booleanisKnownTypeId(String sourceName, String typeGUID) Return boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.booleanisOpenType(String sourceName, String typeGUID, String typeName) Return boolean indicating whether the TypeDef is one of the open metadata types.booleanisOpenTypeId(String sourceName, String typeGUID) Return boolean indicating whether the TypeDef is one of the open metadata types.voidvalidateActiveType(String sourceName, String typeParameterName, TypeDefSummary typeDefSummary, TypeDefCategory category, String methodName) Validate that the supplied type is a valid active type.voidvalidateAsOfTime(String sourceName, String parameterName, Date asOfTime, String methodName) Validate that the asOfTime parameter is not for the future.voidvalidateAsOfTimeNotNull(String sourceName, String parameterName, Date asOfTime, String methodName) Validate that the asOfTime parameter is not null or for the future.voidvalidateAtMostOneEntityResult(List<EntityDetail> findResults, String typeName, String serviceName, String methodName) Validate that either zero or one entity were returned from a find request.voidvalidateAtMostOneRelationshipResult(List<Relationship> findResults, String typeName, String serviceName, String methodName) Validate that either zero or one relationship were returned from a find request.voidvalidateAttributeTypeDef(String sourceName, String parameterName, AttributeTypeDef attributeTypeDef, String methodName) Validate the content of a new AttributeTypeDef.voidvalidateAttributeTypeDefCategory(String sourceName, String nameParameterName, AttributeTypeDefCategory category, String methodName) Validate that a AttributeTypeDef's category is not null.voidvalidateAttributeTypeDefIds(String sourceName, String guidParameterName, String nameParameterName, String guid, String name, String methodName) Validate that an AttributeTypeDef's identifiers are not null and are recognized.voidvalidateClassification(String sourceName, String classificationParameterName, String classificationName, String entityTypeName, String methodName) Validate that a classification is valid for the entity.voidvalidateClassificationList(String sourceName, String parameterName, List<Classification> classifications, String entityTypeName, String methodName) Validate that a classification is valid for the entity.validateClassificationName(String sourceName, String parameterName, String classificationName, String methodName) Validate that a classification name is not null.voidvalidateClassificationProperties(String sourceName, String classificationName, String propertiesParameterName, InstanceProperties classificationProperties, String methodName) Validate that a classification is valid for the entity.voidvalidateDateRange(String sourceName, String parameterName, Date fromTime, Date toTime, String methodName) Validate that the time parameters are not inverted ('from' later than 'to').voidvalidateEnterpriseAttributeTypeDefs(String sourceName, List<AttributeTypeDef> attributeTypeDefs, String methodName) Return a boolean flag indicating whether the list of TypeDefs passed are compatible with the all known typedefs.voidvalidateEnterpriseTypeDefs(String sourceName, List<TypeDef> typeDefs, String methodName) Return a boolean flag indicating whether the list of TypeDefs passed are compatible with the all known typedefs.voidvalidateEntityCanBeRehomed(String sourceName, String metadataCollectionId, InstanceHeader instance, String methodName) Verify that an entity instance can be rehomed by the metadataCollection.voidvalidateEntityCanBeUpdated(String sourceName, String metadataCollectionId, InstanceHeader instance, String methodName) Verify that an entity instance can be updated by the metadataCollection.voidvalidateEntityFromStore(String sourceName, String guid, EntityDetail entity, String methodName) Verify that an entity has been successfully retrieved from the repository and has valid contents.voidvalidateEntityFromStore(String sourceName, String guid, EntitySummary entity, String methodName) Verify that an entity has been successfully retrieved from the repository and has valid contents.voidvalidateEntityIsDeleted(String sourceName, InstanceHeader instance, String methodName) Verify the status of an entity to check it has been deleted.voidvalidateEntityIsNotDeleted(String sourceName, InstanceHeader instance, String methodName) Verify the status of an entity to check if it has been deleted.voidvalidateEntityProxy(String sourceName, String localMetadataCollectionId, String proxyParameterName, EntityProxy entityProxy, String methodName) Validates an entity proxy.voidvalidateExternalId(String sourceName, String standard, String organization, String identifier, String methodName) Validate that the type's name is not null.voidvalidateGUID(String sourceName, String guidParameterName, String guid, String methodName) Validate that an entity's identifier is not null.voidvalidateHomeMetadataGUID(String sourceName, String guidParameterName, String guid, String methodName) Validate that a home metadata collection identifier is not null.voidvalidateHomeMetadataGUID(String sourceName, Classification classification, String methodName) Validate that a home metadata collection identifier in a classification is not null.voidvalidateHomeMetadataGUID(String sourceName, InstanceHeader instance, String methodName) Validate that a home metadata collection identifier in an instance is not null.voidvalidateInstanceStatus(String sourceName, String instanceStatusParameterName, InstanceStatus instanceStatus, TypeDef typeDef, String methodName) Validates an instance status where null is permissible.voidvalidateInstanceStatusForDelete(String sourceName, InstanceHeader instance, String methodName) Verify that an instance is not already deleted since the repository is processing a delete request, and it does not want to look stupid.voidvalidateInstanceType(String sourceName, InstanceHeader instance) Verify that the instance retrieved from the repository has a valid instance type.voidvalidateInstanceType(String sourceName, InstanceHeader instance, String typeGUIDParameterName, String typeNameParameterName, String expectedTypeGUID, String expectedTypeName) Verify that the instance retrieved from the repository has a valid instance type that matches the expected type.voidvalidateInstanceTypeGUID(String sourceName, String guidParameterName, String guid, String methodName) Validate that if a type's identifier is passed then it is valid.voidvalidateKnownTypeDef(String sourceName, String parameterName, TypeDef typeDef, String methodName) Validate the content of a new TypeDef is known.voidvalidateMatchCriteria(String sourceName, String matchCriteriaParameterName, String matchPropertiesParameterName, MatchCriteria matchCriteria, InstanceProperties matchProperties, String methodName) Validate that a metadata instance match criteria and set of properties are either both null or both not null.voidvalidateMatchCriteria(String sourceName, String parameterName, TypeDefProperties matchCriteria, String methodName) Validate that a TypeDef match criteria set of properties is not null.voidvalidateNewPropertiesForType(String sourceName, String parameterName, TypeDef typeDef, InstanceProperties properties, String methodName) Validate that the properties for a metadata instance match its TypeDefvoidvalidateNewStatus(String sourceName, String instanceStatusParameterName, InstanceStatus instanceStatus, TypeDef typeDef, String methodName) Validates an instance status where null is not allowed.voidvalidateOptionalTypeGUID(String sourceName, String guidParameterName, String guid, String methodName) Validate that type's identifier is not null.voidvalidateOptionalTypeGUIDs(String sourceName, String guidParameterName, String guid, String subtypeParameterName, List<String> subtypeGuids, String methodName) Validate that the types and subtypes (if specified) fit each other.voidvalidatePageSize(String sourceName, String parameterName, int pageSize, String methodName) Validate that a page size parameter is not negative.voidvalidatePropertiesForType(String sourceName, String parameterName, TypeDef typeDef, InstanceProperties properties, String methodName) Validate that the properties for a metadata instance match its TypeDef.voidvalidatePropertiesForType(String sourceName, String parameterName, TypeDefSummary typeDefSummary, InstanceProperties properties, String methodName) Validate that the properties for a metadata instance match its TypeDefvoidvalidateReferenceInstanceHeader(String sourceName, String localMetadataCollectionId, String instanceParameterName, InstanceHeader instance, String methodName) Validates that an instance has the correct header for it to be a reference copy.voidvalidateReferenceInstanceHeader(String sourceName, String localMetadataCollectionId, String instanceParameterName, InstanceHeader instance, AuditLog auditLog, String methodName) Validates that an instance has the correct header for it to be a reference copy.voidvalidateRelationshipCanBeRehomed(String sourceName, String metadataCollectionId, InstanceHeader instance, String methodName) Verify that a relationship instance can be rehomed by the metadataCollection.voidvalidateRelationshipCanBeUpdated(String sourceName, String metadataCollectionId, InstanceHeader instance, String methodName) Verify that a relationship instance can be updated by the metadataCollection.voidvalidateRelationshipEnds(String sourceName, EntityProxy entityOneProxy, EntityProxy entityTwoProxy, TypeDef typeDef, String methodName) Validate that the types of the two ends of a relationship match the relationship's TypeDef.voidvalidateRelationshipFromStore(String sourceName, String guid, Relationship relationship, String methodName) Verify that a relationship has been successfully retrieved from the repository and has valid contents.voidvalidateRelationshipIsDeleted(String sourceName, InstanceHeader instance, String methodName) Verify the status of a relationship to check it has been deleted.voidvalidateRelationshipIsNotDeleted(String sourceName, InstanceHeader instance, String methodName) Verify the status of a relationship to check it has been deleted.voidvalidateSearchClassifications(String sourceName, String parameterName, SearchClassifications matchClassifications, String methodName) Validate the classification-based search conditions.voidvalidateSearchCriteria(String sourceName, String parameterName, String searchCriteria, String methodName) Validate that a search criteria is not null.voidvalidateSearchProperties(String sourceName, String parameterName, SearchProperties matchProperties, String methodName) Validate the property-based search conditions.voidvalidateTypeDef(String sourceName, String parameterName, TypeDef typeDef, String methodName) Validate the content of a new TypeDef is valid.voidvalidateTypeDefCategory(String sourceName, String nameParameterName, TypeDefCategory category, String methodName) Validate that a TypeDef's category is not null.voidvalidateTypeDefForInstance(String sourceName, String parameterName, TypeDef typeDef, String methodName) Validate the content of a TypeDef associated with a metadata instance.voidvalidateTypeDefGallery(String sourceName, String parameterName, TypeDefGallery gallery, String methodName) Validate that type's name is not null.voidvalidateTypeDefIds(String sourceName, String guidParameterName, String nameParameterName, String guid, String name, String methodName) Validate that a TypeDef's identifiers are not null.validateTypeDefPatch(String sourceName, TypeDefPatch patch, String methodName) Verify that a TypeDefPatch is not null and is for a recognized type.voidvalidateTypeForInstanceDelete(String sourceName, String typeDefGUID, String typeDefName, InstanceHeader instance, String methodName) Validate that the supplied TypeDef GUID and name matches the type associated with a metadata instance.voidvalidateTypeGUID(String sourceName, String guidParameterName, String guid, String methodName) Validate that type's identifier is not null.voidvalidateTypeName(String sourceName, String nameParameterName, String name, String methodName) Validate that type's name is not null.voidvalidateUnknownAttributeTypeDef(String sourceName, String parameterName, AttributeTypeDef attributeTypeDef, String methodName) Validate the content of a new TypeDef is known.voidvalidateUnknownTypeDef(String sourceName, String parameterName, TypeDef typeDef, String methodName) Validate the content of a new TypeDef is known.voidvalidateUserId(String sourceName, String userId, String methodName) Validate that the supplied user id is not null.booleanvalidAttributeTypeDef(String sourceName, AttributeTypeDef attributeTypeDef) Return boolean indicating whether the supplied AttributeTypeDef is valid or not.booleanvalidAttributeTypeDefId(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.booleanvalidAttributeTypeDefId(String sourceName, String attributeTypeDefGUID, String attributeTypeDefName, AttributeTypeDefCategory category) Return boolean indicating whether the AttributeTypeDef identifiers are from a single known type or not.booleanvalidEntity(String sourceName, EntityDetail entity) Test that the supplied entity is valid.booleanvalidEntity(String sourceName, EntityProxy entity) Test that the supplied entity is valid.booleanvalidEntity(String sourceName, EntitySummary entity) Test that the supplied entity is valid.booleanvalidInstanceId(String sourceName, String typeDefGUID, String typeDefName, TypeDefCategory category, String instanceGUID) Verify that the identifiers for an instance are correct.booleanvalidRelationship(String sourceName, Relationship relationship) Test that the supplied relationship is valid.booleanvalidTypeDef(String sourceName, TypeDef typeDef) Return boolean indicating whether the supplied TypeDef is valid or not.booleanvalidTypeDefId(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.booleanvalidTypeDefId(String sourceName, String typeDefGUID, String typeDefName, TypeDefCategory category) Return boolean indicating whether the TypeDef identifiers are from a single known type or not.booleanvalidTypeDefSummary(String sourceName, TypeDefSummary typeDefSummary) Return boolean indicating whether the supplied TypeDefSummary is valid or not.booleanvalidTypeId(String sourceName, String typeGUID, String typeName) Return boolean indicating whether the TypeDef identifiers are from a single known type or not.booleanverifyEntityIsClassified(List<String> requiredClassifications, EntitySummary entity) Return a boolean indicating whether the supplied entity is classified with one or more of the supplied classifications.booleanverifyInstanceHasRightStatus(List<InstanceStatus> validStatuses, InstanceHeader instance) Verify that the supplied instance is in one of the supplied statuses.booleanverifyInstancePropertiesMatchPropertyValue(String sourceName, InstanceProperties properties, String searchPropertyValue, String methodName) Search for property values matching the supplied property valuebooleanverifyInstancePropertiesMatchSearchCriteria(String sourceName, InstanceProperties properties, String searchCriteria, String methodName) Search for property values matching the search criteria (a regular expression)booleanverifyInstanceType(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.booleanverifyInstanceType(String sourceName, String instanceTypeGUID, InstanceHeader instance) Verify whether the instance passed to this method is of the type indicated by the type guid.booleanverifyMatchingClassifications(SearchClassifications matchClassifications, EntitySummary entity) Determine if the instance properties match the classification-based conditions.booleanverifyMatchingInstancePropertyValues(InstanceProperties matchProperties, InstanceAuditHeader instanceHeader, InstanceProperties instanceProperties, MatchCriteria matchCriteria) Determine if the instance properties match the match criteria.booleanverifyMatchingInstancePropertyValues(SearchProperties matchProperties, String guid, InstanceAuditHeader instanceHeader, InstanceProperties instanceProperties) Determine if the instance properties match the property-based conditions.
- 
Constructor Details- 
OMRSRepositoryContentValidatorTypical constructor used by the OMRS to create a repository validator for a repository connector.- Parameters:
- repositoryContentManager- holds details of valid types and provides the implementation of the repository validator methods
 
 
- 
- 
Method Details- 
validateEnterpriseTypeDefspublic 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.- Specified by:
- validateEnterpriseTypeDefsin interface- OMRSRepositoryValidator
- 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
 
- 
validateEnterpriseAttributeTypeDefspublic 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.- Specified by:
- validateEnterpriseAttributeTypeDefsin interface- OMRSRepositoryValidator
- 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
 
- 
isActiveTypeReturn boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.- Specified by:
- isActiveTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the type
- typeName- unique name of the type
- Returns:
- boolean flag
 
- 
isActiveTypeIdReturn boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.- Specified by:
- isActiveTypeIdin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the type
- Returns:
- boolean flag
 
- 
isOpenTypeReturn boolean indicating whether the TypeDef is one of the open metadata types.- Specified by:
- isOpenTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the type
- typeName- unique name of the type
- Returns:
- boolean flag
 
- 
isOpenTypeIdReturn boolean indicating whether the TypeDef is one of the open metadata types.- Specified by:
- isOpenTypeIdin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the type
- Returns:
- boolean flag
 
- 
isKnownTypeReturn boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.- Specified by:
- isKnownTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the type
- typeName- unique name of the type
- Returns:
- boolean flag
 
- 
isKnownTypeIdReturn boolean indicating whether the TypeDef/AttributeTypeDef is in use in the repository.- Specified by:
- isKnownTypeIdin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the type
- Returns:
- boolean flag
 
- 
validTypeIdReturn boolean indicating whether the TypeDef identifiers are from a single known type or not.- Specified by:
- validTypeIdin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeGUID- unique identifier of the TypeDef
- typeName- unique name of the TypeDef
- Returns:
- boolean result
 
- 
validTypeDefIdpublic 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.- Specified by:
- validTypeDefIdin interface- OMRSRepositoryValidator
- 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
 
- 
validAttributeTypeDefIdpublic 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.- Specified by:
- validAttributeTypeDefIdin interface- OMRSRepositoryValidator
- 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
 
- 
validTypeDefIdpublic 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.- Specified by:
- validTypeDefIdin interface- OMRSRepositoryValidator
- 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
 
- 
validAttributeTypeDefIdpublic 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.- Specified by:
- validAttributeTypeDefIdin interface- OMRSRepositoryValidator
- 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
 
- 
validateActiveTypepublic 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.- Specified by:
- validateActiveTypein interface- OMRSRepositoryValidator
- 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
 
- 
validTypeDefReturn boolean indicating whether the supplied TypeDef is valid or not.- Specified by:
- validTypeDefin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the TypeDef (used for logging)
- typeDef- TypeDef to test
- Returns:
- boolean result
 
- 
validAttributeTypeDefReturn boolean indicating whether the supplied AttributeTypeDef is valid or not.- Specified by:
- validAttributeTypeDefin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- attributeTypeDef- TypeDef to test
- Returns:
- boolean result
 
- 
validTypeDefSummaryReturn boolean indicating whether the supplied TypeDefSummary is valid or not.- Specified by:
- validTypeDefSummaryin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- typeDefSummary- TypeDefSummary to test.
- Returns:
- boolean result.
 
- 
validEntityTest that the supplied entity is valid.- Specified by:
- validEntityin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- entity- entity to test
- Returns:
- boolean result
 
- 
validEntityTest that the supplied entity is valid.- Specified by:
- validEntityin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- entity- entity to test
- Returns:
- boolean result
 
- 
validEntityTest that the supplied entity is valid.- Specified by:
- validEntityin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- entity- entity to test
- Returns:
- boolean result
 
- 
validRelationshipTest that the supplied relationship is valid.- Specified by:
- validRelationshipin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- relationship- relationship to test
- Returns:
- boolean result
 
- 
validInstanceIdpublic boolean validInstanceId(String sourceName, String typeDefGUID, String typeDefName, TypeDefCategory category, String instanceGUID) Verify that the identifiers for an instance are correct.- Specified by:
- validInstanceIdin interface- OMRSRepositoryValidator
- 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.
 
- 
validateUserIdpublic void validateUserId(String sourceName, String userId, String methodName) throws InvalidParameterException Validate that the supplied user id is not null.- Specified by:
- validateUserIdin interface- OMRSRepositoryValidator
- 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
 
- 
validateTypeDefIdspublic 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.- Specified by:
- validateTypeDefIdsin interface- OMRSRepositoryValidator
- 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
 
- 
getValidTypeDefFromIdspublic 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.- Specified by:
- getValidTypeDefFromIdsin interface- OMRSRepositoryValidator
- 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:
- typeDef
- Throws:
- InvalidParameterException- no guid provided
 
- 
validateAttributeTypeDefIdspublic 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 and are recognized.- Specified by:
- validateAttributeTypeDefIdsin interface- OMRSRepositoryValidator
- 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
 
- 
getValidAttributeTypeDefFromIdspublic 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.- Specified by:
- getValidAttributeTypeDefFromIdsin interface- OMRSRepositoryValidator
- 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 definition
- Throws:
- InvalidParameterException- no guid, or name provided
 
- 
validateTypeGUIDpublic void validateTypeGUID(String sourceName, String guidParameterName, String guid, String methodName) throws InvalidParameterException, TypeErrorException Validate that type's identifier is not null.- Specified by:
- validateTypeGUIDin interface- OMRSRepositoryValidator
- 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
 
- 
validateOptionalTypeGUIDpublic void validateOptionalTypeGUID(String sourceName, String guidParameterName, String guid, String methodName) throws TypeErrorException Validate that type's identifier is not null.- Specified by:
- validateOptionalTypeGUIDin interface- OMRSRepositoryValidator
- 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
 
- 
validateOptionalTypeGUIDspublic 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.- Specified by:
- validateOptionalTypeGUIDsin interface- OMRSRepositoryValidator
- 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
 
- 
validateTypeDefPatchpublic TypeDef validateTypeDefPatch(String sourceName, TypeDefPatch patch, String methodName) throws InvalidParameterException, TypeDefNotKnownException, PatchErrorException Verify that a TypeDefPatch is not null and is for a recognized type.- Specified by:
- validateTypeDefPatchin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- patch- patch to test
- methodName- calling method
- Returns:
- current value of the type
- Throws:
- InvalidParameterException- the patch is null
- TypeDefNotKnownException- the type is not known
- PatchErrorException- the patch is invalid
 
- 
validateInstanceTypeGUIDpublic 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.- Specified by:
- validateInstanceTypeGUIDin interface- OMRSRepositoryValidator
- 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 provided
 
- 
validateTypeNamepublic void validateTypeName(String sourceName, String nameParameterName, String name, String methodName) throws InvalidParameterException Validate that type's name is not null.- Specified by:
- validateTypeNamein interface- OMRSRepositoryValidator
- 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
 
- 
validateTypeDefCategorypublic void validateTypeDefCategory(String sourceName, String nameParameterName, TypeDefCategory category, String methodName) throws InvalidParameterException Validate that a TypeDef's category is not null.- Specified by:
- validateTypeDefCategoryin interface- OMRSRepositoryValidator
- 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
 
- 
validateAttributeTypeDefCategorypublic void validateAttributeTypeDefCategory(String sourceName, String nameParameterName, AttributeTypeDefCategory category, String methodName) throws InvalidParameterException Validate that a AttributeTypeDef's category is not null.- Specified by:
- validateAttributeTypeDefCategoryin interface- OMRSRepositoryValidator
- 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
 
- 
validateTypeDefpublic void validateTypeDef(String sourceName, String parameterName, TypeDef typeDef, String methodName) throws InvalidParameterException, InvalidTypeDefException Validate the content of a new TypeDef is valid.- Specified by:
- validateTypeDefin interface- OMRSRepositoryValidator
- 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:
- InvalidParameterException- no typeDef provided
- InvalidTypeDefException- invalid typeDef provided
 
- 
validateKnownTypeDefpublic void validateKnownTypeDef(String sourceName, String parameterName, TypeDef typeDef, String methodName) throws TypeDefNotKnownException Validate the content of a new TypeDef is known.- Specified by:
- validateKnownTypeDefin interface- OMRSRepositoryValidator
- 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- typeDef provided not recognized
 
- 
validateUnknownTypeDefpublic void validateUnknownTypeDef(String sourceName, String parameterName, TypeDef typeDef, String methodName) throws TypeDefKnownException, TypeDefConflictException Validate the content of a new TypeDef is known.- Specified by:
- validateUnknownTypeDefin interface- OMRSRepositoryValidator
- 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
 
- 
validateUnknownAttributeTypeDefpublic void validateUnknownAttributeTypeDef(String sourceName, String parameterName, AttributeTypeDef attributeTypeDef, String methodName) throws TypeDefKnownException, TypeDefConflictException Validate the content of a new TypeDef is known.- Specified by:
- validateUnknownAttributeTypeDefin interface- OMRSRepositoryValidator
- 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
 
- 
validateTypeDefForInstancepublic void validateTypeDefForInstance(String sourceName, String parameterName, TypeDef typeDef, String methodName) throws TypeErrorException, RepositoryErrorException Validate the content of a TypeDef associated with a metadata instance.- Specified by:
- validateTypeDefForInstancein interface- OMRSRepositoryValidator
- 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.
 
- 
validateTypeForInstanceDeletepublic 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.- Specified by:
- validateTypeForInstanceDeletein interface- OMRSRepositoryValidator
- 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.
 
- 
validateAttributeTypeDefpublic void validateAttributeTypeDef(String sourceName, String parameterName, AttributeTypeDef attributeTypeDef, String methodName) throws InvalidParameterException, InvalidTypeDefException Validate the content of a new AttributeTypeDef.- Specified by:
- validateAttributeTypeDefin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- parameterName- name of the parameter that passed the attributeTypeDef.
- attributeTypeDef- unique identifier for a type or an instance passed on the request
- methodName- method receiving the call
- Throws:
- InvalidParameterException- no attributeTypeDef provided
- InvalidTypeDefException- bad attributeTypeDef provided
 
- 
validateTypeDefGallerypublic void validateTypeDefGallery(String sourceName, String parameterName, TypeDefGallery gallery, String methodName) throws InvalidParameterException Validate that type's name is not null.- Specified by:
- validateTypeDefGalleryin interface- OMRSRepositoryValidator
- 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
 
- 
validateExternalIdpublic void validateExternalId(String sourceName, String standard, String organization, String identifier, String methodName) throws InvalidParameterException Validate that the type's name is not null.- Specified by:
- validateExternalIdin interface- OMRSRepositoryValidator
- 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
 
- 
validateGUIDpublic void validateGUID(String sourceName, String guidParameterName, String guid, String methodName) throws InvalidParameterException Validate that an entity's identifier is not null.- Specified by:
- validateGUIDin interface- OMRSRepositoryValidator
- 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
 
- 
validateHomeMetadataGUIDpublic void validateHomeMetadataGUID(String sourceName, String guidParameterName, String guid, String methodName) throws InvalidParameterException Validate that a home metadata collection identifier is not null.- Specified by:
- validateHomeMetadataGUIDin interface- OMRSRepositoryValidator
- 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
 
- 
validateHomeMetadataGUIDpublic void validateHomeMetadataGUID(String sourceName, Classification classification, String methodName) throws RepositoryErrorException Validate that a home metadata collection identifier in a classification is not null.- Specified by:
- validateHomeMetadataGUIDin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- classification- classification to test.
- methodName- method receiving the call
- Throws:
- RepositoryErrorException- no guid provided
 
- 
validateHomeMetadataGUIDpublic void validateHomeMetadataGUID(String sourceName, InstanceHeader instance, String methodName) throws RepositoryErrorException Validate that a home metadata collection identifier in an instance is not null.- Specified by:
- validateHomeMetadataGUIDin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- instance- instance to test.
- methodName- method receiving the call
- Throws:
- RepositoryErrorException- no guid provided
 
- 
validateAsOfTimepublic void validateAsOfTime(String sourceName, String parameterName, Date asOfTime, String methodName) throws InvalidParameterException Validate that the asOfTime parameter is not for the future.- Specified by:
- validateAsOfTimein interface- OMRSRepositoryValidator
- 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
 
- 
validateAsOfTimeNotNullpublic void validateAsOfTimeNotNull(String sourceName, String parameterName, Date asOfTime, String methodName) throws InvalidParameterException Validate that the asOfTime parameter is not null or for the future.- Specified by:
- validateAsOfTimeNotNullin interface- OMRSRepositoryValidator
- 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
 
- 
validateDateRangepublic 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').- Specified by:
- validateDateRangein interface- OMRSRepositoryValidator
- 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', or either is some point in the future
 
- 
validatePageSizepublic void validatePageSize(String sourceName, String parameterName, int pageSize, String methodName) throws PagingErrorException Validate that a page size parameter is not negative.- Specified by:
- validatePageSizein interface- OMRSRepositoryValidator
- 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
 
- 
validateClassificationNamepublic TypeDef validateClassificationName(String sourceName, String parameterName, String classificationName, String methodName) throws InvalidParameterException Validate that a classification name is not null.- Specified by:
- validateClassificationNamein interface- OMRSRepositoryValidator
- 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
 
- 
validateClassificationPropertiespublic void validateClassificationProperties(String sourceName, String classificationName, String propertiesParameterName, InstanceProperties classificationProperties, String methodName) throws PropertyErrorException Validate that a classification is valid for the entity.- Specified by:
- validateClassificationPropertiesin interface- OMRSRepositoryValidator
- 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
 
- 
validateClassificationpublic void validateClassification(String sourceName, String classificationParameterName, String classificationName, String entityTypeName, String methodName) throws InvalidParameterException, ClassificationErrorException Validate that a classification is valid for the entity.- Specified by:
- validateClassificationin interface- OMRSRepositoryValidator
- 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
 
- 
validateClassificationListpublic void validateClassificationList(String sourceName, String parameterName, List<Classification> classifications, String entityTypeName, String methodName) throws InvalidParameterException, ClassificationErrorException, PropertyErrorException, TypeErrorException Validate that a classification is valid for the entity.- Specified by:
- validateClassificationListin interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- parameterName- name of the parameter that passed the guid.
- classifications- list of classifications
- entityTypeName- name of entity type
- methodName- method receiving the call
- Throws:
- InvalidParameterException- classification name is null
- ClassificationErrorException- the classification is invalid for this entity
- PropertyErrorException- the classification's properties are invalid for its type
- TypeErrorException- the classification's type is invalid
 
- 
validateMatchCriteriapublic void validateMatchCriteria(String sourceName, String parameterName, TypeDefProperties matchCriteria, String methodName) throws InvalidParameterException Validate that a TypeDef match criteria set of properties is not null.- Specified by:
- validateMatchCriteriain interface- OMRSRepositoryValidator
- 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
 
- 
validateMatchCriteriapublic 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.- Specified by:
- validateMatchCriteriain interface- OMRSRepositoryValidator
- 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
 
- 
validateSearchCriteriapublic void validateSearchCriteria(String sourceName, String parameterName, String searchCriteria, String methodName) throws InvalidParameterException Validate that a search criteria is not null.- Specified by:
- validateSearchCriteriain interface- OMRSRepositoryValidator
- 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
 
- 
validateSearchPropertiespublic void validateSearchProperties(String sourceName, String parameterName, SearchProperties matchProperties, String methodName) throws InvalidParameterException Validate the property-based search conditions.- Specified by:
- validateSearchPropertiesin interface- OMRSRepositoryValidator
- 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
 
- 
validateSearchClassificationspublic void validateSearchClassifications(String sourceName, String parameterName, SearchClassifications matchClassifications, String methodName) throws InvalidParameterException Validate the classification-based search conditions.- Specified by:
- validateSearchClassificationsin interface- OMRSRepositoryValidator
- 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
 
- 
validatePropertiesForTypepublic 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.- Specified by:
- validatePropertiesForTypein interface- OMRSRepositoryValidator
- 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
 
- 
validatePropertiesForTypepublic void validatePropertiesForType(String sourceName, String parameterName, TypeDefSummary typeDefSummary, InstanceProperties properties, String methodName) throws PropertyErrorException, TypeErrorException Validate that the properties for a metadata instance match its TypeDef- Specified by:
- validatePropertiesForTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- parameterName- name of the "properties" parameter.
- typeDefSummary- type information to validate against.
- properties- proposed properties
- methodName- method receiving the call
- Throws:
- TypeErrorException- no typeDef provided
- PropertyErrorException- invalid property
 
- 
validateNewPropertiesForTypepublic 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- Specified by:
- validateNewPropertiesForTypein interface- OMRSRepositoryValidator
- 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
 
- 
verifyInstanceTypepublic 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.- Specified by:
- verifyInstanceTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- name of the caller.
- instanceTypeGUID- unique identifier of the type (or null).
- instance- instance to test.
- Returns:
- boolean
 
- 
verifyInstanceTypepublic 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.- Specified by:
- verifyInstanceTypein interface- OMRSRepositoryValidator
- 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
 
- 
validateEntityFromStorepublic void validateEntityFromStore(String sourceName, String guid, EntitySummary entity, String methodName) throws RepositoryErrorException, EntityNotKnownException Verify that an entity has been successfully retrieved from the repository and has valid contents.- Specified by:
- validateEntityFromStorein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- guid- unique identifier used to retrieve the entity
- entity- the retrieved entity (or null)
- methodName- method receiving the call
- Throws:
- EntityNotKnownException- No entity found
- RepositoryErrorException- logic error in the repository corrupted instance
 
- 
validateEntityFromStorepublic void validateEntityFromStore(String sourceName, String guid, EntityDetail entity, String methodName) throws RepositoryErrorException, EntityNotKnownException Verify that an entity has been successfully retrieved from the repository and has valid contents.- Specified by:
- validateEntityFromStorein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- guid- unique identifier used to retrieve the entity
- entity- the retrieved entity (or null)
- methodName- method receiving the call
- Throws:
- EntityNotKnownException- No entity found
- RepositoryErrorException- logic error in the repository corrupted instance
 
- 
validateRelationshipFromStorepublic void validateRelationshipFromStore(String sourceName, String guid, Relationship relationship, String methodName) throws RepositoryErrorException, RelationshipNotKnownException Verify that a relationship has been successfully retrieved from the repository and has valid contents.- Specified by:
- validateRelationshipFromStorein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- guid- unique identifier used to retrieve the entity
- relationship- the retrieved relationship (or null)
- methodName- method receiving the call
- Throws:
- RelationshipNotKnownException- No relationship found
- RepositoryErrorException- logic error in the repository corrupted instance
 
- 
validateInstanceTypepublic void validateInstanceType(String sourceName, InstanceHeader instance) throws RepositoryErrorException Verify that the instance retrieved from the repository has a valid instance type.- Specified by:
- validateInstanceTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- instance- the retrieved instance
- Throws:
- RepositoryErrorException- logic error in the repository corrupted instance
 
- 
validateInstanceTypepublic void validateInstanceType(String sourceName, InstanceHeader instance, String typeGUIDParameterName, String typeNameParameterName, String expectedTypeGUID, String expectedTypeName) throws RepositoryErrorException, TypeErrorException, InvalidParameterException Verify that the instance retrieved from the repository has a valid instance type that matches the expected type.- Specified by:
- validateInstanceTypein interface- OMRSRepositoryValidator
- Parameters:
- sourceName- source of the request (used for logging)
- instance- the retrieved instance
- typeGUIDParameterName- name of parameter for TypeDefGUID
- typeNameParameterName- name of parameter for TypeDefName
- expectedTypeGUID- expected GUID of InstanceType
- expectedTypeName- expected name of InstanceType
- Throws:
- RepositoryErrorException- logic error in the repository corrupted instance
- TypeErrorException- problem with type
- InvalidParameterException- invalid parameter
 
- 
verifyInstanceHasRightStatuspublic 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.- Specified by:
- verifyInstanceHasRightStatusin interface- OMRSRepositoryValidator
- Parameters:
- validStatuses- list of statuses the instance should be in any one of them
- instance- instance to test
- Returns:
- boolean result
 
- 
validateInstanceStatuspublic void validateInstanceStatus(String sourceName, String instanceStatusParameterName, InstanceStatus instanceStatus, TypeDef typeDef, String methodName) throws StatusNotSupportedException Validates an instance status where null is permissible.- Specified by:
- validateInstanceStatusin interface- OMRSRepositoryValidator
- 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
 
- 
validateNewStatuspublic void validateNewStatus(String sourceName, String instanceStatusParameterName, InstanceStatus instanceStatus, TypeDef typeDef, String methodName) throws StatusNotSupportedException, InvalidParameterException Validates an instance status where null is not allowed.- Specified by:
- validateNewStatusin interface- OMRSRepositoryValidator
- 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
- InvalidParameterException- invalid parameter
 
- 
validateInstanceStatusForDeletepublic 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.- Specified by:
- validateInstanceStatusForDeletein interface- OMRSRepositoryValidator
- 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
 
- 
validateEntityIsNotDeletedpublic void validateEntityIsNotDeleted(String sourceName, InstanceHeader instance, String methodName) throws EntityNotKnownException Verify the status of an entity to check if it has been deleted.- Specified by:
- validateEntityIsNotDeletedin interface- OMRSRepositoryValidator
- 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
 
- 
validateEntityIsDeletedpublic void validateEntityIsDeleted(String sourceName, InstanceHeader instance, String methodName) throws EntityNotDeletedException Verify the status of an entity to check it has been deleted. This method is used during a purge operation to ensure delete() has been called before purge.- Specified by:
- validateEntityIsDeletedin interface- OMRSRepositoryValidator
- 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
 
- 
validateEntityCanBeUpdatedpublic 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.- Specified by:
- validateEntityCanBeUpdatedin interface- OMRSRepositoryValidator
- 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
 
- 
validateEntityCanBeRehomedpublic 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.- Specified by:
- validateEntityCanBeRehomedin interface- OMRSRepositoryValidator
- 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
 
- 
validateRelationshipIsNotDeletedpublic void validateRelationshipIsNotDeleted(String sourceName, InstanceHeader instance, String methodName) throws RelationshipNotKnownException Verify the status of a relationship to check it has been deleted.- Specified by:
- validateRelationshipIsNotDeletedin interface- OMRSRepositoryValidator
- 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
 
- 
validateRelationshipIsDeletedpublic void validateRelationshipIsDeleted(String sourceName, InstanceHeader instance, String methodName) throws RelationshipNotDeletedException Verify the status of a relationship to check it has been deleted.- Specified by:
- validateRelationshipIsDeletedin interface- OMRSRepositoryValidator
- 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
 
- 
validateRelationshipCanBeUpdatedpublic 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.- Specified by:
- validateRelationshipCanBeUpdatedin interface- OMRSRepositoryValidator
- 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
 
- 
validateRelationshipCanBeRehomedpublic 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.- Specified by:
- validateRelationshipCanBeRehomedin interface- OMRSRepositoryValidator
- 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
 
- 
validateRelationshipEndspublic 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.- Specified by:
- validateRelationshipEndsin interface- OMRSRepositoryValidator
- 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
 
- 
verifyEntityIsClassifiedReturn a boolean indicating whether the supplied entity is classified with one or more of the supplied classifications.- Specified by:
- verifyEntityIsClassifiedin interface- OMRSRepositoryValidator
- 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
 
- 
getStringValuesFromInstancePropertiesAsArrayReturn the string form of the instance properties. Can be used as propertyValue on find property value calls.- Specified by:
- getStringValuesFromInstancePropertiesAsArrayin interface- OMRSRepositoryValidator
- Parameters:
- instanceProperties- value to extract the string from
- Returns:
- extracted string value.
 
- 
getStringValuesFromInstancePropertiesAsMapReturn the string form of the instance properties. Can be used as propertyValue on find property value calls.- Specified by:
- getStringValuesFromInstancePropertiesAsMapin interface- OMRSRepositoryValidator
- Parameters:
- instanceProperties- value to extract the string from
- Returns:
- extracted string value.
 
- 
getStringValuesFromInstancePropertiesAsStructReturn the string form of the instance properties. Can be used as propertyValue on find property value calls.- Specified by:
- getStringValuesFromInstancePropertiesAsStructin interface- OMRSRepositoryValidator
- Parameters:
- instanceProperties- value to extract the string from
- Returns:
- extracted string value.
 
- 
getStringFromPropertyValueReturn the string form of a property value. Can be used as propertyValue on find property value calls.- Specified by:
- getStringFromPropertyValuein interface- OMRSRepositoryValidator
- Parameters:
- instancePropertyValue- value to extract the string from
- Returns:
- extracted string value.
 
- 
countMatchingPropertyValuespublic int countMatchingPropertyValues(InstanceProperties matchProperties, InstanceProperties instanceProperties, MatchCriteria matchCriteria) throws InvalidParameterException Count the number of matching property values that an instance has. They may come from an entity, classification or relationship.- Specified by:
- countMatchingPropertyValuesin interface- OMRSRepositoryValidator
- Parameters:
- matchProperties- the properties to match.
- instanceProperties- the properties from the instance.
- matchCriteria- how close does the match need to be
- Returns:
- integer count of the matching properties.
- Throws:
- InvalidParameterException- invalid search criteria
 
- 
countMatchingHeaderPropertyValuespublic int countMatchingHeaderPropertyValues(InstanceProperties matchProperties, InstanceAuditHeader instanceHeader, InstanceProperties instanceProperties) Count the number of matching property values that an instance has. They may come from an entity, or relationship.- Specified by:
- countMatchingHeaderPropertyValuesin interface- OMRSRepositoryValidator
- Parameters:
- matchProperties- the properties to match.
- instanceHeader- the header properties from the instance.
- instanceProperties- the effectivity dates.
- Returns:
- integer count of the matching properties.
 
- 
verifyMatchingInstancePropertyValuespublic boolean verifyMatchingInstancePropertyValues(InstanceProperties matchProperties, InstanceAuditHeader instanceHeader, InstanceProperties instanceProperties, MatchCriteria matchCriteria) throws InvalidParameterException Determine if the instance properties match the match criteria.- Specified by:
- verifyMatchingInstancePropertyValuesin interface- OMRSRepositoryValidator
- 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
 
- 
getNumericRepresentationRetrieve a numeric representation of the provided value, or null if it cannot be converted to a number.- Specified by:
- getNumericRepresentationin interface- OMRSRepositoryValidator
- Parameters:
- value- to convert
- Returns:
- BigDecimal
 
- 
verifyMatchingInstancePropertyValuespublic boolean verifyMatchingInstancePropertyValues(SearchProperties matchProperties, String guid, InstanceAuditHeader instanceHeader, InstanceProperties instanceProperties) throws InvalidParameterException Determine if the instance properties match the property-based conditions.- Specified by:
- verifyMatchingInstancePropertyValuesin interface- OMRSRepositoryValidator
- Parameters:
- matchProperties- the property-based conditions to match.
- guid- unique identifier of the element (may be null if call is for classification.)
- 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
 
- 
verifyMatchingClassificationspublic boolean verifyMatchingClassifications(SearchClassifications matchClassifications, EntitySummary entity) throws InvalidParameterException Determine if the instance properties match the classification-based conditions.- Specified by:
- verifyMatchingClassificationsin interface- OMRSRepositoryValidator
- 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
 
- 
validateReferenceInstanceHeaderpublic 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.- Specified by:
- validateReferenceInstanceHeaderin interface- OMRSRepositoryValidator
- 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
 
- 
validateReferenceInstanceHeaderpublic void validateReferenceInstanceHeader(String sourceName, String localMetadataCollectionId, String instanceParameterName, InstanceHeader instance, AuditLog auditLog, String methodName) throws InvalidParameterException, RepositoryErrorException Validates that an instance has the correct header for it to be a reference copy.- Specified by:
- validateReferenceInstanceHeaderin interface- OMRSRepositoryValidator
- 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
- auditLog- optional logging destination
- 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
 
- 
validateEntityProxypublic 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).- Specified by:
- validateEntityProxyin interface- OMRSRepositoryValidator
- 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
 
- 
verifyInstancePropertiesMatchSearchCriteriapublic boolean verifyInstancePropertiesMatchSearchCriteria(String sourceName, InstanceProperties properties, String searchCriteria, String methodName) throws RepositoryErrorException Search for property values matching the search criteria (a regular expression)- Specified by:
- verifyInstancePropertiesMatchSearchCriteriain interface- OMRSRepositoryValidator
- 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
 
- 
verifyInstancePropertiesMatchPropertyValuepublic boolean verifyInstancePropertiesMatchPropertyValue(String sourceName, InstanceProperties properties, String searchPropertyValue, String methodName) throws RepositoryErrorException Search for property values matching the supplied property value- Specified by:
- verifyInstancePropertiesMatchPropertyValuein interface- OMRSRepositoryValidator
- 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
 
- 
isATypeOfpublic 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.- Specified by:
- isATypeOfin interface- OMRSRepositoryValidator
- 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
 
- 
validateAtMostOneEntityResultpublic void validateAtMostOneEntityResult(List<EntityDetail> findResults, String typeName, String serviceName, String methodName) throws RepositoryErrorException Validate that either zero or one entity were returned from a find request. This is typically when searching for entities of a specific type using one of its unique properties.- Specified by:
- validateAtMostOneEntityResultin interface- OMRSRepositoryValidator
- 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
 
- 
validateAtMostOneRelationshipResultpublic void validateAtMostOneRelationshipResult(List<Relationship> findResults, String typeName, String serviceName, String methodName) throws RepositoryErrorException Validate that either zero or one relationship 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.- Specified by:
- validateAtMostOneRelationshipResultin interface- OMRSRepositoryValidator
- 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
 
 
-