Previous Topic: Listing AssociationsNext Topic: Additional SDK Configurations


Deleting Associations

To delete the specified user-device association for a user:

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

    See "Initializing the Risk Evaluation API" in "Performing Risk Evaluation" 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 RiskXActionAPI.evaluateRisk() method to obtain an object of the RiskAssessment class.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. Obtain a ListAssociationsResponse object by invoking RiskXActionAPI.listAssociations. Then invoke ListAssociationResponse's getAllAssociations() method. This method returns an array of type UserDeviceAssociation. You can use UserDeviceAssociation.getAssociationName() for each UserDeviceAssociation object to get the name of the association.
  8. Call the RiskXActionAPI.deleteAssociation() method to delete the association.

    The following code snippet shows the usage of the method to delete user-device associations.

    public DeleteAssociationResponse deleteAssociation(java.lang.String callerId,
           UserContext userContext,
           java.lang.String associationName,
           AdditionalInputs additionalInputs)
           throws RiskException, RFSDKException
    

    The DeleteAssociationResponse.DeleteAssociationResponse() method deletes the association for the user that you specified.

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: