Class ContributionRecordHandler<B>


public class ContributionRecordHandler<B> extends OpenMetadataAPIGenericHandler<B>
ContributionRecordHandler manages the ContributionRecord entity that records the karma points for an individual. There is on 1-1 relationship between the ActorProfile entity and the ContributionRecord and so the profile GUID is passed on the parameters. ContributionRecords are always maintainable by the local cohort.
  • Constructor Details

    • ContributionRecordHandler

      public ContributionRecordHandler(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, int karmaPointPlateau, AuditLog auditLog)
      Construct the handler information needed to interact with the repository services
      Parameters:
      converter - specific converter for this 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
      karmaPointPlateau - number of karma points to a plateau
      auditLog - destination for audit log events
  • Method Details

    • getContributionRecord

      public B getContributionRecord(String userId, String profileGUID, String profileGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Return the ContributionRecord attached to a supplied person profile.
      Parameters:
      userId - calling user
      profileGUID - identifier for the entity that the contribution record is attached to
      profileGUIDParameterName - name of parameter supplying the GUID
      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:
      list of objects or null if none found
      Throws:
      InvalidParameterException - the input properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • saveContributionRecord

      public void saveContributionRecord(String userId, String profileGUID, String profileGUIDParameterName, String qualifiedName, long karmaPoints, boolean isPublic, Map<String,String> additionalProperties, String suppliedTypeName, Map<String,Object> extendedProperties, boolean isMergeUpdate, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Set up the contribution values in a Person profile.
      Parameters:
      userId - userId of user making request.
      profileGUID - unique identifier for the connected Person entity.
      profileGUIDParameterName - parameter supplying the profileGUID
      qualifiedName - unique name for the profile
      karmaPoints - contribution points for the individual
      isPublic - can this information be shared with colleagues
      additionalProperties - additional properties for the contribution record
      extendedProperties - additional properties from defined subtypes
      suppliedTypeName - name of subtype or null
      isMergeUpdate - should the supplied properties be merged with existing properties (true) only replacing the properties with matching names, or should the entire properties of the instance be replaced?
      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 - the endpoint bean properties are invalid
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • removeContributionRecord

      public void removeContributionRecord(String userId, String profileGUID, String profileGUIDParameterName, boolean forLineage, boolean forDuplicateProcessing, Date effectiveTime, String methodName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
      Remove the requested contribution record.
      Parameters:
      userId - calling user
      profileGUID - unique identifier for the connected Person entity.
      profileGUIDParameterName - parameter supplying the profileGUID
      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 null or invalid.
      UserNotAuthorizedException - user not authorized to issue this request
      PropertyServerException - problem accessing the property server
    • getKarmaPointPlateau

      public int getKarmaPointPlateau(int karmaPointTotal)
      Return the karma point plateau for an individual.
      Parameters:
      karmaPointTotal - current points
      Returns:
      current plateau