Previous Topic: Managing AssociationsNext Topic: Deleting Associations


Listing Associations

To list all the stored associations for a specified user:

  1. Ensure that you have initialized the Risk Evaluation API by using the RiskFactory class.

    See "Initializing the Risk Evaluation API" in "Before You Begin" for more information on this.

  2. If required, prepare the additional inputs for the transaction, by using the AdditionalInputs class in the com.arcot.riskfortAPI.AdditionalInputs package.

    See "Preparing Additional Inputs" in "Before You Begin" for more information on this.

  3. Use the RiskFactory.getRiskXActionAPI() static method to obtain an object that implements the RiskXActionAPI interface.

    This method returns the RiskXActionAPI object created as a part of the RiskFactory API initialization.

  4. Define and set the CallerID string variable, which will be used by your application for tracking purposes across calls.
  5. Create a UserContext object, and then use the UserContext object's setUserID() method to set a unique ID for the user.
  6. Set the necessary properties for the returned object.

    For example, you can set the user ID by calling the UserContext.setUserId() method.

  7. Call the RiskXActionAPI.listAssociations() method to create a ListAssociationResponse object.

    The following code snippet shows the usage of the method to list all existing associations.

    public ListAssociationResponse listAssociations(java.lang.String callerId,
           UserContext userContext,
           AdditionalInputs additionalInputs)
           throws RFSDKException, RFSDKException
    

    The ListAssociationResponse.getAllAssociations() method returns an array of all known associations for the specified user.

Handling Errors

Any errors that occurred during the execution of any of the Risk Evaluation API methods can result in one of the following two exceptions being thrown: