Class ValidValuesHandler<B>


public class ValidValuesHandler<B> extends ReferenceableHandler<B>
ValidValuesHandler provides the methods to create and maintain lists of valid value definitions grouped into a valid value set. Both valid value definitions and valid value sets have the same attributes and so inherit from ValidValue where all the attributes are defined.

A set is just grouping of valid values. Valid value definitions and set can be nested many times in other valid value sets.

  • Constructor Details

    • ValidValuesHandler

      public ValidValuesHandler(OpenMetadataAPIGenericConverter<B> converter, Class<B> beanClass, String serviceName, String serverName, InvalidParameterHandler invalidParameterHandler, RepositoryHandler repositoryHandler, OMRSRepositoryHelper repositoryHelper, String localServerUserId, OpenMetadataServerSecurityVerifier securityVerifier, List<String> supportedZones, List<String> defaultZones, List<String> publishZones, AuditLog auditLog)
      Construct the handler information needed to interact with the repository services
      Parameters:
      converter - specific converter for the B bean class
      beanClass - name of bean class that is represented by the generic class B
      serviceName - name of this service
      serverName - name of the local server
      invalidParameterHandler - handler for managing parameter errors
      repositoryHandler - manages calls to the repository services
      repositoryHelper - provides utilities for manipulating the repository services objects
      localServerUserId - userId for this server
      securityVerifier - open metadata security services verifier
      supportedZones - list of zones that the access service is allowed to serve Asset instances from.
      defaultZones - list of zones that the access service should set in all new Asset instances.
      publishZones - list of zones that the access service sets up in published Asset instances.
      auditLog - destination for audit log events.
  • Method Details

    • createValidValue

      public String createValidValue(String userId, String externalSourceGUID, String externalSourceName, String anchorGUID, String setGUID, String suppliedTypeName, boolean isDefaultValue, String qualifiedName, String displayName, String description, String category, String usage, String scope, String preferredValue, String dataType, String userDefinedStatus, boolean isCaseSensitive, Map<String,String> additionalProperties, Map<String,Object> extendedProperties, List<String> suppliedSupportedZones, Date effectiveFrom, Date effectiveTo, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a new valid value definition.
      Parameters:
      userId - calling user.
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      anchorGUID - unique identifier of the anchor for this valid value
      setGUID - unique identifier of the set to attach this to
      suppliedTypeName - name of the type to create
      isDefaultValue - is this the default value for the set?
      qualifiedName - unique name
      displayName - displayable descriptive name.
      description - further information.
      category - what is the category of reference data does this fall into?
      usage - how/when should this value be used.
      scope - what is the scope of the values.
      preferredValue - the value that should be used in an implementation if possible.
      dataType - the data type of the preferred value.
      userDefinedStatus - is the valid value deprecated
      isCaseSensitive - is the valid value case-sensitive
      additionalProperties - additional properties for this definition.
      extendedProperties - properties that need to be populated into a subtype.
      suppliedSupportedZones - list of zones that any asset must be a member of at least one to be visible
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      unique identifier for the new definition
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      UserNotAuthorizedException - the user is not authorized to make this request.
      PropertyServerException - the repository is not available or not working properly.
    • deleteValidValue

      public void deleteValidValue(String userId, String externalSourceGUID, String externalSourceName, String validValueGUID, String qualifiedName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Remove the valid value form the repository. All links to it are deleted too.
      Parameters:
      userId - calling user
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      validValueGUID - unique identifier of the value to delete
      qualifiedName - unique name of the value to delete. This is used to verify that the correct valid value is being deleted.
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      UserNotAuthorizedException - the user is not authorized to make this request.
      PropertyServerException - the repository is not available or not working properly.
    • attachConsistentValidValues

      public void attachConsistentValidValues(String userId, String externalSourceGUID, String externalSourceName, String validValue1GUID, String validValue2GUID, Date effectiveFrom, Date effectiveTo, List<String> suppliedSupportedZones, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Create a link between two valid values that should be used together to populate or validate elements for consistency.
      Parameters:
      userId - calling user.
      externalSourceGUID - guid of the software capability entity that represented the external source - null for local
      externalSourceName - name of the software capability entity that represented the external source
      validValue1GUID - unique identifier of first valid value
      validValue2GUID - unique identifier of second valid value
      suppliedSupportedZones - list of zones that any asset must be a member of at least one to be visible
      effectiveFrom - starting time for this relationship (null for all time)
      effectiveTo - ending time for this relationship (null for all time)
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      UserNotAuthorizedException - the user is not authorized to make this request.
      PropertyServerException - the repository is not available or not working properly.
    • getValidValueSetMembers

      public List<B> getValidValueSetMembers(String userId, String validValueSetGUID, String validValueSetGUIDParameter, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, List<String> suppliedSupportedZones, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Page through the members of a valid value set.
      Parameters:
      userId - calling user
      validValueSetGUID - unique identifier of the valid value set
      validValueSetGUIDParameter - name of parameter providing the validValueSetGUID
      startFrom - paging starting point
      pageSize - maximum number of return values.
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      suppliedSupportedZones - list of zones that any asset must be a member of at least one to be visible
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      list of valid value beans
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      UserNotAuthorizedException - the user is not authorized to make this request.
      PropertyServerException - the repository is not available or not working properly.
    • getConsistentValidValues

      public List<B> getConsistentValidValues(String userId, String validValueGUID, String validValueGUIDParameter, int startFrom, int pageSize, boolean forLineage, boolean forDuplicateProcessing, List<String> suppliedSupportedZones, Date effectiveTime, String methodName) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
      Page through the consistent values from different valid value sets.
      Parameters:
      userId - calling user
      validValueGUID - unique identifier of the valid value set
      validValueGUIDParameter - name of parameter providing the validValueGUID
      startFrom - paging starting point
      pageSize - maximum number of return values.
      forLineage - the request is to support lineage retrieval this means entities with the Memento classification can be returned
      forDuplicateProcessing - the request is for duplicate processing and so must not deduplicate
      suppliedSupportedZones - list of zones that any asset must be a member of at least one to be visible
      effectiveTime - the time that the retrieved elements must be effective for (null for any time, new Date() for now)
      methodName - calling method
      Returns:
      list of valid value beans
      Throws:
      InvalidParameterException - one of the parameters is invalid.
      UserNotAuthorizedException - the user is not authorized to make this request.
      PropertyServerException - the repository is not available or not working properly.