class PurgeDetachObjectGroupPlugin extends ActionHandler {

    @Override
    public ItemStatus execute(WorkerParameters param, HandlerIO handler)
        throws ProcessingException {

        String objectGroupId = param.getObjectName();
        try {
            Set<String> parentUnitsToRemove = getParentUnitsToRemove(param);

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Detaching deleted parents [" + String.join(", ", parentUnitsToRemove) + "]" +
                    " from object group " + objectGroupId);
            }

            purgeDeleteService.detachObjectGroupFromDeleteParentUnits(objectGroupId, parentUnitsToRemove);

            LOGGER.info("Object group " + objectGroupId + " detachment from parents succeeded");

            return buildItemStatus(actionId, StatusCode.OK, null);

        } catch (ProcessingStatusException e) {
            LOGGER.error("Object group " + objectGroupId + " detachment from parents failed with status" +
                " [" + e.getStatusCode() + "]", e);
            return buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails());
        }
    }

    public  PurgeDetachObjectGroupPlugin(String actionId);
    @VisibleForTesting protected  PurgeDetachObjectGroupPlugin(
        String actionId, PurgeDeleteService purgeDeleteService);

}