Implementation details for retiring contacts in ClaimCenter

ClaimCenter provides the gw.api.contact.ContactRetireHelper class to determine if a contact can be retired. This class provides two methods used in retiring contacts:

public static boolean retireContact(Contact contact)
Attempts to retire the passed in Contact, returning true if it was successful in doing so. This method is called by the ContactRetire work queue.
public static boolean computeCanRetireContact(Contact contact, ContactRetireContext retireContext)
Available to be used when implementing the ContactRetireBean interface to see if a contact can be retired. You might call this method if, while using ContactRetireBean.computeCanRetireBeanForContactProperty, you encounter another contact and need to retire it as well.

The retireContact method splits the foreign key references for the Contact into two components, those properties deemed safe from the IRetireContactPlugin implementation and the other properties. The safe properties for the contact do not block the retirement of the contact. Additionally, if there is a bean connected to the contact through this property, it is retired along with the contact.

In the base implementation, the safe references are:

Entity Array field
ContactAddress Contact
ContactCategoryScore Contact
ContactTag Contact
EFTData Contact
OfficialID Contact
Review Contact

The other properties by default will block the retirement of the contact unless they implement the ContactRetireBean interface. If an entity implements that interface, the computeCanRetireBeanForContactProperty method of the interface can be called to see if the entity can be retired.

In the base configuration, the only entity requiring this interface to be implemented is ContactContact. This entity has the dual role of being an array on Contact and also having a foreign key to a contact. ContactContact represents a join table to two contacts, so the other contact is a foreign key reference. The class that implements the ContactRetireBean interface is gw.api.contact.ContactContactRetireBeanImpl.