private Class<?> loadClassFromPropertyName(String propertyName) throws IOException, BonitaHomeConfigurationException, ClassNotFoundException { final String sessionAccessorStr = BonitaHomeServer.getInstance().getPlatformProperties().getProperty(propertyName); if (sessionAccessorStr == null) { throw new BonitaHomeConfigurationException(propertyName + " not set in bonita-platform-private-community.properties"); } return Class.forName(sessionAccessorStr); }
static File getFileContainingMD5(long tenantId) throws BonitaHomeNotSetException, IOException { return BonitaHomeServer.getInstance().getTenantStorage().getProfileMD5(tenantId); }
public List<BonitaConfiguration> getTenantConfiguration(long tenantId) throws IOException { return getAllXmlConfiguration(getConfigurationService().getTenantEngineConf(tenantId)); }
protected URI getLocalTemporaryFolder(String type, long id) throws BonitaHomeNotSetException, IOException { return BonitaHomeServer.getInstance().getLocalTemporaryFolder(type, id); }
public Properties getPlatformProperties() throws IOException { return mergeProperties(getPropertiesFromClassPath("bonita-platform-community.properties", "bonita-platform-private-community.properties", "bonita-platform-private-sp.properties", "bonita-platform-sp.properties", "bonita-platform-sp-cluster.properties"), getConfigurationService().getPlatformEngineConf()); }
BonitaHomeServer getBonitaHomeServer() { return BonitaHomeServer.getInstance(); }
public static long createTenant(final TransactionService transactionService, final PlatformService platformService, final String tenantName, final String createdBy, final String status) throws Exception { try { transactionService.begin(); final long created = System.currentTimeMillis(); final STenantBuilder tenantBuilder = BuilderFactory.get(STenantBuilderFactory.class).createNewInstance(tenantName, createdBy, created, status, false); final STenant tenant = tenantBuilder.done(); platformService.createTenant(tenant); BonitaHomeServer.getInstance().createTenant(tenant.getId()); platformService.activateTenant(tenant.getId()); return tenant.getId(); } finally { transactionService.complete(); } }
public void refreshGlobalClassLoader(Stream<BonitaResource> resources) throws SClassLoaderException { logger.log(this.getClass(), TechnicalLogSeverity.INFO, "Refreshing global classloader"); final VirtualClassLoader virtualClassloader = (VirtualClassLoader) getGlobalClassLoader(); try { refreshClassLoader(virtualClassloader, resources, getGlobalClassLoaderType(), getGlobalClassLoaderId(), BonitaHomeServer.getInstance().getGlobalTemporaryFolder(), ClassLoaderServiceImpl.class.getClassLoader()); } catch (Exception e) { throw new SClassLoaderException(e); } }
public void createTenant(final long tenantId) { getConfigurationService().storeTenantEngineConf(getConfigurationService().getTenantTemplateEngineConf(), tenantId); getConfigurationService().storeTenantSecurityScripts(getConfigurationService().getTenantTemplateSecurityScripts(), tenantId); getConfigurationService().storeTenantPortalConf(getConfigurationService().getTenantTemplatePortalConf(), tenantId); }
@Override protected Properties getProperties() throws IOException { Properties platformProperties = BONITA_HOME_SERVER.getPlatformProperties(); platformProperties.setProperty("bonita.conf.folder", bonita_conf.getAbsolutePath()); return platformProperties; }
public File getSecurityScriptsFolder(long tenantId) throws BonitaHomeNotSetException, IOException { final Folder localFolder = getFolder(getPlatformTempFolder(), "security-scripts").createIfNotExists(); final Folder tenantSecurityScriptsFolder = getFolder(localFolder, String.valueOf(tenantId)).createIfNotExists(); List<BonitaConfiguration> tenantSecurityScripts = getConfigurationService().getTenantSecurityScripts(tenantId); writeBonitaConfiguration(tenantSecurityScriptsFolder.getFile(), tenantSecurityScripts); return tenantSecurityScriptsFolder.getFile(); }
protected Logger getLogger(final long tenantId) throws SecurityException, IOException, BonitaHomeNotSetException { Logger logger = loggers.get(tenantId); if (logger == null) { logger = Logger.getLogger("INCIDENT" + tenantId); final FileHandler fh = getBonitaHomeServer().getTenantStorage().getIncidentFileHandler(tenantId); logger.addHandler(fh); final SimpleFormatter formatter = new SimpleFormatter(); fh.setFormatter(formatter); loggers.put(tenantId, logger); } return logger; }
private void createTenantFolderInBonitaHome(final long tenantId) { getBonitaHomeServerInstance().createTenant(tenantId); }
@Override public Map<String, byte[]> getClientPlatformConfigurations() { return getBonitaHomeServerInstance().getClientPlatformConfigurations(); }
@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); } }
getBonitaHomeServerInstance().deleteTenant(tenantId); } catch (final STenantNotFoundException e) { throw new STenantDeletionException(e);
BonitaHomeServer getBonitaHomeServer() { return BonitaHomeServer.getInstance(); }
public Properties getPlatformProperties() throws IOException { return mergeProperties(getPropertiesFromClassPath("bonita-platform-community.properties", "bonita-platform-private-community.properties", "bonita-platform-private-sp.properties", "bonita-platform-sp.properties", "bonita-platform-sp-cluster.properties"), getConfigurationService().getPlatformEngineConf()); }
public static long createDefaultTenant(final TransactionService transactionService, final PlatformService platformService, final String tenantName, final String createdBy, final String status) throws Exception { try { transactionService.begin(); final long created = System.currentTimeMillis(); final STenantBuilder tenantBuilder = BuilderFactory.get(STenantBuilderFactory.class) .createNewInstance(tenantName, createdBy, created, status, true); final STenant tenant = tenantBuilder.done(); platformService.createTenant(tenant); BonitaHomeServer.getInstance().createTenant(tenant.getId()); platformService.activateTenant(tenant.getId()); return tenant.getId(); } finally { transactionService.complete(); } } }
public void refreshGlobalClassLoader(Stream<BonitaResource> resources) throws SClassLoaderException { logger.log(this.getClass(), TechnicalLogSeverity.INFO, "Refreshing global classloader"); final VirtualClassLoader virtualClassloader = (VirtualClassLoader) getGlobalClassLoader(); try { refreshClassLoader(virtualClassloader, resources, getGlobalClassLoaderType(), getGlobalClassLoaderId(), BonitaHomeServer.getInstance().getGlobalTemporaryFolder(), ClassLoaderServiceImpl.class.getClassLoader()); } catch (Exception e) { throw new SClassLoaderException(e); } }