Class PersonalProfileManagement
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.communityprofile.client.PersonalProfileManagement
-
- All Implemented Interfaces:
PersonalProfileManagementInterface
public class PersonalProfileManagement extends Object implements PersonalProfileManagementInterface
CommunityProfileLeadership provides the client-side interface for the Governance Program Open Metadata Access Service (OMAS). This client, manages all of the interaction with an open metadata repository. It is initialized with the URL of the server that is running the Open Metadata Access Services. This server is responsible for locating and managing the governance program definitions exchanged with this client.
-
-
Constructor Summary
Constructors Constructor Description PersonalProfileManagement(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.PersonalProfileManagement(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.PersonalProfileManagement(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.PersonalProfileManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize)Create a new client that passes userId and password in each HTTP request.PersonalProfileManagement(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 StringaddContactMethod(String userId, String externalSourceGUID, String externalSourceName, String profileUserId, ContactMethodType type, String service, String value)Add a new contact method to the requesting user's profile.StringcreatePersonalProfile(String userId, String externalSourceGUID, String externalSourceName, String profileUserId, String qualifiedName, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,String> additionalProperties)Create a personal profile for an individual who is to be appointed to a governance role but does not have a profile in open metadata.voiddeleteContactMethod(String userId, String externalSourceGUID, String externalSourceName, String profileUserId, String contactMethodGUID, ContactMethodType type)Remove an obsolete contact method from the requesting user's profile.voiddeletePersonalProfile(String userId, String externalSourceGUID, String externalSourceName, String profileGUID, String qualifiedName)Delete the personal profile.List<ContactMethodProperties>getContactMethods(String userId, String profileUserId)Return the list of contact methods for this user.longgetKarmaPoints(String userId, String profileUserId)Return the total karma points for this user.PersonalProfileUniversegetPersonalProfileByGUID(String userId, String profileGUID)Retrieve a personal profile by guid.PersonalProfileUniversegetPersonalProfileByQualifiedName(String userId, String qualifiedName)Retrieve a personal profile by personnel/serial/unique employee number of the individual.PersonalProfileUniversegetPersonalProfileForUser(String userId, String profileUserId)Retrieve a personal profile by userId.List<PersonalProfileUniverse>getPersonalProfilesByName(String userId, String name)Return a list of candidate personal profiles for an individual.voidupdatePersonalProfile(String userId, String externalSourceGUID, String externalSourceName, String profileGUID, String qualifiedName, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,Object> profileProperties, Map<String,String> additionalProperties)Update properties for the personal properties.
-
-
-
Constructor Detail
-
PersonalProfileManagement
public PersonalProfileManagement(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
-
PersonalProfileManagement
public PersonalProfileManagement(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.
-
PersonalProfileManagement
public PersonalProfileManagement(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
-
PersonalProfileManagement
public PersonalProfileManagement(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
-
PersonalProfileManagement
public PersonalProfileManagement(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
-
createPersonalProfile
public String createPersonalProfile(String userId, String externalSourceGUID, String externalSourceName, String profileUserId, String qualifiedName, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,String> additionalProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Create a personal profile for an individual who is to be appointed to a governance role but does not have a profile in open metadata.- Specified by:
createPersonalProfilein interfacePersonalProfileManagementInterface- 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 sourceprofileUserId- userId of the individual whose profile this is.qualifiedName- personnel/serial/unique employee number of the individual.fullName- full name of the person.knownName- known name or nickname of the individual.jobTitle- job title of the individual.jobRoleDescription- job description of the individual.additionalProperties- additional properties about the individual.- Returns:
- Unique identifier for the personal profile.
- Throws:
InvalidParameterException- the employee number or full name is null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
updatePersonalProfile
public void updatePersonalProfile(String userId, String externalSourceGUID, String externalSourceName, String profileGUID, String qualifiedName, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,Object> profileProperties, Map<String,String> additionalProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Update properties for the personal properties. Null values result in empty fields in the profile.- Specified by:
updatePersonalProfilein interfacePersonalProfileManagementInterface- 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 sourceprofileGUID- unique identifier for the profile.qualifiedName- personnel/serial/unique employee number of the individual. Used to verify the profileGUID.fullName- full name of the person.knownName- known name or nickname of the individual.jobTitle- job title of the individual.jobRoleDescription- job description of the individual.profileProperties- properties about the individual for a new type that is the subclass of Person.additionalProperties- additional properties about the individual.- Throws:
InvalidParameterException- the known name is null or the qualifiedName does not match the profileGUID.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
deletePersonalProfile
public void deletePersonalProfile(String userId, String externalSourceGUID, String externalSourceName, String profileGUID, String qualifiedName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Delete the personal profile.- Specified by:
deletePersonalProfilein interfacePersonalProfileManagementInterface- 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 sourceprofileGUID- unique identifier for the profile.qualifiedName- personnel/serial/unique employee number of the individual.- Throws:
InvalidParameterException- the qualifiedName or guid is null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getKarmaPoints
public long getKarmaPoints(String userId, String profileUserId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the total karma points for this user.- Specified by:
getKarmaPointsin interfacePersonalProfileManagementInterface- Parameters:
userId- userId of the user making the request.profileUserId- userId of the profile to update.- Returns:
- int count of karma points
- Throws:
InvalidParameterException- the userId 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.
-
getContactMethods
public List<ContactMethodProperties> getContactMethods(String userId, String profileUserId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of contact methods for this user.- Specified by:
getContactMethodsin interfacePersonalProfileManagementInterface- Parameters:
userId- userId of the user making the request.profileUserId- userId of the profile to update.- Returns:
- list of contact methods
- Throws:
InvalidParameterException- the userId 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.
-
addContactMethod
public String addContactMethod(String userId, String externalSourceGUID, String externalSourceName, String profileUserId, ContactMethodType type, String service, String value) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Add a new contact method to the requesting user's profile.- Specified by:
addContactMethodin interfacePersonalProfileManagementInterface- 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 sourceprofileUserId- userId of the profile to update.type- type of contact method.service- service for the contact method.value- account name for the service.- 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 profileUserId, String contactMethodGUID, ContactMethodType type) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove an obsolete contact method from the requesting user's profile.- Specified by:
deleteContactMethodin interfacePersonalProfileManagementInterface- 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 sourceprofileUserId- userId of the profile to update.contactMethodGUID- unique identifier (guid) for the obsolete contact method.type- type of contact method. This is used to confirm that the GUID is the right one.- 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.
-
getPersonalProfileByGUID
public PersonalProfileUniverse getPersonalProfileByGUID(String userId, String profileGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve a personal profile by guid.- Specified by:
getPersonalProfileByGUIDin interfacePersonalProfileManagementInterface- Parameters:
userId- the name of the calling user.profileGUID- unique identifier for the profile.- Returns:
- personal profile object.
- Throws:
InvalidParameterException- one of the parameters is invalid.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getPersonalProfileForUser
public PersonalProfileUniverse getPersonalProfileForUser(String userId, String profileUserId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve a personal profile by userId.- Specified by:
getPersonalProfileForUserin interfacePersonalProfileManagementInterface- Parameters:
userId- the name of the calling user.profileUserId- userId associated with the profile.- Returns:
- personal profile object.
- Throws:
InvalidParameterException- one of the parameters is invalid.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getPersonalProfileByQualifiedName
public PersonalProfileUniverse getPersonalProfileByQualifiedName(String userId, String qualifiedName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Retrieve a personal profile by personnel/serial/unique employee number of the individual.- Specified by:
getPersonalProfileByQualifiedNamein interfacePersonalProfileManagementInterface- Parameters:
userId- the name of the calling user.qualifiedName- personnel/serial/unique employee number of the individual.- Returns:
- personal profile object.
- Throws:
InvalidParameterException- the employee number.PropertyServerException- the server is not available, or there is a problem retrieving the profile.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
getPersonalProfilesByName
public List<PersonalProfileUniverse> getPersonalProfilesByName(String userId, String name) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return a list of candidate personal profiles for an individual. It matches on full name and known name. The name may include wild card parameters.- Specified by:
getPersonalProfilesByNamein interfacePersonalProfileManagementInterface- Parameters:
userId- the name of the calling user.name- name of individual.- Returns:
- list of personal profile objects.
- Throws:
InvalidParameterException- the name is null.PropertyServerException- the server is not available.UserNotAuthorizedException- the calling user is not authorized to issue the call.
-
-