Class BusinessDataModelRepositoryImpl
java.lang.Object
org.bonitasoft.engine.business.data.impl.BusinessDataModelRepositoryImpl
- All Implemented Interfaces:
BusinessDataModelRepository
@Service("businessDataModelRepository")
public class BusinessDataModelRepositoryImpl
extends Object
implements BusinessDataModelRepository
- Author:
- Colin PUY
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBusinessDataModelRepositoryImpl(PlatformService platformService, TenantDependencyService dependencyService, ClassLoaderService classLoaderService, SchemaManager schemaManager, TenantResourcesService tenantResourcesService) -
Method Summary
Modifier and TypeMethodDescriptionprotected longcreateAndDeployServerBDMJar(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) voidprotected byte[]generateClientBDMZip(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) protected byte[]generateServerBDMJar(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) protected byte[]generateServerBDMJar(org.bonitasoft.engine.bdm.model.BusinessObjectModel model, boolean validateRuntimeClasses) org.bonitasoft.engine.bdm.model.BusinessObjectModelReturns the currently deployed Business Object Data Model, or null if no BDM is deployed.protected org.bonitasoft.engine.bdm.model.BusinessObjectModelgetBusinessObjectModel(byte[] bdmZip) byte[]Retrieve the client side BDM generated zip.Returns the currently deployed BDM version, or null if no BDM is deployed.install(byte[] bdmZip, long userId) Deploys a Business Data Model / repositorybooleanbooleanisDeployed(byte[] bdmArchive) Determine if the given BDM archive is equivalent to the currently deployed BDM.voidUndeploy Business Data Modelprotected void
-
Field Details
-
BDR_DEPENDENCY_FILENAME
- See Also:
-
-
Constructor Details
-
BusinessDataModelRepositoryImpl
public BusinessDataModelRepositoryImpl(PlatformService platformService, TenantDependencyService dependencyService, ClassLoaderService classLoaderService, SchemaManager schemaManager, TenantResourcesService tenantResourcesService)
-
-
Method Details
-
getClientBDMZip
Description 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
Description 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 String install(byte[] bdmZip, long userId) throws SBusinessDataRepositoryDeploymentException, org.bonitasoft.engine.business.data.InvalidBusinessDataModelException Description copied from interface:BusinessDataModelRepositoryDeploys a Business Data Model / repository- 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 tech 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(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) throws SBusinessDataRepositoryDeploymentException -
update
protected void update(Set<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 -
generateServerBDMJar
protected byte[] generateServerBDMJar(org.bonitasoft.engine.bdm.model.BusinessObjectModel model, boolean validateRuntimeClasses) throws SBusinessDataRepositoryDeploymentException -
generateClientBDMZip
protected byte[] generateClientBDMZip(org.bonitasoft.engine.bdm.model.BusinessObjectModel model) throws SBusinessDataRepositoryDeploymentException, IOException -
uninstall
Description copied from interface:BusinessDataModelRepositoryUndeploy Business Data Model- Specified by:
uninstallin interfaceBusinessDataModelRepository- Throws:
SBusinessDataRepositoryException- if error occurs during undeployement
-
dropAndUninstall
- Specified by:
dropAndUninstallin interfaceBusinessDataModelRepository- Throws:
SBusinessDataRepositoryException
-
isDeployed
public boolean isDeployed(byte[] bdmArchive) throws org.bonitasoft.engine.business.data.InvalidBusinessDataModelException, SBusinessDataRepositoryDeploymentException Description copied from interface:BusinessDataModelRepositoryDetermine if the given BDM archive is equivalent to the currently deployed BDM.- Specified by:
isDeployedin interfaceBusinessDataModelRepository- Parameters:
bdmArchive- the Business Data Model, as a zip containing the Business Object Model.- Returns:
- true If the given BDM archive is the same as the one already deployed. False otherwise.
- Throws:
org.bonitasoft.engine.business.data.InvalidBusinessDataModelException- if the given BDM archive is invalidSBusinessDataRepositoryDeploymentException- if the server jar generation of the given BDM fails
-