Exemple #1
0
        protected internal virtual DeploymentBuilder addRedeploymentResources(DeploymentBuilder builder, RedeploymentDto redeployment)
        {
            builder.source(redeployment.Source);

            IList <string> resourceIds   = redeployment.ResourceIds;
            IList <string> resourceNames = redeployment.ResourceNames;

            bool isResourceIdListEmpty   = resourceIds == null || resourceIds.Count == 0;
            bool isResourceNameListEmpty = resourceNames == null || resourceNames.Count == 0;

            if (isResourceIdListEmpty && isResourceNameListEmpty)
            {
                builder.addDeploymentResources(deploymentId);
            }
            else
            {
                if (!isResourceIdListEmpty)
                {
                    builder.addDeploymentResourcesById(deploymentId, resourceIds);
                }
                if (!isResourceNameListEmpty)
                {
                    builder.addDeploymentResourcesByName(deploymentId, resourceNames);
                }
            }
            return(builder);
        }