Package org.bonitasoft.engine.api
Class APIClient
java.lang.Object
org.bonitasoft.engine.api.APIClient
Bonita Community Edition APIs client.
IdentityAPI,ProcessAPI,CommandAPI,ProfileAPI,TenantAdministrationAPI,PageAPI,ApplicationAPI,PermissionAPI,BusinessDataAPI(deprecated as of 7.3),MaintenanceAPI,
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> Torg.bonitasoft.engine.api.ApplicationAPIGet API to manage Bonita Applications.org.bonitasoft.engine.api.BusinessDataAPIDeprecated.org.bonitasoft.engine.api.CommandAPIGet API to manage commands and Tenant level dependencies.org.bonitasoft.engine.api.PageAPIGet API to manage portal pages.<T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO>
TGet an implementation instance of the DAO Interface.org.bonitasoft.engine.api.IdentityAPIGet API to manage the organization, i.e., users, groups and roles.org.bonitasoft.engine.api.ApplicationAPIGet API to manage Living Applications.protected org.bonitasoft.engine.api.LoginAPIprotected <T extends org.bonitasoft.engine.api.LoginAPI>
TgetLoginAPI(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.MaintenanceAPIGet API to manage Platform maintenance.org.bonitasoft.engine.api.PermissionAPIGet API to dynamically check REST API call access right.org.bonitasoft.engine.api.ProcessAPIGet API to manage the business processes.org.bonitasoft.engine.api.ProfileAPIGet API to manage portal user profiles.org.bonitasoft.engine.session.APISessionorg.bonitasoft.engine.api.TemporaryContentAPIGet API to store and retrieve temporary content like uploaded files.org.bonitasoft.engine.api.TenantAdministrationAPIGet API to manage the tenant your are logged on.protected <T extends org.bonitasoft.engine.bdm.dao.BusinessObjectDAO>
Class<T>Loads the class of theBusinessObjectDAOaccording to its class name.voidConnects a user, identified by his (her) username and password, in order to use API methods of a tenant.voidlogout()Disconnect user from tenant APIs.
-
Field Details
-
session
protected org.bonitasoft.engine.session.APISession session
-
-
Constructor Details
-
APIClient
public APIClient() -
APIClient
public APIClient(org.bonitasoft.engine.session.APISession session)
-
-
Method Details
-
getSession
public org.bonitasoft.engine.session.APISession getSession() -
getAPI
-
getLoginAPI
protected org.bonitasoft.engine.api.LoginAPI getLoginAPI() -
getLoginAPI
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:
IllegalStateException- if the API cannot be retrieved.
-
login
public void login(String username, String password) throws org.bonitasoft.engine.platform.LoginException Connects 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(Class<T> daoInterface) throws BusinessObjectDaoCreationException Get 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> Class<T> loadClass(Class<T> daoInterface) throws ClassNotFoundException Loads 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:
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
-
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.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
-
getTemporaryContentAPI
public org.bonitasoft.engine.api.TemporaryContentAPI getTemporaryContentAPI()Get API to store and retrieve temporary content like uploaded files. For internal usage only.- Since:
- 9.0
-
getMaintenanceAPI
public org.bonitasoft.engine.api.MaintenanceAPI getMaintenanceAPI()Get API to manage Platform maintenance.- Since:
- 9.0
-
BusinessDataAPIfor replacements