Class UserIdentityHandler
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
org.odpi.openmetadata.frameworks.openmetadata.handlers.UserIdentityHandler
UserIdentityHandler describes how to maintain and query user identities.
-
Field Summary
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
auditLog, classificationBuilder, elementBuilder, localServerName, localServiceName, metadataElementTypeName, openMetadataClient, propertyHelper, relationshipBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionUserIdentityHandler
(String localServerName, AuditLog auditLog, String serviceName, OpenMetadataClient openMetadataClient) Create a new handler. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSecurityGroupMembership
(String userId, String userIdentityGUID, SecurityGroupMembershipProperties properties, MetadataSourceOptions metadataSourceOptions) Add the SecurityGroupMembership classification to the user identity.createUserIdentity
(String userId, NewElementOptions newElementOptions, Map<String, ClassificationProperties> initialClassifications, UserIdentityProperties properties, RelationshipProperties parentRelationshipProperties) Create a new user identity.createUserIdentityFromTemplate
(String userId, TemplateOptions templateOptions, String templateGUID, ElementProperties replacementProperties, Map<String, String> placeholderProperties, RelationshipProperties parentRelationshipProperties) Create a new metadata element to represent a user identity using an existing element as a template.void
deleteUserIdentity
(String userId, String userIdentityGUID, DeleteOptions deleteOptions) Delete a user identity.void
detachProfileIdentity
(String userId, String userIdentityGUID, String profileGUID, DeleteOptions deleteOptions) Detach an actor profile from a user identity.findUserIdentities
(String userId, String searchString, SearchOptions searchOptions) Retrieve the list of user identities metadata elements that contain the search string.getUserIdentitiesByName
(String userId, String name, QueryOptions queryOptions) Returns the list of user identities with a particular name.getUserIdentityByGUID
(String userId, String userIdentityGUID, GetOptions getOptions) Return the properties of a specific user identity.void
linkIdentityToProfile
(String userId, String userIdentityGUID, String profileGUID, MetadataSourceOptions metadataSourceOptions, ProfileIdentityProperties relationshipProperties) Attach a profile to a user identity.void
removeAllSecurityGroupMembership
(String userId, String userIdentityGUID, MetadataSourceOptions metadataSourceOptions) Remove the SecurityGroupMembership classification from the user identity.void
updateSecurityGroupMembership
(String userId, String userIdentityGUID, UpdateOptions updateOptions, SecurityGroupMembershipProperties properties) Update the SecurityGroupMembership classification for the user identity.void
updateUserIdentity
(String userId, String userIdentityGUID, UpdateOptions updateOptions, UserIdentityProperties properties) Update the properties of a user identity.Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.handlers.OpenMetadataHandlerBase
addDefaultType, addDefaultType, addDefaultType, addMermaidToRootElement, convertMemberDataField, convertRootElement, convertRootElement, convertRootElements, convertSolutionComponent, convertSolutionPort, createElementFromTemplate, createNewElement, findRootElements, getElementRelatedElements, getFullParentContext, getInformationSupplyChainContext, getQueryOptions, getQueryOptions, getQueryOptions, getRelatedRootElements, getRootElementByGUID, getRootElementByUniqueName, getRootElementsByName, updateElement, updateElementStatus
-
Constructor Details
-
UserIdentityHandler
public UserIdentityHandler(String localServerName, AuditLog auditLog, String serviceName, OpenMetadataClient openMetadataClient) Create a new handler.- Parameters:
localServerName
- name of this server (view server)auditLog
- logging destinationserviceName
- local service nameopenMetadataClient
- access to open metadata
-
-
Method Details
-
createUserIdentity
public String createUserIdentity(String userId, NewElementOptions newElementOptions, Map<String, ClassificationProperties> initialClassifications, UserIdentityProperties properties, RelationshipProperties parentRelationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedExceptionCreate a new user identity.- Parameters:
userId
- userId of user making request.newElementOptions
- details of the element to createinitialClassifications
- map of classification names to classification properties to include in the entity creation requestproperties
- properties for the new element.parentRelationshipProperties
- properties to include in parent relationship- Returns:
- unique identifier of the newly created element
- Throws:
InvalidParameterException
- one of the parameters is invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
createUserIdentityFromTemplate
public String createUserIdentityFromTemplate(String userId, TemplateOptions templateOptions, String templateGUID, ElementProperties replacementProperties, Map<String, String> placeholderProperties, RelationshipProperties parentRelationshipProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerExceptionCreate a new metadata element to represent a user identity using an existing element as a template. The template defines additional classifications and relationships that should be added to the new user identity.- Parameters:
userId
- calling usertemplateOptions
- details of the element to createtemplateGUID
- the unique identifier of the existing asset to copy (this will copy all the attachments such as nested content, schema connection etc)replacementProperties
- properties of the new metadata element. These override the template valuesplaceholderProperties
- property name-to-property value map to replace any placeholder values in the template element - and their anchored elements, which are also copied as part of this operation.parentRelationshipProperties
- properties to include in parent relationship- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-
updateUserIdentity
public void updateUserIdentity(String userId, String userIdentityGUID, UpdateOptions updateOptions, UserIdentityProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update the properties of a user identity.- Parameters:
userId
- userId of user making request.userIdentityGUID
- unique identifier of the user identity (returned from create)updateOptions
- provides a structure for the additional options when updating an element.properties
- properties for the element.- Throws:
InvalidParameterException
- one of the parameters is invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
linkIdentityToProfile
public void linkIdentityToProfile(String userId, String userIdentityGUID, String profileGUID, MetadataSourceOptions metadataSourceOptions, ProfileIdentityProperties relationshipProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Attach a profile to a user identity.- Parameters:
userId
- userId of user making requestuserIdentityGUID
- unique identifier of the parentprofileGUID
- unique identifier of the actor profilemetadataSourceOptions
- options to control access to open metadatarelationshipProperties
- description of the relationship.- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
detachProfileIdentity
public void detachProfileIdentity(String userId, String userIdentityGUID, String profileGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Detach an actor profile from a user identity.- Parameters:
userId
- userId of user making request.userIdentityGUID
- unique identifier of the parent actor profileprofileGUID
- unique identifier of the nested actor profiledeleteOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
addSecurityGroupMembership
public void addSecurityGroupMembership(String userId, String userIdentityGUID, SecurityGroupMembershipProperties properties, MetadataSourceOptions metadataSourceOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Add the SecurityGroupMembership classification to the user identity.- Parameters:
userId
- userId of user making request.userIdentityGUID
- unique identifier of the user identity.properties
- properties for the classificationmetadataSourceOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
updateSecurityGroupMembership
public void updateSecurityGroupMembership(String userId, String userIdentityGUID, UpdateOptions updateOptions, SecurityGroupMembershipProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update the SecurityGroupMembership classification for the user identity.- Parameters:
userId
- userId of user making request.userIdentityGUID
- unique identifier of the user identity.updateOptions
- provides a structure for the additional options when updating a classification.properties
- properties for the classification- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
removeAllSecurityGroupMembership
public void removeAllSecurityGroupMembership(String userId, String userIdentityGUID, MetadataSourceOptions metadataSourceOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Remove the SecurityGroupMembership classification from the user identity.- Parameters:
userId
- userId of user making request.userIdentityGUID
- unique identifier of the user identity.metadataSourceOptions
- options to control access to open metadata- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
deleteUserIdentity
public void deleteUserIdentity(String userId, String userIdentityGUID, DeleteOptions deleteOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Delete a user identity.- Parameters:
userId
- userId of user making request.userIdentityGUID
- unique identifier of the elementdeleteOptions
- options for a delete request- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getUserIdentitiesByName
public List<OpenMetadataRootElement> getUserIdentitiesByName(String userId, String name, QueryOptions queryOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Returns the list of user identities with a particular name.- Parameters:
userId
- userId of user making requestname
- name of the element to return - match is full text match in qualifiedName or namequeryOptions
- multiple options to control the query- Returns:
- a list of elements
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
getUserIdentityByGUID
public OpenMetadataRootElement getUserIdentityByGUID(String userId, String userIdentityGUID, GetOptions getOptions) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Return the properties of a specific user identity.- Parameters:
userId
- userId of user making requestuserIdentityGUID
- unique identifier of the required elementgetOptions
- multiple options to control the query- Returns:
- retrieved properties
- Throws:
InvalidParameterException
- one of the parameters is null or invalid.PropertyServerException
- there is a problem retrieving information from the property server(s).UserNotAuthorizedException
- the requesting user is not authorized to issue this request.
-
findUserIdentities
public List<OpenMetadataRootElement> findUserIdentities(String userId, String searchString, SearchOptions searchOptions) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Retrieve the list of user identities metadata elements that contain the search string. The search string is treated as a regular expression.- Parameters:
userId
- calling usersearchString
- string to find in the propertiessearchOptions
- multiple options to control the query- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException
- one of the parameters is invalidUserNotAuthorizedException
- the user is not authorized to issue this requestPropertyServerException
- there is a problem reported in the open metadata server(s)
-