org.camunda.bpm.engine.impl.cmd
Class DeployCmd<T>

java.lang.Object
  extended by org.camunda.bpm.engine.impl.cmd.DeployCmd<T>
All Implemented Interfaces:
Serializable, Command<Deployment>

public class DeployCmd<T>
extends Object
implements Command<Deployment>, Serializable

Author:
Tom Baeyens, Joram Barrez, Thorben Lindhauer, Daniel Meyer
See Also:
Serialized Form

Field Summary
protected  DeploymentBuilderImpl deploymentBuilder
           
 
Constructor Summary
DeployCmd(DeploymentBuilderImpl deploymentBuilder)
           
 
Method Summary
protected  void acquireExclusiveLock(CommandContext commandContext)
           
protected  void addResources(List<ResourceEntity> resources, DeploymentBuilderImpl deploymentBuilder)
           
protected  void checkDuplicateResourceName(List<ResourceEntity> resources)
           
protected  void checkReadDeployments(AuthorizationManager authorizationManager, Set<String> deploymentIds)
           
protected  void createUserOperationLog(DeploymentBuilderImpl deploymentBuilder, Deployment deployment, CommandContext commandContext)
           
protected  void deploy(DeploymentEntity deployment)
           
protected  Deployment doExecute(CommandContext commandContext)
           
protected  void ensureDeploymentsWithIdsExists(Set<String> expected, List<DeploymentEntity> actual)
           
protected  void ensureResourcesWithIdsExist(String deploymentId, Set<String> expectedIds, List<ResourceEntity> actual)
           
protected  void ensureResourcesWithKeysExist(String deploymentId, Set<String> expectedKeys, Map<String,ResourceEntity> actual, String valueProperty)
           
protected  void ensureResourcesWithNamesExist(String deploymentId, Set<String> expectedNames, List<ResourceEntity> actual)
           
 Deployment execute(CommandContext commandContext)
           
protected  Set<String> findDeploymentIdsForProcessDefinitions(CommandContext commandContext, Set<String> processDefinitionKeys)
           
protected  Set<String> getAllDeploymentIds(DeploymentBuilderImpl deploymentBuilder)
           
protected  List<? extends ProcessDefinition> getDeployedProcesses(DeploymentEntity deployment)
           
protected  DeploymentEntity getExistingDeployment(CommandContext commandContext, String deploymentName)
           
protected  List<String> getMissingElements(Set<String> expected, Map<String,?> actual)
           
protected  List<ResourceEntity> getResources(DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext)
           
protected  List<ResourceEntity> getResourcesByDeploymentId(Set<String> deploymentIds, CommandContext commandContext)
           
protected  List<ResourceEntity> getResourcesById(Map<String,Set<String>> resourcesById, CommandContext commandContext)
           
protected  List<ResourceEntity> getResourcesByName(Map<String,Set<String>> resourcesByName, CommandContext commandContext)
           
protected  DeploymentEntity initDeployment()
           
protected  boolean isBpmnResource(ResourceEntity resourceEntity)
           
protected  boolean isCmmnResource(ResourceEntity resourceEntity)
           
protected  ProcessApplicationRegistration registerProcessApplication(CommandContext commandContext, DeploymentEntity deployment, Set<String> processKeysToRegisterFor)
           
protected  void registerWithJobExecutor(CommandContext commandContext, DeploymentEntity deployment)
           
protected  Map<String,ResourceEntity> resolveResourcesToDeploy(CommandContext commandContext, DeploymentEntity deployment)
           
protected  boolean resourcesDiffer(ResourceEntity resource, ResourceEntity existing)
           
protected  Set<String> resumePreviousByDeploymentName(CommandContext commandContext, DeploymentEntity deployment)
          Searches for previous deployments with the same name.
protected  Set<String> resumePreviousByProcessDefinitionKey(CommandContext commandContext, DeploymentEntity deployment, Set<String> processKeysToRegisterFor)
          Searches in previous deployments for the same processes and retrieves the deployment ids.
protected  Set<String> retrieveProcessKeysFromResources(Map<String,ResourceEntity> resources)
           
protected  void scheduleProcessDefinitionActivation(CommandContext commandContext, DeploymentEntity deployment)
           
protected  void setDeploymentName(String deploymentId, DeploymentBuilderImpl deploymentBuilder, CommandContext commandContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deploymentBuilder

protected DeploymentBuilderImpl deploymentBuilder
Constructor Detail

DeployCmd

public DeployCmd(DeploymentBuilderImpl deploymentBuilder)
Method Detail

execute

public Deployment execute(CommandContext commandContext)
Specified by:
execute in interface Command<Deployment>

doExecute

protected Deployment doExecute(CommandContext commandContext)

createUserOperationLog

protected void createUserOperationLog(DeploymentBuilderImpl deploymentBuilder,
                                      Deployment deployment,
                                      CommandContext commandContext)

setDeploymentName

protected void setDeploymentName(String deploymentId,
                                 DeploymentBuilderImpl deploymentBuilder,
                                 CommandContext commandContext)

getResources

protected List<ResourceEntity> getResources(DeploymentBuilderImpl deploymentBuilder,
                                            CommandContext commandContext)

getResourcesByDeploymentId

protected List<ResourceEntity> getResourcesByDeploymentId(Set<String> deploymentIds,
                                                          CommandContext commandContext)

getResourcesById

protected List<ResourceEntity> getResourcesById(Map<String,Set<String>> resourcesById,
                                                CommandContext commandContext)

getResourcesByName

protected List<ResourceEntity> getResourcesByName(Map<String,Set<String>> resourcesByName,
                                                  CommandContext commandContext)

addResources

protected void addResources(List<ResourceEntity> resources,
                            DeploymentBuilderImpl deploymentBuilder)

checkDuplicateResourceName

protected void checkDuplicateResourceName(List<ResourceEntity> resources)

ensureDeploymentsWithIdsExists

protected void ensureDeploymentsWithIdsExists(Set<String> expected,
                                              List<DeploymentEntity> actual)

ensureResourcesWithIdsExist

protected void ensureResourcesWithIdsExist(String deploymentId,
                                           Set<String> expectedIds,
                                           List<ResourceEntity> actual)

ensureResourcesWithNamesExist

protected void ensureResourcesWithNamesExist(String deploymentId,
                                             Set<String> expectedNames,
                                             List<ResourceEntity> actual)

ensureResourcesWithKeysExist

protected void ensureResourcesWithKeysExist(String deploymentId,
                                            Set<String> expectedKeys,
                                            Map<String,ResourceEntity> actual,
                                            String valueProperty)

getMissingElements

protected List<String> getMissingElements(Set<String> expected,
                                          Map<String,?> actual)

getAllDeploymentIds

protected Set<String> getAllDeploymentIds(DeploymentBuilderImpl deploymentBuilder)

checkReadDeployments

protected void checkReadDeployments(AuthorizationManager authorizationManager,
                                    Set<String> deploymentIds)

acquireExclusiveLock

protected void acquireExclusiveLock(CommandContext commandContext)

initDeployment

protected DeploymentEntity initDeployment()

resolveResourcesToDeploy

protected Map<String,ResourceEntity> resolveResourcesToDeploy(CommandContext commandContext,
                                                              DeploymentEntity deployment)

resourcesDiffer

protected boolean resourcesDiffer(ResourceEntity resource,
                                  ResourceEntity existing)

deploy

protected void deploy(DeploymentEntity deployment)

getExistingDeployment

protected DeploymentEntity getExistingDeployment(CommandContext commandContext,
                                                 String deploymentName)

scheduleProcessDefinitionActivation

protected void scheduleProcessDefinitionActivation(CommandContext commandContext,
                                                   DeploymentEntity deployment)

registerProcessApplication

protected ProcessApplicationRegistration registerProcessApplication(CommandContext commandContext,
                                                                    DeploymentEntity deployment,
                                                                    Set<String> processKeysToRegisterFor)

resumePreviousByProcessDefinitionKey

protected Set<String> resumePreviousByProcessDefinitionKey(CommandContext commandContext,
                                                           DeploymentEntity deployment,
                                                           Set<String> processKeysToRegisterFor)
Searches in previous deployments for the same processes and retrieves the deployment ids.

Parameters:
commandContext -
deployment - the current deployment
processKeysToRegisterFor - the process keys this process application wants to register
deploymentsToRegister - the set where to add further deployments this process application should be registered for
Returns:
a set of deployment ids that contain versions of the processKeysToRegisterFor

resumePreviousByDeploymentName

protected Set<String> resumePreviousByDeploymentName(CommandContext commandContext,
                                                     DeploymentEntity deployment)
Searches for previous deployments with the same name.

Parameters:
commandContext -
deployment - the current deployment
Returns:
a set of deployment ids

getDeployedProcesses

protected List<? extends ProcessDefinition> getDeployedProcesses(DeploymentEntity deployment)

retrieveProcessKeysFromResources

protected Set<String> retrieveProcessKeysFromResources(Map<String,ResourceEntity> resources)

isBpmnResource

protected boolean isBpmnResource(ResourceEntity resourceEntity)

isCmmnResource

protected boolean isCmmnResource(ResourceEntity resourceEntity)

findDeploymentIdsForProcessDefinitions

protected Set<String> findDeploymentIdsForProcessDefinitions(CommandContext commandContext,
                                                             Set<String> processDefinitionKeys)

registerWithJobExecutor

protected void registerWithJobExecutor(CommandContext commandContext,
                                       DeploymentEntity deployment)


Copyright © 2016 camunda services GmbH. All rights reserved.