Class BusinessDataModelRepositoryImpl
- java.lang.Object
-
- org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl
-
- All Implemented Interfaces:
BusinessDataModelRepository
public class BusinessDataModelRepositoryImpl extends java.lang.Object implements BusinessDataModelRepository
- Author:
- Colin PUY
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringBDR_DEPENDENCY_FILENAME
-
Constructor Summary
Constructors Constructor Description BusinessDataModelRepositoryImpl(DependencyService dependencyService, ClassLoaderService classLoaderService, SchemaManager schemaManager, TenantResourcesService tenantResourcesService, long tenantId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected longcreateAndDeployServerBDMJar(long tenantId, org.bonitasoft.engine.bdm.model.BusinessObjectModel model)voiddropAndUninstall(long tenantId)protected byte[]generateClientBDMZip(org.bonitasoft.engine.bdm.model.BusinessObjectModel model)protected byte[]generateServerBDMJar(org.bonitasoft.engine.bdm.model.BusinessObjectModel model)org.bonitasoft.engine.bdm.model.BusinessObjectModelgetBusinessObjectModel()Returns the currently deployed Business Object Data Model, or null if no BDM is deployed.protected org.bonitasoft.engine.bdm.model.BusinessObjectModelgetBusinessObjectModel(byte[] bdmZip)byte[]getClientBDMZip()Retrieve the client side BDM generated zip.java.lang.StringgetInstalledBDMVersion()Returns the currently deployed BDM version, or null if no BDM is deployed.java.lang.Stringinstall(byte[] bdmZip, long userId)Deploys a Business Data Model / repository on the specified tenant.booleanisBDMDeployed()voiduninstall(long tenantId)Undeploy Business Data Model from specified tenantprotected voidupdate(java.util.Set<java.lang.String> annotatedClassNames)
-
-
-
Field Detail
-
BDR_DEPENDENCY_FILENAME
public static final java.lang.String BDR_DEPENDENCY_FILENAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
BusinessDataModelRepositoryImpl
public BusinessDataModelRepositoryImpl(DependencyService dependencyService, ClassLoaderService classLoaderService, SchemaManager schemaManager, TenantResourcesService tenantResourcesService, long tenantId)
-
-
Method Detail
-
getClientBDMZip
public byte[] getClientBDMZip() throws SBusinessDataRepositoryExceptionDescription copied from interface:BusinessDataModelRepositoryRetrieve the client side BDM generated zip. This zip contains jars with BDM Pojos and DAOs- Specified by:
getClientBDMZipin interfaceBusinessDataModelRepository- Returns:
- the zip content
- Throws:
SBusinessDataRepositoryException
-
getInstalledBDMVersion
public java.lang.String getInstalledBDMVersion() throws SBusinessDataRepositoryExceptionDescription copied from interface:BusinessDataModelRepositoryReturns the currently deployed BDM version, or null if no BDM is deployed.- Specified by:
getInstalledBDMVersionin interfaceBusinessDataModelRepository- Returns:
- the currently deployed BDM version, or null if no BDM is deployed.
- Throws:
SBusinessDataRepositoryException- if the BDM cannot be retrieved.
-
getBusinessObjectModel
public org.bonitasoft.engine.bdm.model.BusinessObjectModel getBusinessObjectModel() throws SBusinessDataRepositoryExceptionDescription copied from interface:BusinessDataModelRepositoryReturns the currently deployed Business Object Data Model, or null if no BDM is deployed.- Specified by:
getBusinessObjectModelin interfaceBusinessDataModelRepository- Returns:
- the currently deployed Business Object Data Model, or null if no BDM is deployed.
- Throws:
SBusinessDataRepositoryException- if the BDM cannot be retrieved.
-
isBDMDeployed
public boolean isBDMDeployed()
- Specified by:
isBDMDeployedin interfaceBusinessDataModelRepository
-
install
public java.lang.String install(byte[] bdmZip, long userId) throws SBusinessDataRepositoryDeploymentException, org.bonitasoft.engine.business.data.InvalidBusinessDataModelExceptionDescription copied from interface:BusinessDataModelRepositoryDeploys a Business Data Model / repository on the specified tenant.- Specified by:
installin interfaceBusinessDataModelRepository- Parameters:
bdmZip- the Business Data Model, as a jar containing the Business Object classes to deploy.userId- the ID of the user installing the BDM, typically tenant admin (id=-1)- Returns:
- the version of the BDM just deployed.
- Throws:
SBusinessDataRepositoryDeploymentException- if a deployment exception occurs.org.bonitasoft.engine.business.data.InvalidBusinessDataModelException
-
createAndDeployServerBDMJar
protected long createAndDeployServerBDMJar(long tenantId, org.bonitasoft.engine.bdm.model.BusinessObjectModel model) throws SBusinessDataRepositoryDeploymentException
-
update
protected void update(java.util.Set<java.lang.String> annotatedClassNames) throws SBusinessDataRepositoryDeploymentException
-
getBusinessObjectModel
protected org.bonitasoft.engine.bdm.model.BusinessObjectModel getBusinessObjectModel(byte[] bdmZip) throws org.bonitasoft.engine.business.data.InvalidBusinessDataModelException- Throws:
org.bonitasoft.engine.business.data.InvalidBusinessDataModelException
-
generateServerBDMJar
protected byte[] generateServerBDMJar(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) throws SBusinessDataRepositoryDeploymentException
-
generateClientBDMZip
protected byte[] generateClientBDMZip(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) throws SBusinessDataRepositoryDeploymentException, java.io.IOException- Throws:
SBusinessDataRepositoryDeploymentExceptionjava.io.IOException
-
uninstall
public void uninstall(long tenantId) throws SBusinessDataRepositoryExceptionDescription copied from interface:BusinessDataModelRepositoryUndeploy Business Data Model from specified tenant- Specified by:
uninstallin interfaceBusinessDataModelRepository- Parameters:
tenantId- the ID of the tenant to undeploy the Business Data Model from- Throws:
SBusinessDataRepositoryException- if error occurs during undeployement
-
dropAndUninstall
public void dropAndUninstall(long tenantId) throws SBusinessDataRepositoryException- Specified by:
dropAndUninstallin interfaceBusinessDataModelRepository- Throws:
SBusinessDataRepositoryException
-
-