class UnitDetachmentPlugin extends ActionHandler {

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

        String unitId = param.getObjectName();

        try {

            Set<String> parentUnitsToRemove = getParentsToRemove(handler, unitId);

            updateUnit(unitId, parentUnitsToRemove);

            updateUnitLifeCycle(param, unitId, parentUnitsToRemove);

        } catch (ProcessingStatusException e) {
            LOGGER.error("Unit detachment failed with status [" + e.getStatusCode() + "]", e);
            return buildItemStatus(UNIT_DETACHMENT, e.getStatusCode(), e.getEventDetails());
        }

        LOGGER.debug("Unit detachment succeeded: " + unitId);

        return buildItemStatus(UNIT_DETACHMENT, StatusCode.OK, null);
    }

    public  UnitDetachmentPlugin();
    @VisibleForTesting  UnitDetachmentPlugin(
        LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory, MetaDataClientFactory metaDataClientFactory);

}