public class APIClient extends Object
IdentityAPI
,ProcessAPI
,ThemeAPI
CommandAPI
,ProfileAPI
,TenantAdministrationAPI
,PageAPI
,ApplicationAPI
,PermissionAPI
,BusinessDataAPI
(deprecated as of 7.3),Modifier and Type | Field and Description |
---|---|
protected APISession |
session |
Constructor and Description |
---|
APIClient() |
APIClient(APISession session) |
Modifier and Type | Method and Description |
---|---|
protected <T> T |
getAPI(Class<T> apiClass) |
ApplicationAPI |
getApplicationAPI()
Get API to manage Bonita Applications.
|
BusinessDataAPI |
getBusinessDataAPI()
Deprecated.
as of 7.3, see
BusinessDataAPI for replacements |
CommandAPI |
getCommandAPI()
Get API to manage commands and Tenant level dependencies.
|
PageAPI |
getCustomPageAPI()
Get API to manage portal pages.
|
<T extends BusinessObjectDAO> |
getDAO(Class<T> daoInterface)
Get an implementation instance of the DAO Interface.
|
IdentityAPI |
getIdentityAPI()
Get API to manage the organization, i.e., users, groups and roles.
|
ApplicationAPI |
getLivingApplicationAPI()
Get API to manage Living Applications.
|
protected LoginAPI |
getLoginAPI() |
protected <T extends LoginAPI> |
getLoginAPI(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.
|
PermissionAPI |
getPermissionAPI()
Get API to dynamically check REST API call access right.
|
ProcessAPI |
getProcessAPI()
Get API to manage the business processes.
|
ProfileAPI |
getProfileAPI()
Get API to manage portal user profiles.
|
APISession |
getSession() |
TenantAdministrationAPI |
getTenantAdministrationAPI()
Get API to manage the tenant your are logged on.
|
ThemeAPI |
getThemeAPI()
Get API to manage themes (Portal and mobile).
|
protected <T extends BusinessObjectDAO> |
loadClass(Class<T> daoInterface)
Loads the class of the
BusinessObjectDAO according to its class name. |
void |
login(String username,
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.
|
protected APISession session
public APIClient()
public APIClient(APISession session)
public APISession getSession()
protected <T> T getAPI(Class<T> apiClass)
protected LoginAPI getLoginAPI()
protected <T extends LoginAPI> T getLoginAPI(Class<T> apiClass)
T
- The type of the API, extending LoginAPI
apiClass
- the API to retrieveIllegalStateException
- if the API cannot be retrieved.public void login(String username, String password) throws LoginException
username
- the user namepassword
- the passwordLoginException
- occurs when an exception is thrown during the login (userName does not exist, or couple (userName,
password) is incorrect)public void logout() throws LogoutException
LogoutException
public <T extends BusinessObjectDAO> T getDAO(Class<T> daoInterface) throws BusinessObjectDaoCreationException
daoInterface
- the interface of the DAOBusinessObjectDaoCreationException
- if the factory is not able to instantiate the DAOprotected <T extends BusinessObjectDAO> Class<T> loadClass(Class<T> daoInterface) throws ClassNotFoundException
BusinessObjectDAO
according to its class name.
The loading is done in the current Thread ClassLoader.
daoInterface
- the DAO's interfaceClassNotFoundException
- if the implementation class name is unknown by the current Thread ClassLoaderpublic IdentityAPI getIdentityAPI()
public ProcessAPI getProcessAPI()
public ThemeAPI getThemeAPI()
public CommandAPI getCommandAPI()
public ProfileAPI getProfileAPI()
public TenantAdministrationAPI getTenantAdministrationAPI()
public PageAPI getCustomPageAPI()
public ApplicationAPI getLivingApplicationAPI()
public PermissionAPI getPermissionAPI()
@Deprecated public BusinessDataAPI getBusinessDataAPI()
BusinessDataAPI
for replacementspublic ApplicationAPI getApplicationAPI()
Copyright © 2020 Bonitasoft S.A. All rights reserved.