Package org.bonitasoft.engine.api
Class APIClient
- java.lang.Object
-
- org.bonitasoft.engine.api.APIClient
-
public class APIClient extends java.lang.ObjectBonita Community Edition APIs client.
IdentityAPI,ProcessAPI,ThemeAPICommandAPI,ProfileAPI,TenantAdministrationAPI,PageAPI,ApplicationAPI,PermissionAPI,BusinessDataAPI(deprecated as of 7.3),
-
-
Field Summary
Fields Modifier and Type Field Description protected org.bonitasoft.engine.session.APISessionsession
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected <T> TgetAPI(java.lang.Class<T> apiClass)org.bonitasoft.engine.api.ApplicationAPIgetApplicationAPI()Get API to manage Bonita Applications.org.bonitasoft.engine.api.BusinessDataAPIgetBusinessDataAPI()Deprecated.as of 7.3, seeBusinessDataAPIfor replacementsorg.bonitasoft.engine.api.CommandAPIgetCommandAPI()Get API to manage commands and Tenant level dependencies.org.bonitasoft.engine.api.PageAPIgetCustomPageAPI()Get API to manage portal pages.<T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO>
TgetDAO(java.lang.Class<T> daoInterface)Get an implementation instance of the DAO Interface.org.bonitasoft.engine.api.IdentityAPIgetIdentityAPI()Get API to manage the organization, i.e., users, groups and roles.org.bonitasoft.engine.api.ApplicationAPIgetLivingApplicationAPI()Get API to manage Living Applications.protected org.bonitasoft.engine.api.LoginAPIgetLoginAPI()protected <T extends org.bonitasoft.engine.api.LoginAPI>
TgetLoginAPI(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.PermissionAPIgetPermissionAPI()Get API to dynamically check REST API call access right.org.bonitasoft.engine.api.ProcessAPIgetProcessAPI()Get API to manage the business processes.org.bonitasoft.engine.api.ProfileAPIgetProfileAPI()Get API to manage portal user profiles.org.bonitasoft.engine.session.APISessiongetSession()org.bonitasoft.engine.api.TenantAdministrationAPIgetTenantAdministrationAPI()Get API to manage the tenant your are logged on.org.bonitasoft.engine.api.ThemeAPIgetThemeAPI()Deprecated.since 7.13.0, ThemeAPI does nothing.protected <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO>
java.lang.Class<T>loadClass(java.lang.Class<T> daoInterface)Loads the class of theBusinessObjectDAOaccording to its class name.voidlogin(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.voidlogout()Disconnect user from tenant APIs.
-
-
-
Method Detail
-
getSession
public org.bonitasoft.engine.session.APISession getSession()
-
getAPI
protected <T> T getAPI(java.lang.Class<T> apiClass)
-
getLoginAPI
protected org.bonitasoft.engine.api.LoginAPI getLoginAPI()
-
getLoginAPI
protected <T extends org.bonitasoft.engine.api.LoginAPI> T 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.- Type Parameters:
T- The type of the API, extendingLoginAPI- Parameters:
apiClass- the API to retrieve- Returns:
- the retrieved API
- Throws:
java.lang.IllegalStateException- if the API cannot be retrieved.
-
login
public void login(java.lang.String username, java.lang.String password) throws org.bonitasoft.engine.platform.LoginExceptionConnects a user, identified by his (her) username and password, in order to use API methods of a tenant.- Parameters:
username- the user namepassword- the password- Throws:
org.bonitasoft.engine.platform.LoginException- occurs when an exception is thrown during the login (userName does not exist, or couple (userName, password) is incorrect)- Since:
- 7.2
-
logout
public void logout() throws org.bonitasoft.engine.platform.LogoutExceptionDisconnect user from tenant APIs.- Throws:
org.bonitasoft.engine.platform.LogoutException- Since:
- 7.2
-
getDAO
public <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO> T getDAO(java.lang.Class<T> daoInterface) throws BusinessObjectDaoCreationExceptionGet an implementation instance of the DAO Interface.- Parameters:
daoInterface- the interface of the DAO- Returns:
- the implementation of the DAO
- Throws:
BusinessObjectDaoCreationException- if the factory is not able to instantiate the DAO
-
loadClass
protected <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO> java.lang.Class<T> loadClass(java.lang.Class<T> daoInterface) throws java.lang.ClassNotFoundExceptionLoads the class of theBusinessObjectDAOaccording to its class name.The loading is done in the current Thread ClassLoader.
- Parameters:
daoInterface- the DAO's interface- Returns:
- the Implementation class of the BusinessObjectDAO
- Throws:
java.lang.ClassNotFoundException- if the implementation class name is unknown by the current Thread ClassLoader
-
getIdentityAPI
public org.bonitasoft.engine.api.IdentityAPI getIdentityAPI()
Get API to manage the organization, i.e., users, groups and roles.- Since:
- 7.2
-
getProcessAPI
public org.bonitasoft.engine.api.ProcessAPI getProcessAPI()
Get API to manage the business processes.- Since:
- 7.2
-
getThemeAPI
@Deprecated(since="7.13.0") public org.bonitasoft.engine.api.ThemeAPI getThemeAPI()
Deprecated.since 7.13.0, ThemeAPI does nothing. There is no replacement, as it used to serve old removed feature.Get API to manage themes (Portal and mobile).- Since:
- 7.2
-
getCommandAPI
public org.bonitasoft.engine.api.CommandAPI getCommandAPI()
Get API to manage commands and Tenant level dependencies.- Since:
- 7.2
-
getProfileAPI
public org.bonitasoft.engine.api.ProfileAPI getProfileAPI()
Get API to manage portal user profiles.- Since:
- 7.2
-
getTenantAdministrationAPI
public org.bonitasoft.engine.api.TenantAdministrationAPI getTenantAdministrationAPI()
Get API to manage the tenant your are logged on.- Since:
- 7.2
-
getCustomPageAPI
public org.bonitasoft.engine.api.PageAPI getCustomPageAPI()
Get API to manage portal pages.- Since:
- 7.2
-
getLivingApplicationAPI
public org.bonitasoft.engine.api.ApplicationAPI getLivingApplicationAPI()
Get API to manage Living Applications.- Since:
- 7.2
-
getPermissionAPI
public org.bonitasoft.engine.api.PermissionAPI getPermissionAPI()
Get API to dynamically check REST API call access right.- Since:
- 7.2
-
getBusinessDataAPI
@Deprecated public org.bonitasoft.engine.api.BusinessDataAPI getBusinessDataAPI()
Deprecated.as of 7.3, seeBusinessDataAPIfor replacementsGet API to access Business Data related to processes.- Since:
- 7.2
-
getApplicationAPI
public org.bonitasoft.engine.api.ApplicationAPI getApplicationAPI()
Get API to manage Bonita Applications.- Since:
- 7.10
-
-