@Override public void rescheduleErroneousTriggers() throws UpdateException { try { final PlatformServiceAccessor platformAccessor = getPlatformAccessor(); platformAccessor.getSchedulerService().rescheduleErroneousTriggers(); } catch (final Exception e) { throw new UpdateException(e); } }
@Override public void rescheduleErroneousTriggers() throws UpdateException { try { final PlatformServiceAccessor platformAccessor = getPlatformAccessor(); platformAccessor.getSchedulerService().rescheduleErroneousTriggers(); } catch (final Exception e) { throw new UpdateException(e); } }
private STenant getDefaultTenant() throws STenantNotFoundException { try { PlatformServiceAccessor platformAccessor = getPlatformAccessor(); final PlatformService platformService = platformAccessor.getPlatformService(); return platformService.getDefaultTenant(); } catch (final STenantNotFoundException e) { throw e; } catch (final Exception e) { throw new STenantNotFoundException("Unable to retrieve the defaultTenant.", e); } }
private STenant getDefaultTenant() throws STenantNotFoundException { try { PlatformServiceAccessor platformAccessor = getPlatformAccessor(); final PlatformService platformService = platformAccessor.getPlatformService(); return platformService.getDefaultTenant(); } catch (final STenantNotFoundException e) { throw e; } catch (final Exception e) { throw new STenantNotFoundException("Unable to retrieve the defaultTenant.", e); } }
@Override public Map<Long, Map<String, byte[]>> getClientTenantConfigurations() { try { PlatformService platformService = getPlatformAccessor().getPlatformService(); List<STenant> tenants = platformService.getTenants(QueryOptions.countQueryOptions()); HashMap<Long, Map<String, byte[]>> conf = new HashMap<>(); for (STenant tenant : tenants) { conf.put(tenant.getId(), getBonitaHomeServerInstance().getClientTenantConfigurations(tenant.getId())); } return conf; } catch (BonitaException | IOException | IllegalAccessException | ClassNotFoundException | InstantiationException | STenantException e) { throw new RetrieveException(e); } }
@Override public Map<Long, Map<String, byte[]>> getClientTenantConfigurations() { try { PlatformService platformService = getPlatformAccessor().getPlatformService(); List<STenant> tenants = platformService.getTenants(QueryOptions.countQueryOptions()); HashMap<Long, Map<String, byte[]>> conf = new HashMap<>(); for (STenant tenant : tenants) { conf.put(tenant.getId(), getBonitaHomeServerInstance().getClientTenantConfigurations(tenant.getId())); } return conf; } catch (BonitaException | IOException | IllegalAccessException | ClassNotFoundException | InstantiationException | STenantException e) { throw new RetrieveException(e); } }
@Override @CustomTransactions @AvailableOnStoppedNode public boolean isPlatformCreated() throws PlatformNotFoundException { PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); final PlatformService platformService = platformAccessor.getPlatformService(); return platformAccessor.getTransactionService().executeInTransaction(platformService::isPlatformCreated); } catch (Exception e) { throw new BonitaRuntimeException(e); } }
@Override @CustomTransactions @AvailableOnStoppedNode public boolean isPlatformInitialized() throws PlatformNotFoundException { try { PlatformServiceAccessor platformAccessor = getPlatformAccessor(); PlatformService platformService = platformAccessor.getPlatformService(); return platformAccessor.getTransactionService().executeInTransaction(platformService::isDefaultTenantCreated); } catch (final Exception e) { throw new PlatformNotFoundException("Cannot determine if the default tenant is created", e); } }
@Override @CustomTransactions @AvailableOnStoppedNode public boolean isPlatformInitialized() throws PlatformNotFoundException { try { PlatformServiceAccessor platformAccessor = getPlatformAccessor(); PlatformService platformService = platformAccessor.getPlatformService(); return platformAccessor.getTransactionService().executeInTransaction(platformService::isDefaultTenantCreated); } catch (final Exception e) { throw new PlatformNotFoundException("Cannot determine if the default tenant is created", e); } }
@Override @CustomTransactions @AvailableOnStoppedNode public boolean isPlatformCreated() throws PlatformNotFoundException { PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); final PlatformService platformService = platformAccessor.getPlatformService(); return platformAccessor.getTransactionService().executeInTransaction(platformService::isPlatformCreated); } catch (Exception e) { throw new BonitaRuntimeException(e); } }
@Override @AvailableOnStoppedNode public Platform getPlatform() throws PlatformNotFoundException { PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); } catch (final Exception e) { throw new PlatformNotFoundException(e); } final PlatformService platformService = platformAccessor.getPlatformService(); final GetPlatformContent transactionContent = new GetPlatformContent(platformService); try { transactionContent.execute(); } catch (final SBonitaException e) { throw new PlatformNotFoundException(e); } final SPlatform sPlatform = transactionContent.getResult(); return ModelConvertor.toPlatform(sPlatform); }
@Override @AvailableOnStoppedNode public Platform getPlatform() throws PlatformNotFoundException { PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); } catch (final Exception e) { throw new PlatformNotFoundException(e); } final PlatformService platformService = platformAccessor.getPlatformService(); final GetPlatformContent transactionContent = new GetPlatformContent(platformService); try { transactionContent.execute(); } catch (final SBonitaException e) { throw new PlatformNotFoundException(e); } final SPlatform sPlatform = transactionContent.getResult(); return ModelConvertor.toPlatform(sPlatform); }
PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); } catch (final Exception e) { throw new CreationException(e);
PlatformServiceAccessor platformAccessor; try { platformAccessor = getPlatformAccessor(); } catch (final Exception e) { throw new CreationException(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); } }
@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); } }
public void stopNode() throws StopNodeException { try { final PlatformServiceAccessor platformAccessor = getPlatformAccessor(); final NodeConfiguration nodeConfiguration = platformAccessor.getPlatformConfiguration(); final List<PlatformLifecycleService> otherServicesToStop = getPlatformServicesToStart(nodeConfiguration);
public void stopNode() throws StopNodeException { try { final PlatformServiceAccessor platformAccessor = getPlatformAccessor(); final NodeConfiguration nodeConfiguration = platformAccessor.getPlatformConfiguration(); final List<PlatformLifecycleService> otherServicesToStop = getPlatformServicesToStart(nodeConfiguration);
long platformSessionId = -1; try { PlatformServiceAccessor platformAccessor = getPlatformAccessor(); sessionAccessor = createSessionAccessor(); STenant defaultTenant = getDefaultTenant();
long platformSessionId = -1; try { PlatformServiceAccessor platformAccessor = getPlatformAccessor(); sessionAccessor = createSessionAccessor(); STenant defaultTenant = getDefaultTenant();