@Test @RunWithCustomExecutor public void deleteObjectGroups() throws Exception { Map<String, String> gotIdsWithStrategies = ImmutableMap.of("got1", VitamConfiguration.getDefaultStrategy(), "got2", VitamConfiguration.getDefaultStrategy(), "got3", VitamConfiguration.getDefaultStrategy()); instance.deleteObjectGroups(gotIdsWithStrategies); verify(logbookLifeCyclesClient).deleteLifecycleObjectGroupBulk(eq(gotIdsWithStrategies.keySet())); verify(metaDataClient).deleteObjectGroupBulk(eq(gotIdsWithStrategies.keySet())); verify(storageClient).delete(VitamConfiguration.getDefaultStrategy(), DataCategory.OBJECTGROUP, "got1.json"); verify(storageClient).delete(VitamConfiguration.getDefaultStrategy(), DataCategory.OBJECTGROUP, "got2.json"); verify(storageClient).delete(VitamConfiguration.getDefaultStrategy(), DataCategory.OBJECTGROUP, "got3.json"); }
public void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } storageDelete(objectGroupsGuidsWithStrategies, DataCategory.OBJECTGROUP, ".json"); }
PurgeDeleteService { public void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } storageDelete(objectGroupsGuidsWithStrategies, DataCategory.OBJECTGROUP, ".json"); } }
PurgeDeleteService { public void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } storageDelete(objectGroupsGuidsWithStrategies, DataCategory.OBJECTGROUP, ".json"); } @VisibleForTesting  PurgeDeleteService(StorageClientFactory storageClientFactory,
        MetaDataClientFactory metaDataClientFactory,
        LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory);  PurgeDeleteService(); }
PurgeDeleteService { public void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } storageDelete(objectGroupsGuidsWithStrategies, DataCategory.OBJECTGROUP, ".json"); } @VisibleForTesting  PurgeDeleteService(StorageClientFactory storageClientFactory,
        MetaDataClientFactory metaDataClientFactory,
        LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory);  PurgeDeleteService(); void deleteObjects(Map<String,String> objectsGuidsWithStrategies); void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies); void deleteUnits(Map<String,String> unitsGuidsWithStrategies); void detachObjectGroupFromDeleteParentUnits(String objectGroupId,
        Set<String> parentUnitsToRemove); }
PurgeDeleteService { public void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies) throws InvalidParseOperationException, MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteObjectGroupBulk(objectGroupsGuidsWithStrategies.keySet()); } storageDelete(objectGroupsGuidsWithStrategies, DataCategory.OBJECTGROUP, ".json"); } @VisibleForTesting  PurgeDeleteService(StorageClientFactory storageClientFactory,
        MetaDataClientFactory metaDataClientFactory,
        LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory);  PurgeDeleteService(); void deleteObjects(Map<String,String> objectsGuidsWithStrategies); void deleteObjectGroups(Map<String,String> objectGroupsGuidsWithStrategies); void deleteUnits(Map<String,String> unitsGuidsWithStrategies); void detachObjectGroupFromDeleteParentUnits(String objectGroupId,
        Set<String> parentUnitsToRemove);  }