/** * protected for testing */ protected CommandAPI getCommandAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getCommandAPI(apiSession); } }
public static TenantAdministrationAPI getTenantAdministrationAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return getAPI(TenantAdministrationAPI.class, session); }
public LoginAPI getLoginAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getLoginAPI(); }
protected void setAPIs() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { setIdentityAPI(TenantAPIAccessor.getIdentityAPI(getSession())); setProcessAPI(TenantAPIAccessor.getProcessAPI(getSession())); setCommandAPI(TenantAPIAccessor.getCommandAPI(getSession())); setProfileAPI(TenantAPIAccessor.getProfileAPI(getSession())); setThemeAPI(TenantAPIAccessor.getThemeAPI(getSession())); setPermissionAPI(TenantAPIAccessor.getPermissionAPI(getSession())); setPageAPI(TenantAPIAccessor.getCustomPageAPI(getSession())); setApplicationAPI(TenantAPIAccessor.getLivingApplicationAPI(getSession())); setTenantManagementCommunityAPI(TenantAPIAccessor.getTenantAdministrationAPI(getSession())); setBusinessDataAPI(TenantAPIAccessor.getBusinessDataAPI(getSession())); }
private static <T> T getAPI(final Class<T> clazz) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); }
private static <T> T getAPI(final Class<T> clazz) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); }
/** * protected for testing */ protected CommandAPI getCommandAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getCommandAPI(apiSession); } }
public static ApplicationAPI getLivingApplicationAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return getAPI(ApplicationAPI.class, session); }
private static <T> T getAPI(final Class<T> clazz, final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI, session); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); }
protected LoginAPI getLoginAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getLoginAPI(); }
public static void undeployCommand(final APISession apiSession) throws BonitaException { final CommandAPI commandAPI = TenantAPIAccessor.getCommandAPI(apiSession); try { commandAPI.unregister(WAIT_SERVER_COMMAND); commandAPI.unregister(ADD_HANDLER_COMMAND); LOGGER.debug("commands undeployed"); } catch (final BonitaException e) { // ok LOGGER.debug("error undeploying command (maybe already undeployed?) " + e.getMessage()); } }
public static TenantAdministrationAPI getTenantAdministrationAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return getAPI(TenantAdministrationAPI.class, session); }
private static <T> T getAPI(final Class<T> clazz, final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI, session); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); }
public LoginAPI getLoginAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getLoginAPI(); }
public static void undeployCommand(final APISession apiSession) throws BonitaException { final CommandAPI commandAPI = TenantAPIAccessor.getCommandAPI(apiSession); commandAPI.unregister("waitServerCommand"); commandAPI.removeDependency("commands"); }
public static ApplicationAPI getLivingApplicationAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return getAPI(ApplicationAPI.class, session); }
public static void deployCommand(final APISession apiSession) throws BonitaException { final CommandAPI commandAPI = TenantAPIAccessor.getCommandAPI(apiSession); final Map<String, Serializable> parameters = new HashMap<>(1); final CommandDescriptor waitServerCommand; try { waitServerCommand = commandAPI.register(WAIT_SERVER_COMMAND, WAIT_SERVER_COMMAND, "org.bonitasoft.engine.synchro.WaitServerCommand"); } catch (AlreadyExistsException e) { return; } final CommandDescriptor addHandlerCommand = commandAPI.register(ADD_HANDLER_COMMAND, ADD_HANDLER_COMMAND, "org.bonitasoft.engine.synchro.AddHandlerCommand"); parameters.put("commands", (Serializable) Arrays.asList(waitServerCommand.getId(), addHandlerCommand.getId())); commandAPI.execute(ADD_HANDLER_COMMAND, parameters); LOGGER.debug("commands deployed"); }
public static PageAPI getCustomPageAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return getAPI(PageAPI.class, session); }
public static void deployCommand(final APISession apiSession) throws BonitaException { final CommandAPI commandAPI = TenantAPIAccessor.getCommandAPI(apiSession); byte[] commandJar; try { commandJar = IOUtil.getAllContentFrom(APITestUtil.class.getResourceAsStream("/server-command.bak")); } catch (final IOException e) { throw new RetrieveException(e); } commandAPI.addDependency("commands", commandJar); commandAPI.register("waitServerCommand", "waitServerCommand", "org.bonitasoft.engine.test.synchro.WaitServerCommand"); commandAPI.register("addHandlerCommand", "addHandlerCommand", "org.bonitasoft.engine.test.synchro.AddHandlerCommand"); final Map<String, Serializable> parameters = Collections.emptyMap(); commandAPI.execute("addHandlerCommand", parameters); }
public static ProcessAPI getProcessAPI(final APISession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return getAPI(ProcessAPI.class, session); }