Requesting a Replacement Device

The following sample code illustrates the device replacement workflow:

Copy
String[] reason ={"FORGOTTEN", "LOST", "DAMAGED", "EXPIRED", "STOLEN"};
// .. Choose the appropriate reason int i = .... // selected reason
// Replacement reason
Parameter replacementReasonParam = new Parameter(); replacementReasonParam.setType(TYPE_STRING); replacementReasonParam.setEncoding(ENCODING_NONE); replacementReasonParam.setValue(reason[i]); replacementReasonParam.setId(CCMConstants.
ACTION_RUNTIME_PARAM_REASON);
Parameter[] actionParams = new
Parameter[]{replacementReasonParam};
Action action = new Action(); action.setType(CCMConstants.ACTION_TYPE_ISSUANCE); action.setRuntimeParameters(actionParams);action. setApplicationSet(policy);
// Only if ActivID CMS is configured with Multi device features
SecurityModuleId[] smIds = new SecurityModuleId[] { oldSMId, newSMId };
action.setSecurityModuleIds(smIds);
Action[] actions = new Action[]{action};
// Submit the specified card replacement action walletMgr.submitActions(walletId, actions, null);