Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Access Management Mobile and Social


oracle.security.idaas.rest.jaxrs.client.sdk.userprofile
Class PeopleClient

java.lang.Object
  extended by oracle.security.idaas.rest.jaxrs.client.sdk.userprofile.BaseClient
      extended by oracle.security.idaas.rest.jaxrs.client.sdk.userprofile.PeopleClient


public class PeopleClient
extends BaseClient

This class is used as the primary API for Java clients to access people REST APIs.


Constructor Summary
PeopleClient(ClientSDKConfig config)
          Sets the config info such as uri for the people REST service, which is then used on requests.

 

Method Summary
 java.lang.String addManager(java.lang.String reporteeId, java.lang.String managerId, Headers headers)
          Add a user's manager via person-manager uri.
 java.lang.String addMemberOf(java.lang.String existingUserUid, java.lang.String existingGroupName, Headers headers)
          Add a user to a group via person-memberOf uri.
 java.lang.String addOwnerOf(java.lang.String existingUserUid, java.lang.String existingGroupName, Headers headers)
          Add a user as an owner to a group via person-ownerOf uri.
 java.lang.String addReportee(java.lang.String managerId, java.lang.String reporteeId, Headers headers)
          Add a user's reports via person-reports uri.
 boolean addUserToOrgChart(java.lang.String personId, java.lang.String orgChartId, java.util.Map<java.lang.String,java.lang.Object> resourceAttrs, Headers headers)
          Deprecated. 
 java.lang.String createUser(java.util.Map<java.lang.String,java.lang.Object> resourceAttrs, Headers headers)
          Client would set the new user's attribute keys and values into a map and then call this method.
 boolean deleteManager(java.lang.String reporteeId, java.lang.String managerId, Headers headers)
          Delete a user's manager via person-manager uri.
 boolean deleteMemberOf(java.lang.String existingUserUid, java.lang.String existingGroupName, Headers headers)
          Delete a user's membership from a group via via person-memberOf uri.
 boolean deleteOrgChartInstance(java.lang.String personId, java.lang.String orgChartId, java.lang.String reporteeId, Headers headers)
          Deprecated. 
 boolean deleteOwnerOf(java.lang.String existingUserUid, java.lang.String existingGroupName, Headers headers)
          Delete a user's ownership from a group via person-ownerOf uri.
 boolean deleteReportee(java.lang.String managerId, java.lang.String reporteeId, Headers headers)
          Delete a user's reportee via person-reports uri.
 boolean deleteUser(java.lang.String personUriId, Headers headers)
           
 java.lang.String getManager(java.lang.String reporteeId, java.lang.String managerId, java.util.Map<java.lang.String,java.lang.String> queryParameters, Headers headers)
          Get the manager-reportee info of which a person is a reportee via person-manager uri.
 java.lang.String getMemberOf(java.lang.String existingUserUid, java.lang.String existingGroupName, java.util.Map<java.lang.String,java.lang.String> queryParameters, Headers headers)
          Get the mermbership info of a specific group of which a person is a member via person-memberOf uri.
 java.lang.String getOwnerOf(java.lang.String existingUserUid, java.lang.String existingGroupName, java.util.Map<java.lang.String,java.lang.String> queryParameters, Headers headers)
          Get the ownership info for the group of which a person is an owner via person-ownerOf uri.
 java.lang.String getReportee(java.lang.String managerId, java.lang.String reporteeId, java.util.Map<java.lang.String,java.lang.String> queryParameters, Headers headers)
          Get the manager-reportee info of which a person is a manager via person-reports uri.
 java.lang.String readOrgChartInstance(java.lang.String personId, java.lang.String orgChartId, java.lang.String reporteeId, java.util.Map<java.lang.String,java.lang.String> queryParameters, Headers headers)
          Deprecated. 
 java.lang.String readUser(java.lang.String personUriId, java.util.Map<java.lang.String,java.lang.String> queryParameters, Headers headers)
          Retreives the representation of a person.
 JSONCollection searchManagers(java.lang.String reporteeId, java.util.Map<java.lang.String,java.lang.String> queryParams, Headers headers)
          Get all the managers to which the person is reporting via person-manager uri.
 JSONCollection searchMemberOf(java.lang.String existingPersonName, java.util.Map<java.lang.String,java.lang.String> queryParams, Headers headers)
          Get all the groups of which the person is a member of via person-memberOf uri.
 JSONCollection searchOwnerOf(java.lang.String existingPersonName, java.util.Map<java.lang.String,java.lang.String> queryParams, Headers headers)
          Get all the groups of which the person is an owner of via person-ownerOf uri.
 JSONCollection searchReportees(java.lang.String managerId, java.util.Map<java.lang.String,java.lang.String> queryParams, Headers headers)
          Get all the reportees of which the person is manager via person-reports uri.
 JSONCollection searchUsers(java.util.Map<java.lang.String,java.lang.String> queryParams, Headers headers)
          Does a search on users collection resource.
 JSONCollection searchUsersOrgChart(java.lang.String personId, java.lang.String orgChartId, java.util.Map<java.lang.String,java.lang.String> queryParams, Headers headers)
          Deprecated. 
 java.lang.String updateUser(java.lang.String personUriId, java.util.Map<java.lang.String,java.lang.Object> resourceAttrs, Headers headers)
          Updates a resource for the specified set of attributes in the request.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

PeopleClient

public PeopleClient(ClientSDKConfig config)
             throws OICClientException
Sets the config info such as uri for the people REST service, which is then used on requests. To consume APIs for user operations which relate with manager/reports/member/memberOf/owner/ownerOf URI, the calling application needs to pass in UserProfileClientSDKConfig, instead of ClientSDKConfig.
Parameters:
config - which has info such as serviceURI etc
Throws:
OICClientException

Method Detail

createUser

public java.lang.String createUser(java.util.Map<java.lang.String,java.lang.Object> resourceAttrs,
                                   Headers headers)
                            throws OICClientException
Client would set the new user's attribute keys and values into a map and then call this method.
Parameters:
resourceAttrs - is a Map of attribute keys and values.
headers - contains authorization headers for the request.
Returns:
JSON representation of newly created user.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

searchUsers

public JSONCollection searchUsers(java.util.Map<java.lang.String,java.lang.String> queryParams,
                                  Headers headers)
                           throws OICClientException
Does a search on users collection resource.
Parameters:
queryParams - contains the query parameters such as any search filters or paging parameters.
headers - contains authorization headers for the request.
Throws:
OICClientException - for exceptions and 4xx status codes. encountered when accessing REST services.

updateUser

public java.lang.String updateUser(java.lang.String personUriId,
                                   java.util.Map<java.lang.String,java.lang.Object> resourceAttrs,
                                   Headers headers)
                            throws OICClientException
Updates a resource for the specified set of attributes in the request.
Parameters:
resourceAttrs - is set the user's attribute keys and values to be updated, where the old value will be replaced byu the specified new value.
personUriId - is the URI id of the resource being updated.
headers - contains authorization headers for the request.
Returns:
JSON string representation of updated person.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

readUser

public java.lang.String readUser(java.lang.String personUriId,
                                 java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                 Headers headers)
                          throws OICClientException
Retreives the representation of a person.
Parameters:
personUriId - is URI id of the specific resource being accessed.
queryParams - contains the query parameters such as any search filters or paging parameters.
headers - contains authorization headers for the request.
Returns:
JSON representation of the resource.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

deleteUser

public boolean deleteUser(java.lang.String personUriId,
                          Headers headers)
                   throws OICClientException
Parameters:
personUriId - is URI id of the specific resource being deleted.
headers - contains authorization headers for the request.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

searchUsersOrgChart

@Deprecated
public JSONCollection searchUsersOrgChart(java.lang.String personId,
                                                     java.lang.String orgChartId,
                                                     java.util.Map<java.lang.String,java.lang.String> queryParams,
                                                     Headers headers)
                                   throws OICClientException
Deprecated. 
Does a search on users orgchart collection resource.
Parameters:
personId - is the ide of the person whose orgchart is being searched
orgChartId - is the ide of the orgchart resource, such as manager or reports being searched
queryParams - the query parameters
headers - contains authorization headers for the request
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

addUserToOrgChart

@Deprecated
public boolean addUserToOrgChart(java.lang.String personId,
                                            java.lang.String orgChartId,
                                            java.util.Map<java.lang.String,java.lang.Object> resourceAttrs,
                                            Headers headers)
                          throws OICClientException
Deprecated. 
TODO: The return value should be changed to just return the json, and not a boolean. Client would set the new user's attribute keys and values into a map and then call this method.
Parameters:
personId - is the id of the person whose orgchart is being added to
orgChartId - is the ide of the orgchart resource, such as manager or reports being added to
resourceAttrs - contains the attribute names and values that will be in the json message.
headers - contains authorization headers for the request
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

readOrgChartInstance

@Deprecated
public java.lang.String readOrgChartInstance(java.lang.String personId,
                                                        java.lang.String orgChartId,
                                                        java.lang.String reporteeId,
                                                        java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                                        Headers headers)
                                      throws OICClientException
Deprecated. 
Does a read on instance of and orgchart collection resource. aka GET ...people/alice/reports/bob or GET ...people/bob/manager/alice
Parameters:
personId - is the id of the person whose orgchart is being read
orgChartId - is the id of the orgchart resource, such as manager or reports being read
reporteeId - is the id of the member of the orgchart resource being retrieved on the GET request.
query - parameters to modify the read.
headers - contains authorization headers for the request
Returns:
the raw JSON results String.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

deleteOrgChartInstance

@Deprecated
public boolean deleteOrgChartInstance(java.lang.String personId,
                                                 java.lang.String orgChartId,
                                                 java.lang.String reporteeId,
                                                 Headers headers)
                               throws OICClientException
Deprecated. 
Does a DELETE on instance of and orgchart collection resource. aka DELETE ...people/alice/reports/bob or DELETE ...people/bob/manager/alice
Parameters:
personId - is the id of the person whose orgchart is being deleted
orgChartId - is the id of the orgchart resource, such as manager or reports being deleted
headers - contains authorization headers for the request
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

addManager

public java.lang.String addManager(java.lang.String reporteeId,
                                   java.lang.String managerId,
                                   Headers headers)
                            throws OICClientException
Add a user's manager via person-manager uri. aka POST http://localhost:18001/oic_rest/rest/crudssvc1/people/alic/manager
Parameters:
reporteeId - is the id of the person whose manager is being added to.
managerId - is the id of the manager being added to the person.
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

getManager

public java.lang.String getManager(java.lang.String reporteeId,
                                   java.lang.String managerId,
                                   java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                   Headers headers)
                            throws OICClientException
Get the manager-reportee info of which a person is a reportee via person-manager uri. aka GET http://localhost:18001/oic_rest/rest/peopleservice1/people/alice/manager/bob
Parameters:
reporteeId - such as "alice".
managerId - such as "bob".
queryParameters - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException

searchManagers

public JSONCollection searchManagers(java.lang.String reporteeId,
                                     java.util.Map<java.lang.String,java.lang.String> queryParams,
                                     Headers headers)
                              throws OICClientException
Get all the managers to which the person is reporting via person-manager uri. aka GET http://localhost:18001/oic_rest/rest/crudssvc1/people/alice/manager
Parameters:
reporteeId - such as "alice".
queryParams - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the groups are contained in json "elements" array field. Values may be manager-uri for each object item in array
Throws:
OICClientException

deleteManager

public boolean deleteManager(java.lang.String reporteeId,
                             java.lang.String managerId,
                             Headers headers)
                      throws OICClientException
Delete a user's manager via person-manager uri. aka DELETE http://localhost:18001/oic_rest/rest/peopleservice1/people/alice/manager/bob
Parameters:
reporteeId - such as "alice".
managerId - such as "bob".
headers - contains authorization headers for the request.
Returns:
true if the deletion succeeds.
Throws:
OICClientException

addReportee

public java.lang.String addReportee(java.lang.String managerId,
                                    java.lang.String reporteeId,
                                    Headers headers)
                             throws OICClientException
Add a user's reports via person-reports uri. aka POST http://localhost:18001/oic_rest/rest/crudssvc1/people/bob/reports
Parameters:
managerId - is the id of the manager.
reporteeId - is the id of the reportee.
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException - for exceptions and 4xx status codes encountered when accessing REST services.

getReportee

public java.lang.String getReportee(java.lang.String managerId,
                                    java.lang.String reporteeId,
                                    java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                    Headers headers)
                             throws OICClientException
Get the manager-reportee info of which a person is a manager via person-reports uri. aka GET http://localhost:18001/oic_rest/rest/peopleservice1/people/ bob/reports/alice
Parameters:
managerId - such as "bob".
reporteeId - such as "alice".
queryParameters - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException

searchReportees

public JSONCollection searchReportees(java.lang.String managerId,
                                      java.util.Map<java.lang.String,java.lang.String> queryParams,
                                      Headers headers)
                               throws OICClientException
Get all the reportees of which the person is manager via person-reports uri. aka GET http://localhost:18001/oic_rest/rest/crudssvc1/people/bob/reports
Parameters:
managerId - such as "bob".
queryParams - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the groups are contained in json "elements" array field. Values may be report-uri for each object item in array.
Throws:
OICClientException

deleteReportee

public boolean deleteReportee(java.lang.String managerId,
                              java.lang.String reporteeId,
                              Headers headers)
                       throws OICClientException
Delete a user's reportee via person-reports uri. aka DELETE http://localhost:18001/oic_rest/rest/peopleservice1/people/ bob/reports/alice
Parameters:
managerId - such as "bob".
reporteeId - such as "alice".
headers - contains authorization headers for the request.
Returns:
true if the deletion succeeds.
Throws:
OICClientException

addMemberOf

public java.lang.String addMemberOf(java.lang.String existingUserUid,
                                    java.lang.String existingGroupName,
                                    Headers headers)
                             throws OICClientException
Add a user to a group via person-memberOf uri. aka POST http://localhost:18001/oic_rest/rest/crudssvc1/people/alice123/memberOf
Parameters:
existingUserUid - such as "alice123".
existingGroupName - such as "doctors".
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException

getMemberOf

public java.lang.String getMemberOf(java.lang.String existingUserUid,
                                    java.lang.String existingGroupName,
                                    java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                    Headers headers)
                             throws OICClientException
Get the mermbership info of a specific group of which a person is a member via person-memberOf uri. aka GET http://localhost:18001/oic_rest/rest/peopleservice1/people/ alice/memberOf/doctors
Parameters:
existingUserUid - such as "alice123".
existingGroupName - such as "doctors".
queryParameters - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException

searchMemberOf

public JSONCollection searchMemberOf(java.lang.String existingPersonName,
                                     java.util.Map<java.lang.String,java.lang.String> queryParams,
                                     Headers headers)
                              throws OICClientException
Get all the groups of which the person is a member of via person-memberOf uri. aka GET http://localhost:18001/oic_rest/rest/crudssvc1/people/alice123/memberOf
Parameters:
existingPersonName - such as "alice123".
queryParams - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the groups are contained in json "elements" array field. Values may be group-uri for each object item in array
Throws:
OICClientException

deleteMemberOf

public boolean deleteMemberOf(java.lang.String existingUserUid,
                              java.lang.String existingGroupName,
                              Headers headers)
                       throws OICClientException
Delete a user's membership from a group via via person-memberOf uri. aka DELETE http://localhost:18001/oic_rest/rest/peopleservice1/people/ alice/memberOf/doctors
Parameters:
existingUserUid - such as "alice123".
existingGroupName - such as "doctors".
headers - contains authorization headers for the request.
Returns:
true if the deletion succeeds.
Throws:
OICClientException

addOwnerOf

public java.lang.String addOwnerOf(java.lang.String existingUserUid,
                                   java.lang.String existingGroupName,
                                   Headers headers)
                            throws OICClientException
Add a user as an owner to a group via person-ownerOf uri. aka POST http://localhost:18001/oic_rest/rest/crudssvc1/people/alice123/ownerOf/
Parameters:
existingUserUid - such as "alice123".
existingGroupName - such as "doctors".
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException

getOwnerOf

public java.lang.String getOwnerOf(java.lang.String existingUserUid,
                                   java.lang.String existingGroupName,
                                   java.util.Map<java.lang.String,java.lang.String> queryParameters,
                                   Headers headers)
                            throws OICClientException
Get the ownership info for the group of which a person is an owner via person-ownerOf uri. aka GET http://localhost:18001/oic_rest/rest/peopleservice1/people/ alice/ownerOf/doctors
Parameters:
existingUserUid - such as "alice123".
existingGroupName - such as "doctors".
queryParameters - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the raw JSON string results.
Throws:
OICClientException

searchOwnerOf

public JSONCollection searchOwnerOf(java.lang.String existingPersonName,
                                    java.util.Map<java.lang.String,java.lang.String> queryParams,
                                    Headers headers)
                             throws OICClientException
Get all the groups of which the person is an owner of via person-ownerOf uri. aka GET http://localhost:18001/oic_rest/rest/crudssvc1/people/alice123/ownerOf
Parameters:
existingPersonName - such as "alice123".
queryParams - contains additional url query parameters.
headers - contains authorization headers for the request.
Returns:
the groups are contained in json "elements" array field. Values may be group-uri for each object item in array
Throws:
OICClientException

deleteOwnerOf

public boolean deleteOwnerOf(java.lang.String existingUserUid,
                             java.lang.String existingGroupName,
                             Headers headers)
                      throws OICClientException
Delete a user's ownership from a group via person-ownerOf uri. aka DELETE http://localhost:18001/oic_rest/rest/peopleservice1/people/ alice/ownerOf/doctors
Parameters:
existingUserUid - such as "alice123".
existingGroupName - such as "doctors".
headers - contains authorization headers for the request.
Returns:
true if the deletion succeeds.
Throws:
OICClientException

Skip navigation links

Copyright (c) 2012,
Oracle All Rights Reserved.
Built 06/05/2012 17:18:07 PDT