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 Person entity and the ContributionRecord and so the profile GUID is passed on the parameters. ContributionRecords are always maintainable by the local cohort.
    • Constructor Detail

      • 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 Detail

      • 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,
                                           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
        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
      • getKarmaPointPlateau

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