Class PersonRoleHandler<B>

  • Type Parameters:
    B - class that represents the role

    public class PersonRoleHandler<B>
    extends ReferenceableHandler<B>
    PersonRoleHandler provides the exchange of metadata about roles between the repository and the OMAS. The PersonRole entity does not support effectivity dates - but appointments - ie links between person roles and actors do need effectivity dates
    • Constructor Detail

      • PersonRoleHandler

        public PersonRoleHandler​(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 with information needed to work with B objects.
        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 B instances from
        defaultZones - list of zones that the access service should set in all new B instances
        publishZones - list of zones that the access service sets up in published B instances
        auditLog - destination for audit log events
    • Method Detail

      • createPersonRole

        public String createPersonRole​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String qualifiedName,
                                       String name,
                                       String description,
                                       String scope,
                                       int headCount,
                                       boolean headCountLimitSet,
                                       Map<String,​String> additionalProperties,
                                       String suppliedTypeName,
                                       Map<String,​Object> extendedProperties,
                                       Date effectiveFrom,
                                       Date effectiveTo,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Create the description of a role. This is typically a subtype of PersonRole.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        qualifiedName - unique name for the role - used in other configuration
        name - short display name for the role
        description - description of the role
        scope - the scope of the role
        headCount - number of individuals that can be appointed to this role
        headCountLimitSet - should the headcount be added to the entity?
        additionalProperties - additional properties for a role
        suppliedTypeName - type name from the caller (enables creation of subtypes)
        extendedProperties - properties for a governance role subtype
        methodName - calling method
        Returns:
        unique identifier of the new role object
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • createPersonRoleFromTemplate

        public String createPersonRoleFromTemplate​(String userId,
                                                   String externalSourceGUID,
                                                   String externalSourceName,
                                                   String templateGUID,
                                                   String qualifiedName,
                                                   String name,
                                                   String description,
                                                   int headCount,
                                                   boolean headCountLimitSet,
                                                   String methodName)
                                            throws InvalidParameterException,
                                                   UserNotAuthorizedException,
                                                   PropertyServerException
        Create a new metadata element to represent a role using an existing metadata element as a template. The template defines additional classifications and relationships that should be added to the new role.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        templateGUID - unique identifier of the metadata element to copy
        qualifiedName - unique name for the role - used in other configuration
        name - short display name for the role
        description - description of the governance role
        headCount - number of individuals that can be appointed to this role
        headCountLimitSet - should the headcount value be set in the entity?
        methodName - calling method
        Returns:
        unique identifier of the new metadata element
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • appointPersonToRole

        public String appointPersonToRole​(String userId,
                                          String externalSourceGUID,
                                          String externalSourceName,
                                          String profileGUID,
                                          String profileGUIDParameterName,
                                          String roleGUID,
                                          String roleGUIDParameterName,
                                          boolean isPublic,
                                          Date effectiveFrom,
                                          Date effectiveTo,
                                          String methodName)
                                   throws InvalidParameterException,
                                          UserNotAuthorizedException,
                                          PropertyServerException
        Link a person role with a Person profile to show that the person has been appointed to role.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        profileGUID - unique identifier of actor profile
        profileGUIDParameterName - parameter name supplying profileGUID
        roleGUID - unique identifier of the person role
        roleGUIDParameterName - parameter name supplying roleGUID
        isPublic - is this appointment visible to others
        effectiveFrom - the official start date of the appointment - null means effective immediately
        effectiveFrom - the official end date of the appointment - null means unknown
        methodName - calling method
        Returns:
        unique identifier of the appointment relationship
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateAppointment

        public void updateAppointment​(String userId,
                                      String externalSourceGUID,
                                      String externalSourceName,
                                      String appointmentGUID,
                                      String appointmentGUIDParameterName,
                                      boolean isPublic,
                                      Date effectiveFrom,
                                      Date effectiveTo,
                                      boolean isMergeUpdate,
                                      String methodName)
                               throws InvalidParameterException,
                                      UserNotAuthorizedException,
                                      PropertyServerException
        Update the properties in an appointment relationship.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        appointmentGUID - relationship GUID
        appointmentGUIDParameterName - property for appointmentGUID
        isPublic - is this appointment visible to others
        effectiveFrom - the official start date of the appointment - null means effective immediately
        effectiveFrom - the official end date of the appointment - null means unknown
        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?
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • relievePersonFromRole

        public void relievePersonFromRole​(String userId,
                                          String externalSourceGUID,
                                          String externalSourceName,
                                          String profileGUID,
                                          String profileGUIDParameterName,
                                          String roleGUID,
                                          String roleGUIDParameterName,
                                          String appointmentGUID,
                                          String appointmentGUIDParameterName,
                                          Date endDate,
                                          String methodName)
                                   throws InvalidParameterException,
                                          UserNotAuthorizedException,
                                          PropertyServerException
        Set an end date on a specific appointment.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        profileGUID - unique identifier of person profile
        profileGUIDParameterName - parameter name supplying profileGUID
        roleGUID - unique identifier of the person role
        roleGUIDParameterName - parameter name supplying roleGUID
        appointmentGUID - unique identifier (guid) of the appointment relationship
        appointmentGUIDParameterName - parameter name supplying appointmentGUID
        endDate - the official end of the appointment - null means effective immediately
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addTeamLeader

        public void addTeamLeader​(String userId,
                                  String externalSourceGUID,
                                  String externalSourceName,
                                  String teamLeaderRoleGUID,
                                  String teamLeaderRoleGUIDParameterName,
                                  String teamGUID,
                                  String teamGUIDParameterName,
                                  String position,
                                  Date effectiveFrom,
                                  Date effectiveTo,
                                  String methodName)
                           throws InvalidParameterException,
                                  UserNotAuthorizedException,
                                  PropertyServerException
        Link a team leader role to a team profile.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        teamLeaderRoleGUID - unique identifier of TeamLeader role
        teamLeaderRoleGUIDParameterName - parameter name supplying teamLeaderRoleGUID
        teamGUID - unique identifier of the user identity
        teamGUIDParameterName - parameter name supplying teamGUID
        position - optional name of position
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeTeamLeader

        public void removeTeamLeader​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String teamLeaderRoleGUID,
                                     String teamLeaderRoleGUIDParameterName,
                                     String teamGUID,
                                     String teamGUIDParameterName,
                                     Date effectiveTime,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Unlink a team leader role from a team profile.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        teamLeaderRoleGUID - unique identifier of TeamLeader role
        teamLeaderRoleGUIDParameterName - parameter name supplying teamLeaderRoleGUID
        teamGUID - unique identifier of the user identity
        teamGUIDParameterName - parameter name supplying teamGUID
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • addTeamMember

        public void addTeamMember​(String userId,
                                  String externalSourceGUID,
                                  String externalSourceName,
                                  String teamMemberRoleGUID,
                                  String teamMemberRoleGUIDParameterName,
                                  String teamGUID,
                                  String teamGUIDParameterName,
                                  String position,
                                  Date effectiveFrom,
                                  Date effectiveTo,
                                  String methodName)
                           throws InvalidParameterException,
                                  UserNotAuthorizedException,
                                  PropertyServerException
        Link a team member role to a team profile.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        teamMemberRoleGUID - unique identifier of TeamMember role
        teamMemberRoleGUIDParameterName - parameter name supplying teamMemberRoleGUID
        teamGUID - unique identifier of the user identity
        teamGUIDParameterName - parameter name supplying teamGUID
        position - optional name of position
        effectiveFrom - starting time for this relationship (null for all time)
        effectiveTo - ending time for this relationship (null for all time)
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeTeamMember

        public void removeTeamMember​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String teamMemberRoleGUID,
                                     String teamMemberRoleGUIDParameterName,
                                     String teamGUID,
                                     String teamGUIDParameterName,
                                     Date effectiveTime,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Unlink a team member role from a team profile.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        teamMemberRoleGUID - unique identifier of TeamMember role
        teamMemberRoleGUIDParameterName - parameter name supplying teamMemberRoleGUID
        teamGUID - unique identifier of the user identity
        teamGUIDParameterName - parameter name supplying teamGUID
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updatePersonRole

        public void updatePersonRole​(String userId,
                                     String externalSourceGUID,
                                     String externalSourceName,
                                     String roleGUID,
                                     String roleGUIDParameterName,
                                     String qualifiedName,
                                     String qualifiedNameParameterName,
                                     String name,
                                     String nameParameterName,
                                     String description,
                                     String scope,
                                     int headCount,
                                     boolean headCountLimitSet,
                                     Map<String,​String> additionalProperties,
                                     String typeName,
                                     Map<String,​Object> extendedProperties,
                                     boolean isMergeUpdate,
                                     Date effectiveFrom,
                                     Date effectiveTo,
                                     String methodName)
                              throws InvalidParameterException,
                                     UserNotAuthorizedException,
                                     PropertyServerException
        Update the person role object.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        roleGUID - unique identifier of the role to update
        roleGUIDParameterName - parameter passing the roleGUID
        qualifiedName - unique name for the role - used in other configuration
        qualifiedNameParameterName - parameter providing qualified name
        name - short display name for the role
        nameParameterName - parameter providing name
        description - description of the role
        scope - the scope of the role
        headCountLimitSet - should the head count be set in the entity?
        headCount - number of individuals that can be appointed to this role
        additionalProperties - additional properties for a governance role
        typeName - type of role
        extendedProperties - properties for a governance role subtype
        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?
        effectiveFrom - starting time for this element (null for all time)
        effectiveTo - ending time for this element (null for all time)
        methodName - calling method
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • findPersonRoles

        public List<B> findPersonRoles​(String userId,
                                       String searchString,
                                       String searchStringParameterName,
                                       int startFrom,
                                       int pageSize,
                                       Date effectiveTime,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Retrieve the list of role metadata elements that contain the search string. The search string is treated as a regular expression.
        Parameters:
        userId - calling user
        searchString - string to find in the properties
        searchStringParameterName - name of parameter supplying the search string
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getPersonRolesByName

        public List<B> getPersonRolesByName​(String userId,
                                            String name,
                                            String nameParameterName,
                                            int startFrom,
                                            int pageSize,
                                            Date effectiveTime,
                                            String methodName)
                                     throws InvalidParameterException,
                                            UserNotAuthorizedException,
                                            PropertyServerException
        Retrieve the list of role metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        userId - calling user
        name - name to search for
        nameParameterName - parameter supplying name
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getPersonRolesForRoleId

        public List<B> getPersonRolesForRoleId​(String userId,
                                               String name,
                                               String nameParameterName,
                                               int startFrom,
                                               int pageSize,
                                               Date effectiveTime,
                                               String methodName)
                                        throws InvalidParameterException,
                                               UserNotAuthorizedException,
                                               PropertyServerException
        Retrieve the list of role metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        userId - calling user
        name - name to search for
        nameParameterName - parameter supplying name
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getPersonRolesForTitle

        public List<B> getPersonRolesForTitle​(String userId,
                                              String name,
                                              String nameParameterName,
                                              int startFrom,
                                              int pageSize,
                                              Date effectiveTime,
                                              String methodName)
                                       throws InvalidParameterException,
                                              UserNotAuthorizedException,
                                              PropertyServerException
        Retrieve the list of role metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        userId - calling user
        name - name to search for
        nameParameterName - parameter supplying name
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)
      • getPersonRolesForDomainId

        public List<B> getPersonRolesForDomainId​(String userId,
                                                 int domainIdentifier,
                                                 int startFrom,
                                                 int pageSize,
                                                 Date effectiveTime,
                                                 String methodName)
                                          throws InvalidParameterException,
                                                 UserNotAuthorizedException,
                                                 PropertyServerException
        Retrieve the list of role metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
        Parameters:
        userId - calling user
        domainIdentifier - domain of interest - 0 means all domains
        startFrom - paging start point
        pageSize - maximum results that can be returned
        effectiveTime - the time that the retrieved elements must be effective for
        methodName - calling method
        Returns:
        list of matching metadata elements
        Throws:
        InvalidParameterException - one of the parameters is invalid
        UserNotAuthorizedException - the user is not authorized to issue this request
        PropertyServerException - there is a problem reported in the open metadata server(s)