Class UserIdentityHandler<B>

  • Type Parameters:
    B - class that represents the user identity

    public class UserIdentityHandler<B>
    extends ReferenceableHandler<B>
    UserIdentityHandler provides the exchange of metadata about glossaries between the repository and the OMAS. Note user identities are governance metadata and are always defined with LOCAL-COHORT provenance. They also do not have support for effectivity dates.
    • Constructor Detail

      • UserIdentityHandler

        public UserIdentityHandler​(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

      • createUserIdentity

        public String createUserIdentity​(String userId,
                                         String externalSourceGUID,
                                         String externalSourceName,
                                         String profileGUID,
                                         String profileGUIDParameterName,
                                         String qualifiedName,
                                         Map<String,​String> additionalProperties,
                                         String suppliedTypeName,
                                         Map<String,​Object> extendedProperties,
                                         String methodName)
                                  throws InvalidParameterException,
                                         UserNotAuthorizedException,
                                         PropertyServerException
        Create the entity that represents a user identity. If the profileGUID is supplied, the profile becomes the anchor of the User Identity and they are linked together.
        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 - the unique identifier of the profile GUID that is the anchor of
        profileGUIDParameterName - parameter name supplying profileGUID
        qualifiedName - unique name for the user identity - used in other configuration
        additionalProperties - additional properties for a user identity
        suppliedTypeName - type name from the caller (enables creation of subtypes)
        extendedProperties - properties for a governance user identity subtype
        methodName - calling method
        Returns:
        unique identifier of the new user identity object
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • updateUserIdentity

        public void updateUserIdentity​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String userIdentityGUID,
                                       String userIdentityGUIDParameterName,
                                       String qualifiedName,
                                       Map<String,​String> additionalProperties,
                                       String typeName,
                                       Map<String,​Object> extendedProperties,
                                       boolean isMergeUpdate,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Update the entity that represents a user identity.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        userIdentityGUID - unique identifier of the user identity to update
        userIdentityGUIDParameterName - parameter passing the userIdentityGUID
        qualifiedName - unique name for the user identity - used in other configuration
        additionalProperties - additional properties for a governance user identity
        typeName - type of user identity
        extendedProperties - properties for a governance user identity subtype
        isMergeUpdate - should the supplied properties be overlaid on the existing properties (true) or replace them (false
        methodName - calling method
        Throws:
        InvalidParameterException - qualifiedName or userId is null
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • deleteUserIdentity

        public void deleteUserIdentity​(String userId,
                                       String externalSourceGUID,
                                       String externalSourceName,
                                       String userIdentityGUID,
                                       String userIdentityGUIDParameterName,
                                       String methodName)
                                throws InvalidParameterException,
                                       UserNotAuthorizedException,
                                       PropertyServerException
        Remove the metadata element representing a user identity.
        Parameters:
        userId - calling user
        externalSourceGUID - unique identifier of software server capability representing the caller
        externalSourceName - unique name of software server capability representing the caller
        userIdentityGUID - unique identifier of the metadata element to remove
        userIdentityGUIDParameterName - parameter supplying the user identityGUID
        methodName - calling method
        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)
      • addIdentityToProfile

        public void addIdentityToProfile​(String userId,
                                         String externalSourceGUID,
                                         String externalSourceName,
                                         String userIdentityGUID,
                                         String userIdentityGUIDParameterName,
                                         String profileGUID,
                                         String profileGUIDParameterName,
                                         String methodName)
                                  throws InvalidParameterException,
                                         UserNotAuthorizedException,
                                         PropertyServerException
        Link a user identity to a profile. This will fail if the user identity is already connected to a 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
        userIdentityGUID - unique identifier of the user identity
        userIdentityGUIDParameterName - parameter name supplying userIdentityGUID
        profileGUID - unique identifier of the profile
        profileGUIDParameterName - parameter name supplying profileGUID
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • removeIdentifyFromProfile

        public void removeIdentifyFromProfile​(String userId,
                                              String externalSourceGUID,
                                              String externalSourceName,
                                              String userIdentityGUID,
                                              String userIdentityGUIDParameterName,
                                              String profileGUID,
                                              String profileGUIDParameterName,
                                              String methodName)
                                       throws InvalidParameterException,
                                              UserNotAuthorizedException,
                                              PropertyServerException
        Unlink a user identity from a 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
        userIdentityGUID - unique identifier of the user identity
        userIdentityGUIDParameterName - parameter name supplying userIdentityGUID
        profileGUID - unique identifier of the profile
        profileGUIDParameterName - parameter name supplying profileGUID
        methodName - calling method
        Throws:
        InvalidParameterException - entity not known, null userId or guid
        PropertyServerException - problem accessing property server
        UserNotAuthorizedException - security access problem
      • getUserIdentitiesByName

        public List<B> getUserIdentitiesByName​(String userId,
                                               String name,
                                               String nameParameterName,
                                               int startFrom,
                                               int pageSize,
                                               String methodName)
                                        throws InvalidParameterException,
                                               UserNotAuthorizedException,
                                               PropertyServerException
        Retrieve the list of user identity metadata elements with a matching qualified 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
        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)