Class ITProfileManagerClient
java.lang.Object
org.odpi.openmetadata.accessservices.itinfrastructure.client.ITProfileManagerClient
- All Implemented Interfaces:
ITProfileManagerInterface
OrganizationManagement is the client used by the Organization Integrator OMIS that is responsible with synchronizing organizational
structures, profiles rules and users with open metadata.
-
Constructor Summary
ConstructorDescriptionITProfileManagerClient
(String serverName, String serverPlatformURLRoot) Create a new client with no authentication embedded in the HTTP request.ITProfileManagerClient
(String serverName, String serverPlatformURLRoot, String userId, String password) Create a new client that passes userId and password in each HTTP request.ITProfileManagerClient
(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) Create a new client that passes userId and password in each HTTP request.ITProfileManagerClient
(String serverName, String serverPlatformURLRoot, ITInfrastructureRESTClient restClient, int maxPageSize) Create a new client that passes userId and password in each HTTP request.ITProfileManagerClient
(String serverName, String serverPlatformURLRoot, AuditLog auditLog) Create a new client with no authentication embedded in the HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionaddContactMethod
(String userId, String externalSourceGUID, String externalSourceName, String itProfileGUID, ContactMethodProperties properties) Add a new contact method to the profile.void
addIdentityToProfile
(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID, ProfileIdentityProperties properties) Link a user identity to a profile.createITProfile
(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itUserId, ITProfileProperties properties) Create a definition of an IT profile.createUserIdentity
(String userId, String externalSourceGUID, String externalSourceName, UserIdentityProperties newIdentity) Create a UserIdentity.void
deleteContactMethod
(String userId, String externalSourceGUID, String externalSourceName, String contactMethodGUID) Remove an obsolete contact method from the profile.void
deleteITProfile
(String userId, String externalSourceGUID, String externalSourceName, String itProfileGUID) Remove the definition of an IT profile.void
deleteUserIdentity
(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID) Remove a user identity object.findITProfile
(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of matching profiles for the search string.findUserIdentities
(String userId, String searchString, int startFrom, int pageSize) Retrieve the list of user identity metadata elements that contain the search string.getITProfileByGUID
(String userId, String itProfileGUID) Return information about a specific IT profile.getITProfileByName
(String userId, String name, int startFrom, int pageSize) Return information about a named IT profile.getITProfileByUserId
(String userId, String itProfileUserId) Return information about a specific IT profile.getUserIdentitiesByName
(String userId, String name, int startFrom, int pageSize) Retrieve the list of user identity metadata elements with a matching qualified name.getUserIdentityByGUID
(String userId, String userIdentityGUID) Retrieve the userIdentity metadata element with the supplied unique identifier.void
linkITInfrastructureToProfile
(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itProfileGUID, Date effectiveFrom, Date effectiveTo) Link a piece of infrastructure to an IT profile.void
removeIdentityFromProfile
(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID) Unlink a user identity from a profile.void
unlinkITInfrastructureFromProfile
(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itProfileGUID, Date effectiveTime) Remove the link between a piece of infrastructure to an IT profile.void
updateITInfrastructureToProfile
(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itProfileGUID, Date effectiveFrom, Date effectiveTo) Update the effectivity dates of a link from a piece of infrastructure to an IT profile.void
updateITProfile
(String userId, String externalSourceGUID, String externalSourceName, String itProfileGUID, boolean isMergeUpdate, ITProfileProperties properties) Update the definition of an IT profile.void
updateProfileIdentity
(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID, boolean isMergeUpdate, ProfileIdentityProperties properties) Update the properties of the relationship between a user identity and profile.void
updateUserIdentity
(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, boolean isMergeUpdate, UserIdentityProperties properties) Update a UserIdentity.
-
Constructor Details
-
ITProfileManagerClient
public ITProfileManagerClient(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 services- Throws:
InvalidParameterException
- bad input parameters
-
ITProfileManagerClient
public ITProfileManagerClient(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 servicesauditLog
- logging destination- Throws:
InvalidParameterException
- there is a problem creating the client-side components to issue any REST API calls.
-
ITProfileManagerClient
public ITProfileManagerClient(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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException
- bad input parameters
-
ITProfileManagerClient
public ITProfileManagerClient(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 servicesuserId
- caller's userId embedded in all HTTP requestspassword
- caller's userId embedded in all HTTP requestsauditLog
- logging destination- Throws:
InvalidParameterException
- bad input parameters
-
ITProfileManagerClient
public ITProfileManagerClient(String serverName, String serverPlatformURLRoot, ITInfrastructureRESTClient 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 servicesrestClient
- pre-initialized REST clientmaxPageSize
- pre-initialized parameter limit- Throws:
InvalidParameterException
- there is a problem with the information about the remote OMAS
-
-
Method Details
-
createITProfile
public String createITProfile(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itUserId, ITProfileProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Create a definition of an IT profile. If the itInfrastructureGUID is provided, it is connected to the infrastructure element that the profile describes using the ITInfrastructureProfile relationship. If the itUserId is specified, a UserIdentity for that userId is found/created and connected to the new IT profile.- Specified by:
createITProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitInfrastructureGUID
- unique identifier of the piece of IT infrastructure that is described by the new IT profile.itUserId
- user Id used by the IT Infrastructureproperties
- properties for a IT profile- Returns:
- unique identifier of IT profile
- Throws:
InvalidParameterException
- qualifiedName or userId is null; qualifiedName is not uniquePropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
updateITProfile
public void updateITProfile(String userId, String externalSourceGUID, String externalSourceName, String itProfileGUID, boolean isMergeUpdate, ITProfileProperties properties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the definition of an IT profile.- Specified by:
updateITProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitProfileGUID
- unique identifier of IT profileisMergeUpdate
- are unspecified properties unchanged (true) or replaced with null?properties
- properties to change- Throws:
InvalidParameterException
- guid, qualifiedName or userId is null; qualifiedName is not unique; guid is not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
deleteITProfile
public void deleteITProfile(String userId, String externalSourceGUID, String externalSourceName, String itProfileGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the definition of an IT profile.- Specified by:
deleteITProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitProfileGUID
- unique identifier of IT profile- Throws:
InvalidParameterException
- guid or userId is null; guid is not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
addContactMethod
public String addContactMethod(String userId, String externalSourceGUID, String externalSourceName, String itProfileGUID, ContactMethodProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Add a new contact method to the profile.- Specified by:
addContactMethod
in interfaceITProfileManagerInterface
- Parameters:
userId
- the name of the calling user.externalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitProfileGUID
- identifier of the profile to update.properties
- properties of contact method.- Returns:
- unique identifier (guid) for the new contact method.
- Throws:
InvalidParameterException
- the userId is null or invalid. Another property 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.
-
deleteContactMethod
public void deleteContactMethod(String userId, String externalSourceGUID, String externalSourceName, String contactMethodGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Remove an obsolete contact method from the profile.- Specified by:
deleteContactMethod
in interfaceITProfileManagerInterface
- Parameters:
userId
- the name of the calling user.externalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourcecontactMethodGUID
- unique identifier (guid) for the obsolete contact method.- Throws:
InvalidParameterException
- the userId is null or invalid. Another property 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.
-
linkITInfrastructureToProfile
public void linkITInfrastructureToProfile(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itProfileGUID, Date effectiveFrom, Date effectiveTo) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Link a piece of infrastructure to an IT profile.- Specified by:
linkITInfrastructureToProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitInfrastructureGUID
- unique identifier of the IT Infrastructure elementitProfileGUID
- unique identifier of the IT profileeffectiveFrom
- start date for the relationshipeffectiveTo
- end date for the relationship- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
updateITInfrastructureToProfile
public void updateITInfrastructureToProfile(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itProfileGUID, Date effectiveFrom, Date effectiveTo) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Update the effectivity dates of a link from a piece of infrastructure to an IT profile.- Specified by:
updateITInfrastructureToProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitInfrastructureGUID
- unique identifier of the IT Infrastructure elementitProfileGUID
- unique identifier of the IT profileeffectiveFrom
- start date for the relationshipeffectiveTo
- end date for the relationship- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
unlinkITInfrastructureFromProfile
public void unlinkITInfrastructureFromProfile(String userId, String externalSourceGUID, String externalSourceName, String itInfrastructureGUID, String itProfileGUID, Date effectiveTime) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Remove the link between a piece of infrastructure to an IT profile.- Specified by:
unlinkITInfrastructureFromProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling userexternalSourceGUID
- guid of the software server capability entity that represented the external source - null for localexternalSourceName
- name of the software server capability entity that represented the external sourceitInfrastructureGUID
- unique identifier of the IT Infrastructure elementitProfileGUID
- unique identifier of the IT profileeffectiveTime
- time that the relationship is active - null for any time- Throws:
InvalidParameterException
- one of the guids is null or not knownPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getITProfileByGUID
public ITProfileElement getITProfileByGUID(String userId, String itProfileGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a specific IT profile.- Specified by:
getITProfileByGUID
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling useritProfileGUID
- unique identifier for the IT profile- Returns:
- properties of the IT profile
- Throws:
InvalidParameterException
- itProfileGUID or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getITProfileByUserId
public ITProfileElement getITProfileByUserId(String userId, String itProfileUserId) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a specific IT profile.- Specified by:
getITProfileByUserId
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling useritProfileUserId
- unique identifier for the IT profile- Returns:
- properties of the IT profile
- Throws:
InvalidParameterException
- itProfileUserId or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
getITProfileByName
public List<ITProfileElement> getITProfileByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException Return information about a named IT profile.- Specified by:
getITProfileByName
in interfaceITProfileManagerInterface
- Parameters:
userId
- calling username
- unique name for the IT profilestartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching IT profiles (hopefully only one)
- Throws:
InvalidParameterException
- name or userId is nullPropertyServerException
- problem accessing property serverUserNotAuthorizedException
- security access problem
-
findITProfile
public List<ITProfileElement> findITProfile(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Retrieve the list of matching profiles for the search string.- Specified by:
findITProfile
in interfaceITProfileManagerInterface
- Parameters:
userId
- the name of the calling user.searchString
- RegEx string to search forstartFrom
- index of the list to start from (0 for start)pageSize
- maximum number of elements to return.- Returns:
- list of matching IT profiles
- Throws:
InvalidParameterException
- guid invalid or the external references are not correctly specified, or are null.PropertyServerException
- the server is not available.UserNotAuthorizedException
- the calling user is not authorized to issue the call.
-
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:
createUserIdentity
in interfaceITProfileManagerInterface
- 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:
updateUserIdentity
in interfaceITProfileManagerInterface
- 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:
deleteUserIdentity
in interfaceITProfileManagerInterface
- 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, ProfileIdentityProperties properties) 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:
addIdentityToProfile
in interfaceITProfileManagerInterface
- 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.properties
- the properties that describe how the owner of the profile uses the user identity- 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.
-
updateProfileIdentity
public void updateProfileIdentity(String userId, String externalSourceGUID, String externalSourceName, String userIdentityGUID, String profileGUID, boolean isMergeUpdate, ProfileIdentityProperties properties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException Update the properties of the relationship between a user identity and profile.- Specified by:
updateProfileIdentity
in interfaceITProfileManagerInterface
- 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
- additional userId for the profileprofileGUID
- the profile to add the identity toisMergeUpdate
- should the supplied properties be overlaid on the existing properties (true) or replace them (falseproperties
- the properties that describe how the owner of the profile uses the user identity- 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.- Specified by:
removeIdentityFromProfile
in interfaceITProfileManagerInterface
- 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:
findUserIdentities
in interfaceITProfileManagerInterface
- 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:
getUserIdentitiesByName
in interfaceITProfileManagerInterface
- 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:
getUserIdentityByGUID
in interfaceITProfileManagerInterface
- 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)
-