Skip navigation links


oracle.iam.request.api
Interface RequestService


public interface RequestService

Request Service is used for managing requests and its related operations . This service allows

Below is the code snippet that shows how to get an instance of this service:
//returns an Request service instance
RequestService reqsrvc = Platform.getService(RequestService.class);
// Gets the list of request template names that are available for logged in user for request creation.
List<String> templateNames = reqsrvc.getTemplateNames();
....


Method Summary
 void addRequestComment(java.lang.String reqId, RequestComment comment)
          Adds a comment to the specified request.
 void closeRequest(java.lang.String reqId)
          Closes the specified request.
 Request getBasicRequestData(java.lang.String reqId)
          Gets the complete request details for the specified request Id.
 java.util.List getChildRequests(java.lang.String reqId)
          Gets List of child requests for the specified request Id.
 oracle.iam.request.model.vo.RequestModel getModel(java.lang.String modelName)
          Gets the Request Model object for the specified model name
 oracle.iam.request.model.vo.RequestModel getModelForTemplate(java.lang.String templateName)
          Gets the request model associated with the request template with name specified
 java.util.List getModelNames()
          Gets all the request model names available in the system
 java.util.List getModelNames(java.lang.String pattern)
          Gets all the request model names that matches the specified search pattern.
 long getNumberOfRequestsCreatedByUser(long userKey, RequestSearchCriteria searchCriteria)
          Gets the number of requests raised by user that match the specified search criteria.
 long getNumberOfRequestsCreatedForUser(long userKey, RequestSearchCriteria searchCriteria)
          Gets the number of requests raised for the specified user that match the search criteria.
 long getNumberOfRequestsRaisedByMe(RequestSearchCriteria searchCriteria)
          Gets the count of requests raised by login user that matches the given search criteria.
 long getNumberOfRequestsRaisedForMe(RequestSearchCriteria searchCriteria)
          Gets the count of requests raised for login user that match the given search criteria.
 java.util.List getRequestComments(java.lang.String reqId)
          Get all the comments available for the specified request.
 java.util.List getRequestComments(java.lang.String reqId, RequestComment.TYPE type)
          Get all the comments provided for the specified request and comment type.
 java.util.List getRequestComments(java.lang.String reqId, java.lang.String taskId, RequestComment.TYPE type)
          Gets the comments provided for the specified request,comment type and taskid.
 oracle.iam.request.dataset.vo.RequestDataSet getRequestDataSet(java.lang.String requestModel, java.lang.String entityType)
          Gets the request data set associated with the given request model.
 java.util.List getRequestHistory(java.lang.String reqId)
          Gets all the request history instances for the specified request id
 java.util.List getRequestsForUser(java.lang.String userKey, RequestSearchCriteria srchCrit, java.util.HashMap configParams)
          Returns a list of requests raised for and raised by a specific user, that match the given search criteria.
 java.util.List getRequestsRaisedByMe(RequestSearchCriteria searchCriteria, java.util.Set retAttrs, java.util.HashMap configParams)
          Gets list of all requests raised by login user that matches the given search criteria.
 java.util.List getRequestsRaisedForMe(RequestSearchCriteria searchCriteria, java.util.Set retAttrs, java.util.HashMap configParams)
          Gets list of all requests raised for the login user that matches the given search criteria.
 java.util.List getRequestStageNames()
          Gets all the request stage names defined in the system
 RequestStatusSummary[] getRequestStatusSummary(java.lang.String reqId)
          Gets the status changes of the specified request.
 oracle.iam.request.dataset.vo.RequestDataSet getRestrictedDataSet(java.lang.String templateName, java.lang.String entityType)
          Gets the restricted data set associated with specified request template name and request entity name.
 long getSearchResultCount(RequestSearchCriteria searchCriteria)
          Gets the count of requests that match the specified search criteria.
 RequestTemplate getTemplate(java.lang.String templateName)
          Gets the request template instance for the specified template name.
 java.util.List getTemplateNames()
          Returns the list of request template names that are available for logged in user for request creation.
 java.util.List getTemplateNamesForSelf()
          Gets all the request template names for Self that the logged in user has access for request creation.
 java.io.Serializable prePopulate(java.lang.String attribute, oracle.iam.request.dataset.vo.RequestDataSet dataset, RequestData data)
          Used during Request Creation to get the value to be pre-populated for a non-child dataset attribute, if it is configured with a PrePopulationAdapter in the dataset.
 java.io.Serializable prePopulate(java.lang.String attribute, java.lang.String parentAttribute, oracle.iam.request.dataset.vo.RequestDataSet dataset, RequestData data)
          Used during Request Creation to get the value to be pre-populated for a child dataset attribute, if it is configured with a PrePopulationAdapter in the dataset.
 java.util.List search(RequestSearchCriteria searchCriteria, java.util.Set retAttrs, java.util.HashMap configParams)
          Gets the the requests that match the specified search criteria.
 java.lang.String submitRequest(RequestData requestData)
          Submit a request for an authenticated user.
 void updateApproverOnlyData(java.lang.String reqId, java.util.List benEntities, java.util.List reqEntities)
          Updates the request with approver only data.
 void validateRequestData(RequestData requestData)
          Validates the request data against the data set and data set validator plug-in, if any.
 void withdrawRequest(java.lang.String reqId)
          Withdraws the specified request.

 

Method Detail

submitRequest

java.lang.String submitRequest(RequestData requestData)
                               throws InvalidRequestException,
                                      InvalidRequestDataException,
                                      RequestServiceException,
                                      BulkBeneficiariesAddException,
                                      BulkEntitiesAddException
Submit a request for an authenticated user. Once the target entities and beneficiaries are added, this API should be called. Call to this API initiates the approvals required, if any
Parameters:
requestData - an instance of requestData
Throws:
InvalidRequestException - if requestData does not have either Target entity or Beneficiary details as per request Model definition
RequestServiceException - if the authentication or data validation fails
InvalidRequestDataException - if request data validation fails
BulkBeneficiariesAddException
BulkEntitiesAddException

validateRequestData

void validateRequestData(RequestData requestData)
                         throws InvalidRequestDataException,
                                RequestServiceException
Validates the request data against the data set and data set validator plug-in, if any.
Parameters:
requestData - request data that needs to be validated
Throws:
InvalidRequestDataException - if request data validation fails
RequestServiceException - if the authentication or data validation fails

getTemplateNames

java.util.List getTemplateNames()
                                throws RequestServiceException
Returns the list of request template names that are available for logged in user for request creation.
Returns:
List of all request template names
Throws:
RequestServiceException - if it fails to get corresponding request model configurations

getRequestDataSet

oracle.iam.request.dataset.vo.RequestDataSet getRequestDataSet(java.lang.String requestModel,
                                                               java.lang.String entityType)
                                                               throws RequestServiceException
Gets the request data set associated with the given request model.
Parameters:
requestModel - Request model name.
entityType - resource name for resource based request model/type,otherwise null.
Returns:
RequestDataSet Request data set object
Throws:
RequestServiceException - if fails to get the request data from repository

getBasicRequestData

Request getBasicRequestData(java.lang.String reqId)
                            throws RequestServiceException,
                                   NoRequestPermissionException
Gets the complete request details for the specified request Id. A request has following details The information is returned only if the login user is either
Parameters:
reqId - Request Id
Returns:
request instance
Throws:
RequestServiceException - if fails to get request object from repository
NoRequestPermissionException - if the login user does not have access to the request

search

java.util.List search(RequestSearchCriteria searchCriteria,
                      java.util.Set retAttrs,
                      java.util.HashMap configParams)
                      throws RequestServiceException
Gets the the requests that match the specified search criteria. This API takes permissions into consideration and only Request Administrators can search for requests.
Parameters:
searchCriteria - Request search criteria

Below is the list of allowed search parameters

retAttrs - Request data which will be returned in Request Object. If the retAttrs is null or empty Set whole request data is returned in Request object.
configParams - Additional configuration parameters for search results
Returns:
List of requests. The returned Request Objects contains request data mentioned in retAttrs. If retAttrs is null or empty Request Object contains the complete request data.
Throws:
RequestServiceException - if login user has no search permission or if fails to retrieve the requests from the repository

Below code snippet shows how to search for requests based on a criteria and additional config parameters Creates an search criteria with condition - where request user id equals "jdoe"
RequestSearchCriteria searchCriteria = new RequestSearchCriteria();
searchCriteria.setConjunctionOp(RequestSearchCriteria.Operator.OR);
searchCriteria.addExpression(RequestConstants.REQUESTER_USERID, "jdoe", RequestSearchCriteria.Operator.EQUAL);

//Creates additional search result configuration for sort order
//Sort all the request object returned order by ascending of requestid
Map <String, Object> config = new HashMap<String,Object>;
config.put(RequestConstants.SEARCH_SORTORDER,RequestConstants.SortOrder.ASCENDING);
config.put(RequestConstants.SEARCH_SORTBY, RequestConstants.REQUEST_ID);

//Search the requests based on the above criteria and config
//returns an Request service instance
RequestService reqsrvc = Platform.getService(RequestService.class);
//gets a list of request
List<Request> requests = reqsrvc.search(searchCriteria,config)
......
......


getModel

oracle.iam.request.model.vo.RequestModel getModel(java.lang.String modelName)
                                                  throws RequestServiceException
Gets the Request Model object for the specified model name
Parameters:
modelName - Request model name
Returns:
instance of RequestModel, if model exists
null otherwise
Throws:
RequestServiceException - if fails to retrieve the specified request model details from the repository

getModelForTemplate

oracle.iam.request.model.vo.RequestModel getModelForTemplate(java.lang.String templateName)
                                                             throws RequestServiceException
Gets the request model associated with the request template with name specified
Parameters:
templateName - Request template name
Returns:
Request model
Throws:
RequestServiceException - if fails to retrieve request model details

getRestrictedDataSet

oracle.iam.request.dataset.vo.RequestDataSet getRestrictedDataSet(java.lang.String templateName,
                                                                  java.lang.String entityType)
                                                                  throws RequestServiceException
Gets the restricted data set associated with specified request template name and request entity name. Returned dataset does not contain restricted attributes with property like approver-only, system-type set to true.
Parameters:
templateName - Request template name
entityType - entity name for generic entities, null otherwise.
Returns:
Request data set without restricted attributes
Throws:
RequestServiceException - if fails to retrieve specified request template or request dataset details

getRequestHistory

java.util.List getRequestHistory(java.lang.String reqId)
                                 throws RequestServiceException
Gets all the request history instances for the specified request id
Parameters:
reqId - request id
Returns:
List of Request History instances
Throws:
RequestServiceException - if fails to retrieve the request history instances from repository

prePopulate

java.io.Serializable prePopulate(java.lang.String attribute,
                                 oracle.iam.request.dataset.vo.RequestDataSet dataset,
                                 RequestData data)
                                 throws RequestServiceException
Used during Request Creation to get the value to be pre-populated for a non-child dataset attribute, if it is configured with a PrePopulationAdapter in the dataset.
Parameters:
attribute - Attribute for which the value is needed for pre-population
dataset - Request Dataset
data - RequestData object
Returns:
value to be pre-populated
null if no Pre-population adapter is present.
Throws:
RequestServiceException - if Pre-population fails

prePopulate

java.io.Serializable prePopulate(java.lang.String attribute,
                                 java.lang.String parentAttribute,
                                 oracle.iam.request.dataset.vo.RequestDataSet dataset,
                                 RequestData data)
                                 throws RequestServiceException
Used during Request Creation to get the value to be pre-populated for a child dataset attribute, if it is configured with a PrePopulationAdapter in the dataset.
Parameters:
attribute - Attribute for which the value is needed for pre-population
parentAttribute - Parent attribute of the attribute to be pre-populated
dataset - Request Dataset
data - RequestData object
Returns:
value to be pre-populated
null if no Pre-population adapter is present.
Throws:
RequestServiceException - if Pre-population fails

getModelNames

java.util.List getModelNames()
                             throws RequestServiceException
Gets all the request model names available in the system
Returns:
List of request model names
Throws:
RequestServiceException - if fails to retrieve the request models from the repository

getModelNames

java.util.List getModelNames(java.lang.String pattern)
                             throws RequestServiceException
Gets all the request model names that matches the specified search pattern. It supports search pattern with "*" as wild character. Passing null or "" does wild card search with "*".
Parameters:
pattern - - search pattern with "*" as wild character
Returns:
List of request model names.
Throws:
RequestServiceException - if fails to retrieve request models from the repository

getNumberOfRequestsCreatedByUser

long getNumberOfRequestsCreatedByUser(long userKey,
                                      RequestSearchCriteria searchCriteria)
                                      throws RequestServiceException
Gets the number of requests raised by user that match the specified search criteria.
Parameters:
userKey - Key of the user by whom requests are raised
searchCriteria - Request search criteria

Below is the list of allowed search parameters

Returns:
Number of requests matched the given search criteria
Throws:
RequestServiceException - if login user has no search permission or if fails to retrieve the requests from the repository

getNumberOfRequestsCreatedForUser

long getNumberOfRequestsCreatedForUser(long userKey,
                                       RequestSearchCriteria searchCriteria)
                                       throws RequestServiceException
Gets the number of requests raised for the specified user that match the search criteria.
Parameters:
userKey - Key of the user for whom requests are raised
searchCriteria - Request search criteria

Below is the list of allowed search parameters

Returns:
Number of requests matched the given search criteria
Throws:
RequestServiceException - if the login user has no search permission or if fails to retrieve the requests from the repository

getChildRequests

java.util.List getChildRequests(java.lang.String reqId)
                                throws RequestServiceException,
                                       NoRequestPermissionException
Gets List of child requests for the specified request Id. Child requests information is returned only if the login user is either
Parameters:
reqId - Parent request Id
Returns:
List of request
Throws:
RequestServiceException - if the specified request id is invalid or fails to retrieve the request details from the repository
NoRequestPermissionException - if the login user doesn't have permissions over the request

getTemplate

RequestTemplate getTemplate(java.lang.String templateName)
                            throws RequestServiceException
Gets the request template instance for the specified template name. Request Template is returned only if logged in user has the permission to create request using template.
Parameters:
templateName - Request template name
Returns:
Request template object instance
Throws:
RequestServiceException - if fails to retrieve the request template details from the repository

getRequestStatusSummary

RequestStatusSummary[] getRequestStatusSummary(java.lang.String reqId)
                                               throws RequestServiceException
Gets the status changes of the specified request.
Parameters:
reqId - request id
Returns:
An array of RequestStatusSummary value objects.
This value object contains the status, date and time at which request achieved this status and the date and time at which the request is submitted. Current status of the request is at the first element of array
Throws:
RequestServiceException - if fails to retrieve the request summary details from the repository

getSearchResultCount

long getSearchResultCount(RequestSearchCriteria searchCriteria)
                          throws RequestServiceException
Gets the count of requests that match the specified search criteria. This API takes permissions into consideration and only Request Administrators can search for requests.
Parameters:
searchCriteria - Request search criteria

Below is the list of allowed search parameters

Returns:
Number of requests matched the given search criteria
Throws:
RequestServiceException - if the login user has no search permission or if fails to retrieve the requests from the repository

addRequestComment

void addRequestComment(java.lang.String reqId,
                       RequestComment comment)
                       throws RequestServiceException
Adds a comment to the specified request.

Only authorized users can add request comments. Authorized users are

Parameters:
reqId - request id
comment - Request comment value object
Throws:
RequestServiceException - if the login user has no search permission or fails to add comments to the specified requests

getRequestComments

java.util.List getRequestComments(java.lang.String reqId)
                                  throws RequestServiceException
Get all the comments available for the specified request.

Only authorized users can get request comments. Authorized users are

Parameters:
reqId - Request ID
Returns:
List of request comments with latest as the first element
Throws:
RequestServiceException - the login user is not authorized or fails to retrieve the comments from repository

getRequestComments

java.util.List getRequestComments(java.lang.String reqId,
                                  RequestComment.TYPE type)
                                  throws RequestServiceException
Get all the comments provided for the specified request and comment type.

Only authorized users can get request comments. Authorized users are

Parameters:
reqId - Request Id
type - Request comment type
Returns:
List of request comments with latest as the first element
Throws:
RequestServiceException - the login user is not authorized or fails to retrieve the comments from repository

getRequestComments

java.util.List getRequestComments(java.lang.String reqId,
                                  java.lang.String taskId,
                                  RequestComment.TYPE type)
                                  throws RequestServiceException
Gets the comments provided for the specified request,comment type and taskid.

Only authorized users can get request comments. Authorized users are

Parameters:
reqId - Request Id
taskId - Task Id
type - Request comment type
Returns:
List of request comments with latest as the first element
Throws:
RequestServiceException - the login user is not authorized or fails to retrieve the comments from repository

withdrawRequest

void withdrawRequest(java.lang.String reqId)
                     throws RequestServiceException,
                            AccessDeniedException
Withdraws the specified request. If the request is withdrawn successfully,all the pending approvals are also withdrawn. Only requester can withdraw a request.
Parameters:
reqId - request Id
Throws:
RequestServiceException - if fails to withdraw the request
AccessDeniedException

closeRequest

void closeRequest(java.lang.String reqId)
                  throws RequestServiceException,
                         AccessDeniedException
Closes the specified request. If the request is closed successfully,all the pending approvals are withdrawn.
Only Request Administrators can close a request
Parameters:
reqId - request Id
Throws:
RequestServiceException - if fails to close the request
AccessDeniedException

getRequestsRaisedForMe

java.util.List getRequestsRaisedForMe(RequestSearchCriteria searchCriteria,
                                      java.util.Set retAttrs,
                                      java.util.HashMap configParams)
                                      throws RequestServiceException
Gets list of all requests raised for the login user that matches the given search criteria.
Parameters:
searchCriteria - Request search criteria

Below is the list of allowed search parameters

retAttrs - Request data which will be returned in Request Object. If the retAttrs is null or empty Set whole request data is returned in Request object.
configParams - Additional configuration parameters for search results
Returns:
List of requests
Throws:
RequestServiceException - if fails to retrieve the requests from repository

getRequestsRaisedByMe

java.util.List getRequestsRaisedByMe(RequestSearchCriteria searchCriteria,
                                     java.util.Set retAttrs,
                                     java.util.HashMap configParams)
                                     throws RequestServiceException
Gets list of all requests raised by login user that matches the given search criteria.
Parameters:
searchCriteria - Request search criteria

Below is the list of allowed search parameters

retAttrs - Request data which will be returned in Request Object. If the retAttrs is null or empty Set whole request data is returned in Request object.
configParams - Additional configuration parameters for search results
Returns:
List of requests
Throws:
RequestServiceException - if fails to retrieve requests from repository

getNumberOfRequestsRaisedForMe

long getNumberOfRequestsRaisedForMe(RequestSearchCriteria searchCriteria)
                                    throws RequestServiceException
Gets the count of requests raised for login user that match the given search criteria.
Parameters:
searchCriteria - Request search criteria

Below is the list of allowed search parameters

Returns:
Number of requests matched the given search criteria
Throws:
RequestServiceException - if fails to retrieve requests from repository

getNumberOfRequestsRaisedByMe

long getNumberOfRequestsRaisedByMe(RequestSearchCriteria searchCriteria)
                                   throws RequestServiceException
Gets the count of requests raised by login user that matches the given search criteria.
Parameters:
searchCriteria - Request search criteria

Below is the list of allowed search parameters

Returns:
Number of requests matched the given search criteria
Throws:
RequestServiceException - if fails to retrieve requests from repository

getRequestsForUser

java.util.List getRequestsForUser(java.lang.String userKey,
                                  RequestSearchCriteria srchCrit,
                                  java.util.HashMap configParams)
                                  throws RequestServiceException
Returns a list of requests raised for and raised by a specific user, that match the given search criteria. The logged in user must be a delegated admin and should have permission to view the requests of the user.
Parameters:
userKey - Mandatory parameter, of user key for which request search is done
searchCriteria - Request search criteria

Below is the list of allowed search parameters

configParams - Additional configuration parameters for search results
Returns:
List of requests
Throws:
RequestServiceException

getRequestStageNames

java.util.List getRequestStageNames()
                                    throws RequestServiceException
Gets all the request stage names defined in the system
Returns:
List of all the Request Stage names
Throws:
RequestServiceException - if fails to retrieve the request stage names from the repository

updateApproverOnlyData

void updateApproverOnlyData(java.lang.String reqId,
                            java.util.List benEntities,
                            java.util.List reqEntities)
                            throws RequestServiceException
Updates the request with approver only data. Only the current assignee of a task pending for the request can invoke this API.

The arguments would be passed based on the request.
benEntities would be passed only if request contains beneficiary(s), otherwise null.
reqEntities would be passed only if request does not contain beneficiary(s), otherwise null

Usage : Approver needs to follow a sequence of events to update the task.
Parameters:
reqId -
benEntities -
reqEntities -
Throws:
RequestServiceException

getTemplateNamesForSelf

java.util.List getTemplateNamesForSelf()
                                       throws RequestServiceException
Gets all the request template names for Self that the logged in user has access for request creation.
Returns:
List of all request template names for Self
Throws:
RequestServiceException - if it fails to get corresponding request model configurations

Skip navigation links


Copyright © 2010, Oracle and/or its affiliates. All rights reserved.