public class APIClient
extends java.lang.Object
IdentityAPI,ProcessAPI,ThemeAPICommandAPI,ProfileAPI,TenantAdministrationAPI,PageAPI,ApplicationAPI,PermissionAPI,BusinessDataAPI (deprecated as of 7.3),| Modifier and Type | Field and Description |
|---|---|
protected org.bonitasoft.engine.session.APISession |
session |
| Constructor and Description |
|---|
APIClient() |
APIClient(org.bonitasoft.engine.session.APISession session) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
getAPI(java.lang.Class<T> apiClass) |
org.bonitasoft.engine.api.BusinessDataAPI |
getBusinessDataAPI()
Deprecated.
as of 7.3, see
BusinessDataAPI for replacements |
org.bonitasoft.engine.api.CommandAPI |
getCommandAPI()
Get API to manage commands and Tenant level dependencies.
|
org.bonitasoft.engine.api.PageAPI |
getCustomPageAPI()
Get API to manage portal pages.
|
<T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO> |
getDAO(java.lang.Class<T> daoInterface)
Get an implementation instance of the DAO Interface.
|
org.bonitasoft.engine.api.IdentityAPI |
getIdentityAPI()
Get API to manage the organization, i.e., users, groups and roles.
|
org.bonitasoft.engine.api.ApplicationAPI |
getLivingApplicationAPI()
Get API to manage Living Applications.
|
protected org.bonitasoft.engine.api.LoginAPI |
getLoginAPI() |
protected <T extends org.bonitasoft.engine.api.LoginAPI> |
getLoginAPI(java.lang.Class<T> apiClass)
This methods serves the purpose to remove confusion between getAPI() when a session is mandatory, and this one, where no session is needed to access the
API class.
|
org.bonitasoft.engine.api.PermissionAPI |
getPermissionAPI()
Get API to dynamically check REST API call access right.
|
org.bonitasoft.engine.api.ProcessAPI |
getProcessAPI()
Get API to manage the business processes.
|
org.bonitasoft.engine.api.ProfileAPI |
getProfileAPI()
Get API to manage portal user profiles.
|
org.bonitasoft.engine.session.APISession |
getSession() |
org.bonitasoft.engine.api.TenantAdministrationAPI |
getTenantAdministrationAPI()
Get API to manage the tenant your are logged on.
|
org.bonitasoft.engine.api.ThemeAPI |
getThemeAPI()
Get API to manage themes (Portal and mobile).
|
protected <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO> |
loadClass(java.lang.Class<T> daoInterface)
Loads the class of the
BusinessObjectDAO according to its class name. |
void |
login(java.lang.String username,
java.lang.String password)
Connects a user, identified by his (her) username and password, in order to use API methods of a tenant.
|
void |
logout()
Disconnect user from tenant APIs.
|
public APIClient()
public APIClient(org.bonitasoft.engine.session.APISession session)
public org.bonitasoft.engine.session.APISession getSession()
protected <T> T getAPI(java.lang.Class<T> apiClass)
protected org.bonitasoft.engine.api.LoginAPI getLoginAPI()
protected <T extends org.bonitasoft.engine.api.LoginAPI> T getLoginAPI(java.lang.Class<T> apiClass)
T - The type of the API, extending LoginAPIapiClass - the API to retrievejava.lang.IllegalStateException - if the API cannot be retrieved.public void login(java.lang.String username,
java.lang.String password)
throws org.bonitasoft.engine.platform.LoginException
username - the user namepassword - the passwordorg.bonitasoft.engine.platform.LoginException - occurs when an exception is thrown during the login (userName does not exist, or couple (userName, password) is incorrect)public void logout()
throws org.bonitasoft.engine.platform.LogoutException
org.bonitasoft.engine.platform.LogoutExceptionpublic <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO> T getDAO(java.lang.Class<T> daoInterface)
throws BusinessObjectDaoCreationException
daoInterface - the interface of the DAOBusinessObjectDaoCreationException - if the factory is not able to instantiate the DAOprotected <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO> java.lang.Class<T> loadClass(java.lang.Class<T> daoInterface)
throws java.lang.ClassNotFoundException
BusinessObjectDAO according to its class name.
The loading is done in the current Thread ClassLoader.
daoInterface - the DAO's interfacejava.lang.ClassNotFoundException - if the implementation class name is unknown by the current Thread ClassLoaderpublic org.bonitasoft.engine.api.IdentityAPI getIdentityAPI()
public org.bonitasoft.engine.api.ProcessAPI getProcessAPI()
public org.bonitasoft.engine.api.ThemeAPI getThemeAPI()
public org.bonitasoft.engine.api.CommandAPI getCommandAPI()
public org.bonitasoft.engine.api.ProfileAPI getProfileAPI()
public org.bonitasoft.engine.api.TenantAdministrationAPI getTenantAdministrationAPI()
public org.bonitasoft.engine.api.PageAPI getCustomPageAPI()
public org.bonitasoft.engine.api.ApplicationAPI getLivingApplicationAPI()
public org.bonitasoft.engine.api.PermissionAPI getPermissionAPI()
@Deprecated public org.bonitasoft.engine.api.BusinessDataAPI getBusinessDataAPI()
BusinessDataAPI for replacements