@Override @CustomTransactions @AvailableOnStoppedNode public void cleanPlatform() throws DeletionException { final PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); List<STenant> sTenants = platformAccessor.getTransactionService().executeInTransaction(() -> { final PlatformService platformService = platformAccessor.getPlatformService(); final List<STenant> tenants = platformService.getTenants(new QueryOptions(0, Integer.MAX_VALUE)); for (final STenant sTenant : tenants) { platformService.deactiveTenant(sTenant.getId()); } return tenants; }); for (STenant sTenant : sTenants) { deleteTenant(sTenant.getId()); } } catch (Exception e) { throw new DeletionException(e); } }
@Override @CustomTransactions @AvailableOnStoppedNode public void cleanPlatform() throws DeletionException { final PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); List<STenant> sTenants = platformAccessor.getTransactionService().executeInTransaction(() -> { final PlatformService platformService = platformAccessor.getPlatformService(); final List<STenant> tenants = platformService.getTenants(new QueryOptions(0, Integer.MAX_VALUE)); for (final STenant sTenant : tenants) { platformService.deactiveTenant(sTenant.getId()); } return tenants; }); for (STenant sTenant : sTenants) { deleteTenant(sTenant.getId()); } } catch (Exception e) { throw new DeletionException(e); } }
if (tenantId != -1L) { try { deleteTenant(tenantId); } catch (STenantDeletionException e1) { throw new STenantCreationException("Unable to delete default tenant (after a STenantCreationException) that was being created", e1);
if (tenantId != -1L) { try { deleteTenant(tenantId); } catch (STenantDeletionException e1) { throw new STenantCreationException("Unable to delete default tenant (after a STenantCreationException) that was being created", e1);