Class MyProfileManagement
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.communityprofile.client.MyProfileManagement
-
- All Implemented Interfaces:
MyPersonalProfileInterface
public class MyProfileManagement extends Object implements MyPersonalProfileInterface
This client covers the management of a user's personal profile.
-
-
Constructor Summary
Constructors Constructor Description MyProfileManagement(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.MyProfileManagement(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.MyProfileManagement(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.MyProfileManagement(String serverName, String serverPlatformURLRoot, CommunityProfileRESTClient restClient, int maxPageSize)Create a new client that passes userId and password in each HTTP request.MyProfileManagement(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 StringaddMyContactMethod(String userId, ContactMethodType type, String service, String value)Add a new contact method to the requesting user's profile.voidaddToMyAssets(String userId, String assetGUID)Add an asset to the identified user's list of favorite assets.voiddeleteMyContactMethod(String userId, String contactMethodGUID, ContactMethodType type)Remove an obsolete contact method from the requesting user's profile.voiddeleteMyProfile(String userId, String qualifiedName)Delete the profile for the requesting user.List<AssetCollectionMember>getMyAssets(String userId, int startFrom, int pageSize)Return a list of assets that the specified user has added to their favorites list.List<ContactMethodElement>getMyContactDetails(String UserId)Return the list of contact methods for this user.longgetMyKarmaPoints(String userId)Return the total karma points for this user.PersonalProfileUniversegetMyProfile(String userId)Return the profile for this user.voidremoveFromMyAssets(String userId, String assetGUID)Remove an asset from identified user's list of favorite assets.voidsetUpMyProfile(String userId, String qualifiedName, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,String> additionalProperties)Create or update the profile for the requesting user.
-
-
-
Constructor Detail
-
MyProfileManagement
public MyProfileManagement(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
-
MyProfileManagement
public MyProfileManagement(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.
-
MyProfileManagement
public MyProfileManagement(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
-
MyProfileManagement
public MyProfileManagement(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
-
MyProfileManagement
public MyProfileManagement(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
-
getMyProfile
public PersonalProfileUniverse getMyProfile(String userId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the profile for this user.- Specified by:
getMyProfilein interfaceMyPersonalProfileInterface- Parameters:
userId- userId of the user making the request.- Returns:
- profile object
- 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.
-
getMyKarmaPoints
public long getMyKarmaPoints(String userId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the total karma points for this user.- Specified by:
getMyKarmaPointsin interfaceMyPersonalProfileInterface- Parameters:
userId- userId of the user making the request.- Returns:
- int
- 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.
-
setUpMyProfile
public void setUpMyProfile(String userId, String qualifiedName, String fullName, String knownName, String jobTitle, String jobRoleDescription, Map<String,String> additionalProperties) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Create or update the profile for the requesting user.- Specified by:
setUpMyProfilein interfaceMyPersonalProfileInterface- Parameters:
userId- calling userqualifiedName- 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.- 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.
-
deleteMyProfile
public void deleteMyProfile(String userId, String qualifiedName) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Delete the profile for the requesting user.- Specified by:
deleteMyProfilein interfaceMyPersonalProfileInterface- Parameters:
userId- the name of the calling user.- 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.
-
getMyContactDetails
public List<ContactMethodElement> getMyContactDetails(String UserId) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return the list of contact methods for this user.- Specified by:
getMyContactDetailsin interfaceMyPersonalProfileInterface- Parameters:
UserId- userId of the user making the request.- 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.
-
addMyContactMethod
public String addMyContactMethod(String userId, ContactMethodType type, String service, String value) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Add a new contact method to the requesting user's profile.- Specified by:
addMyContactMethodin interfaceMyPersonalProfileInterface- Parameters:
userId- the name of the calling user.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.
-
deleteMyContactMethod
public void deleteMyContactMethod(String userId, String contactMethodGUID, ContactMethodType type) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove an obsolete contact method from the requesting user's profile.- Specified by:
deleteMyContactMethodin interfaceMyPersonalProfileInterface- Parameters:
userId- the name of the calling user.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.
-
getMyAssets
public List<AssetCollectionMember> getMyAssets(String userId, int startFrom, int pageSize) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Return a list of assets that the specified user has added to their favorites list.- Parameters:
userId- userId of user making request.startFrom- index of the list to start from (0 for start)pageSize- maximum number of elements to return.- Returns:
- list of asset details
- 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.
-
addToMyAssets
public void addToMyAssets(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Add an asset to the identified user's list of favorite assets.- Parameters:
userId- userId of user making request.assetGUID- unique identifier of the asset.- Throws:
InvalidParameterException- one of the parameters is invalid.PropertyServerException- there is a problem updating information in the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
removeFromMyAssets
public void removeFromMyAssets(String userId, String assetGUID) throws InvalidParameterException, PropertyServerException, UserNotAuthorizedException
Remove an asset from identified user's list of favorite assets.- Parameters:
userId- userId of user making request.assetGUID- unique identifier of the asset.- Throws:
InvalidParameterException- one of the parameters is invalid.PropertyServerException- there is a problem updating information in the property server(s).UserNotAuthorizedException- the requesting user is not authorized to issue this request.
-
-