Class UserIdentityManagement
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.communityprofile.client.UserIdentityManagement
-
- All Implemented Interfaces:
UserIdentityManagementInterface
public class UserIdentityManagement extends Object implements UserIdentityManagementInterface
UserIdentityManagement is the client for explicitly managing the user identity entities and associating them with profiles. It is typically used when the relationship between user identities and profiles are many to one.
-
-
Constructor Summary
Constructors Constructor Description UserIdentityManagement(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.UserIdentityManagement(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.UserIdentityManagement(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.UserIdentityManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize)Create a new client that passes userId and password in each HTTP request.UserIdentityManagement(String serverName, String serverPlatformURLRoot, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddIdentityToProfile(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID)Link a user identity to a profile.StringcreateUserIdentity(String userId, String externalSourceGUID, String externalSourceName, UserIdentityProperties newIdentity)Create a UserIdentity.voiddeleteUserIdentity(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID)Remove a user identity object.List<UserIdentityElement>findUserIdentities(String userId, String searchString, int startFrom, int pageSize)Retrieve the list of user identity metadata elements that contain the search string.List<UserIdentityElement>getUserIdentitiesByName(String userId, String name, int startFrom, int pageSize)Retrieve the list of user identity metadata elements with a matching qualified name.UserIdentityElementgetUserIdentityByGUID(String userId, String userIdentityGUID)Retrieve the userIdentity metadata element with the supplied unique identifier.voidremoveIdentityFromProfile(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID)Unlink a user identity from a profile.voidupdateUserIdentity(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, boolean isMergeUpdate, UserIdentityProperties properties)Update a UserIdentity.
-
-
-
Constructor Detail
-
UserIdentityManagement
public UserIdentityManagement(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- bad input parameters
-
UserIdentityManagement
public UserIdentityManagement(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
UserIdentityManagement
public UserIdentityManagement(String serverName, String serverPlatformURLRoot, String userId, String password) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- bad input parameters
-
UserIdentityManagement
public UserIdentityManagement(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requestsauditLog- logging destination- Throws:
InvalidParameterException- bad input parameters
-
UserIdentityManagement
public UserIdentityManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- pre-initialized REST clientmaxPageSize- pre-initialized parameter limit- Throws:
InvalidParameterException- there is a problem with the information about the remote OMAS
-
-
Method Detail
-
createUserIdentity
public String createUserIdentity(String userId, String externalSourceGUID, String externalSourceName, UserIdentityProperties newIdentity) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Create a UserIdentity. This is not connected to a profile.- Specified by:
createUserIdentityin interfaceUserIdentityManagementInterface- Parameters:
userId- the name of the calling user.externalSourceGUID- unique identifier of software server capability representing the callerexternalSourceName- unique name of software server capability representing the callernewIdentity- properties for the new userIdentity.- Returns:
- unique identifier of the UserIdentity
- 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.
-
updateUserIdentity
public void updateUserIdentity(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, boolean isMergeUpdate, UserIdentityProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Update a UserIdentity.- Specified by:
updateUserIdentityin interfaceUserIdentityManagementInterface- Parameters:
userId- the name of the calling userexternalSourceGUID- unique identifier of software server capability representing the callerexternalSourceName- unique name of software server capability representing the calleruserIdentityGUID- unique identifier of the UserIdentityisMergeUpdate- should the supplied properties be overlaid on the existing properties (true) or replace them (falseproperties- updated properties for the new userIdentity- 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.
-
deleteUserIdentity
public void deleteUserIdentity(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove a user identity object. This will fail if the profile would be left without an associated user identity.- Specified by:
deleteUserIdentityin interfaceUserIdentityManagementInterface- Parameters:
userId- the name of the calling userexternalSourceGUID- unique identifier of software server capability representing the callerexternalSourceName- unique name of software server capability representing the calleruserIdentityGUID- unique identifier of the UserIdentity- 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.
-
addIdentityToProfile
public void addIdentityToProfile(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Link a user identity to a profile. This will fail if the user identity is already connected to a profile.- Specified by:
addIdentityToProfilein interfaceUserIdentityManagementInterface- Parameters:
userId- the name of the calling user.externalSourceGUID- unique identifier of software server capability representing the callerexternalSourceName- unique name of software server capability representing the callerprofileGUID- the profile to add the identity to.userIdentityGUID- additional userId for the profile.- 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.
-
removeIdentityFromProfile
public void removeIdentityFromProfile(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Unlink a user identity from a profile. This will fail if the profile would be left without an associated user identity.- Specified by:
removeIdentityFromProfilein interfaceUserIdentityManagementInterface- Parameters:
userId- the name of the calling user.externalSourceGUID- unique identifier of software server capability representing the callerexternalSourceName- unique name of software server capability representing the calleruserIdentityGUID- unique identifier of the UserIdentityprofileGUID- profile to remove it from.- 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.
-
findUserIdentities
public List<UserIdentityElement> findUserIdentities(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of user identity metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findUserIdentitiesin interfaceUserIdentityManagementInterface- Parameters:
userId- calling usersearchString- string to find in the propertiesstartFrom- paging start pointpageSize- maximum results that can be returned- 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)
-
getUserIdentitiesByName
public List<UserIdentityElement> getUserIdentitiesByName(String userId, String name, int startFrom, int pageSize) 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.- Specified by:
getUserIdentitiesByNamein interfaceUserIdentityManagementInterface- Parameters:
userId- calling username- name to search forstartFrom- paging start pointpageSize- maximum results that can be returned- 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)
-
getUserIdentityByGUID
public UserIdentityElement getUserIdentityByGUID(String userId, String userIdentityGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the userIdentity metadata element with the supplied unique identifier.- Specified by:
getUserIdentityByGUIDin interfaceUserIdentityManagementInterface- Parameters:
userId- calling useruserIdentityGUID- unique identifier of the requested metadata element- Returns:
- matching 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)
-
-