@Test @RunWithCustomExecutor public void deleteUnits() throws Exception { Map<String, String> unitIdsWithStrategies = ImmutableMap.of("unit1", VitamConfiguration.getDefaultStrategy(), "unit2", VitamConfiguration.getDefaultStrategy(), "unit3", VitamConfiguration.getDefaultStrategy()); instance.deleteUnits(unitIdsWithStrategies); verify(logbookLifeCyclesClient).deleteLifecycleUnitsBulk(eq(unitIdsWithStrategies.keySet())); verify(metaDataClient).deleteUnitsBulk(eq(unitIdsWithStrategies.keySet())); verify(storageClient).delete(VitamConfiguration.getDefaultStrategy(), DataCategory.UNIT, "unit1.json"); verify(storageClient).delete(VitamConfiguration.getDefaultStrategy(), DataCategory.UNIT, "unit2.json"); verify(storageClient).delete(VitamConfiguration.getDefaultStrategy(), DataCategory.UNIT, "unit3.json"); }
public void deleteUnits(Map<String,String> unitsGuidsWithStrategies) throws MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleUnitsBulk(unitsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteUnitsBulk(unitsGuidsWithStrategies.keySet()); } storageDelete(unitsGuidsWithStrategies, DataCategory.UNIT, ".json"); }
PurgeDeleteService { public void deleteUnits(Map<String,String> unitsGuidsWithStrategies) throws MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleUnitsBulk(unitsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteUnitsBulk(unitsGuidsWithStrategies.keySet()); } storageDelete(unitsGuidsWithStrategies, DataCategory.UNIT, ".json"); } }
PurgeDeleteService { public void deleteUnits(Map<String,String> unitsGuidsWithStrategies) throws MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleUnitsBulk(unitsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteUnitsBulk(unitsGuidsWithStrategies.keySet()); } storageDelete(unitsGuidsWithStrategies, DataCategory.UNIT, ".json"); } @VisibleForTesting  PurgeDeleteService(StorageClientFactory storageClientFactory,
        MetaDataClientFactory metaDataClientFactory,
        LogbookLifeCyclesClientFactory logbookLifeCyclesClientFactory);  PurgeDeleteService(); }
PurgeDeleteService { public void deleteUnits(Map<String,String> unitsGuidsWithStrategies) throws MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleUnitsBulk(unitsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteUnitsBulk(unitsGuidsWithStrategies.keySet()); } storageDelete(unitsGuidsWithStrategies, DataCategory.UNIT, ".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 deleteUnits(Map<String,String> unitsGuidsWithStrategies) throws MetaDataExecutionException, MetaDataClientServerException, StorageServerClientException, LogbookClientBadRequestException, LogbookClientServerException { try (LogbookLifeCyclesClient logbookLifeCyclesClient = logbookLifeCyclesClientFactory.getClient()) { logbookLifeCyclesClient.deleteLifecycleUnitsBulk(unitsGuidsWithStrategies.keySet()); } try (MetaDataClient metaDataClient = metaDataClientFactory.getClient()) { metaDataClient.deleteUnitsBulk(unitsGuidsWithStrategies.keySet()); } storageDelete(unitsGuidsWithStrategies, DataCategory.UNIT, ".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);  }