class PurgeDeleteObjectGroupPlugin extends ActionHandler {

    @Override
    public List<ItemStatus> executeList(WorkerParameters param, HandlerIO handler) {

        try {

            List<PurgeObjectGroupParams> objectGroupParams = param.getObjectMetadataList().stream()
                .map(og -> {
                    try {
                        return JsonHandler.getFromJsonNode(og, PurgeObjectGroupParams.class);
                    } catch (InvalidParseOperationException e) {
                        throw new RuntimeException(e);
                    }
                })
                .collect(Collectors.toList());

            Map<String, String> objectGroupIdsWithStrategies = objectGroupParams.stream()
                .collect(Collectors.toMap(PurgeObjectGroupParams::getId, PurgeObjectGroupParams::getStrategyId));

            processObjectGroups(objectGroupIdsWithStrategies);


            Map<String, String> objectIdsWithStrategies = objectGroupParams.stream()
                .flatMap(objectGroup -> objectGroup.getObjects().stream())
                .collect(Collectors.toMap(PurgeObjectParams::getId, PurgeObjectParams::getStrategyId));

            processObjects(objectIdsWithStrategies);

            return buildBulkItemStatus(param, actionId, StatusCode.OK);

        } catch (ProcessingStatusException e) {
            LOGGER.error("Purge of object groups failed with status " + e.getStatusCode(), e);
            return singletonList(
                buildItemStatus(actionId, e.getStatusCode(), e.getEventDetails()));
        }

    }

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

}