Class DeployCmd

    • Method Detail

      • acquireExclusiveLock

        protected void acquireExclusiveLock​(CommandContext commandContext)
      • registerWithJobExecutor

        protected void registerWithJobExecutor​(CommandContext commandContext,
                                               Deployment deployment)
      • getMissingElements

        protected java.util.List<java.lang.String> getMissingElements​(java.util.Set<java.lang.String> expected,
                                                                      java.util.Map<java.lang.String,​?> actual)
      • getResourcesByDeploymentId

        protected java.util.List<ResourceEntity> getResourcesByDeploymentId​(java.util.Set<java.lang.String> deploymentIds,
                                                                            CommandContext commandContext)
      • getResourcesById

        protected java.util.List<ResourceEntity> getResourcesById​(java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> resourcesById,
                                                                  CommandContext commandContext)
      • getResourcesByName

        protected java.util.List<ResourceEntity> getResourcesByName​(java.util.Map<java.lang.String,​java.util.Set<java.lang.String>> resourcesByName,
                                                                    CommandContext commandContext)
      • getProcessDefinitionsFromResources

        protected java.lang.String[] getProcessDefinitionsFromResources​(CommandContext commandContext,
                                                                        DeploymentEntity deploymentToRegister,
                                                                        java.util.Collection ignoredResources)
      • parseProcessDefinitionKeys

        protected java.util.Set<java.lang.String> parseProcessDefinitionKeys​(java.util.Collection<Resource> resources)
      • getAllDeploymentIds

        protected java.util.Set<java.lang.String> getAllDeploymentIds​(DeploymentBuilderImpl deploymentBuilder)
      • checkDuplicateResourceName

        protected void checkDuplicateResourceName​(java.util.List<ResourceEntity> resources)
      • checkCreateAndReadDeployments

        protected void checkCreateAndReadDeployments​(CommandContext commandContext,
                                                     java.util.Set<java.lang.String> deploymentIds)
      • isBpmnResource

        protected boolean isBpmnResource​(Resource resourceEntity)
      • isCmmnResource

        protected boolean isCmmnResource​(Resource resourceEntity)
      • ensureDeploymentsWithIdsExists

        protected void ensureDeploymentsWithIdsExists​(java.util.Set<java.lang.String> expected,
                                                      java.util.List<DeploymentEntity> actual)
      • ensureResourcesWithIdsExist

        protected void ensureResourcesWithIdsExist​(java.lang.String deploymentId,
                                                   java.util.Set<java.lang.String> expectedIds,
                                                   java.util.List<ResourceEntity> actual)
      • ensureResourcesWithNamesExist

        protected void ensureResourcesWithNamesExist​(java.lang.String deploymentId,
                                                     java.util.Set<java.lang.String> expectedNames,
                                                     java.util.List<ResourceEntity> actual)
      • ensureResourcesWithKeysExist

        protected void ensureResourcesWithKeysExist​(java.lang.String deploymentId,
                                                    java.util.Set<java.lang.String> expectedKeys,
                                                    java.util.Map<java.lang.String,​ResourceEntity> actual,
                                                    java.lang.String valueProperty)
      • isRetryable

        public boolean isRetryable()
        When CockroachDB is used, this command may be retried multiple times until it is successful, or the retries are exhausted. CockroachDB uses a stricter, SERIALIZABLE transaction isolation which ensures a serialized manner of transaction execution. A concurrent transaction that attempts to modify the same data as another transaction is required to abort, rollback and retry. This also makes our use-case of pessimistic locks redundant since we only use them as synchronization barriers, and not to lock actual data which would protect it from concurrent modifications. The Deploy command only executes internal code, so we are certain that a retry of a failed deployment will not impact user data, and may be performed multiple times.
        Specified by:
        isRetryable in interface Command<DeploymentWithDefinitions>
        Returns:
        true if the CrdbTransactionRetryInterceptor can make a transparent retry of this command upon failure with a CrdbTransactionRetryException (only used when running on CockroachDB).