private Map<String, Object> createStagingParameters(Staging staging) { Map<String, Object> stagingParameters = new HashMap<>(); if (staging.getBuildpackUrl() != null) { stagingParameters.put(BUILDPACK_PARAMETER, staging.getBuildpackUrl()); } if (staging.getCommand() != null) { stagingParameters.put(COMMAND_PARAMETER, staging.getCommand()); } if (staging.getHealthCheckTimeout() != null) { stagingParameters.put(HEALTH_CHECK_TIMEOUT_PARAMETER, staging.getHealthCheckTimeout()); } if (staging.getHealthCheckType() != null) { stagingParameters.put(HEALTH_CHECK_TYPE_PARAMETER, staging.getHealthCheckType()); } if (staging.getHealthCheckHttpEndpoint() != null) { stagingParameters.put(HEALTH_CHECK_HTTP_ENDPOINT_PARAMETER, staging.getHealthCheckHttpEndpoint()); } if (staging.isSshEnabled() != null) { stagingParameters.put(ENABLE_SSH_PARAMETER, staging.isSshEnabled()); } if (staging.getDockerInfo() != null) { stagingParameters.put(DOCKER_IMAGE, staging.getDockerInfo().getImage()); if (staging.getDockerInfo().getDockerCredentials() != null) { stagingParameters.put(DOCKER_CREDENTIALS, staging.getDockerInfo().getDockerCredentials()); } } return stagingParameters; }
private boolean hasChanged(Staging staging, Staging existingStaging) { String buildpackUrl = staging.getBuildpackUrl(); String command = staging.getCommand(); String stack = staging.getStack(); Integer healthCheckTimeout = staging.getHealthCheckTimeout(); String healthCheckType = staging.getHealthCheckType(); String healthCheckHttpEndpoint = staging.getHealthCheckHttpEndpoint(); Boolean sshEnabled = staging.isSshEnabled(); return (buildpackUrl != null && !buildpackUrl.equals(existingStaging.getBuildpackUrl())) || (command != null && !command.equals(existingStaging.getCommand())) || (stack != null && !stack.equals(existingStaging.getStack())) || (healthCheckTimeout != null && !healthCheckTimeout.equals(existingStaging.getHealthCheckTimeout())) || (healthCheckType != null && !healthCheckType.equals(existingStaging.getHealthCheckType())) || (healthCheckHttpEndpoint != null && !healthCheckHttpEndpoint.equals(existingStaging.getHealthCheckHttpEndpoint())) || (sshEnabled != null && !sshEnabled.equals(existingStaging.isSshEnabled()) || isDockerInfoModified(existingStaging.getDockerInfo(), staging.getDockerInfo())); }
private boolean hasChanged(Staging staging, Staging existingStaging) { String buildpackUrl = staging.getBuildpackUrl(); String command = staging.getCommand(); String stack = staging.getStack(); Integer healthCheckTimeout = staging.getHealthCheckTimeout(); String healthCheckType = staging.getHealthCheckType(); String healthCheckHttpEndpoint = staging.getHealthCheckHttpEndpoint(); Boolean sshEnabled = staging.isSshEnabled(); return (buildpackUrl != null && !buildpackUrl.equals(existingStaging.getBuildpackUrl())) || (command != null && !command.equals(existingStaging.getCommand())) || (stack != null && !stack.equals(existingStaging.getStack())) || (healthCheckTimeout != null && !healthCheckTimeout.equals(existingStaging.getHealthCheckTimeout())) || (healthCheckType != null && !healthCheckType.equals(existingStaging.getHealthCheckType())) || (healthCheckHttpEndpoint != null && !healthCheckHttpEndpoint.equals(existingStaging.getHealthCheckHttpEndpoint())) || (sshEnabled != null && !sshEnabled.equals(existingStaging.isSshEnabled()) || isDockerInfoModified(existingStaging.getDockerInfo(), staging.getDockerInfo())); }
appRequest.put("enable_ssh", staging.isSshEnabled()); if (staging.getDockerInfo() != null) { appRequest.put("docker_image", staging.getDockerInfo() .getImage()); if (staging.getDockerInfo() .getDockerCredentials() != null) { appRequest.put("docker_credentials", staging.getDockerInfo() .getDockerCredentials());