Skip to content

Commit

Permalink
change to healthcheckProtocol, use enum for protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ssalinas committed Jun 16, 2015
1 parent ae31a40 commit 90ed855
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.hubspot.singularity;

public enum HealthcheckProtocol {

http, https;

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class SingularityDeploy {
private final Optional<Long> healthcheckIntervalSeconds;
private final Optional<Long> healthcheckTimeoutSeconds;
private final Optional<Boolean> skipHealthchecksOnDeploy;
private final Optional<String> healthcheckScheme;
private final Optional<HealthcheckProtocol> healthcheckProtocol;

private final Optional<Long> deployHealthTimeoutSeconds;

Expand Down Expand Up @@ -83,7 +83,7 @@ public SingularityDeploy(@JsonProperty("requestId") String requestId,
@JsonProperty("considerHealthyAfterRunningForSeconds") Optional<Long> considerHealthyAfterRunningForSeconds,
@JsonProperty("loadBalancerOptions") Optional<Map<String, Object>> loadBalancerOptions,
@JsonProperty("skipHealthchecksOnDeploy") Optional<Boolean> skipHealthchecksOnDeploy,
@JsonProperty("healthCheckScheme") Optional<String> healthcheckScheme) {
@JsonProperty("healthCheckScheme") Optional<HealthcheckProtocol> healthcheckProtocol) {
this.requestId = requestId;

this.command = command;
Expand All @@ -109,7 +109,7 @@ public SingularityDeploy(@JsonProperty("requestId") String requestId,
this.healthcheckIntervalSeconds = healthcheckIntervalSeconds;
this.healthcheckTimeoutSeconds = healthcheckTimeoutSeconds;
this.skipHealthchecksOnDeploy = skipHealthchecksOnDeploy;
this.healthcheckScheme = healthcheckScheme;
this.healthcheckProtocol = healthcheckProtocol;

this.considerHealthyAfterRunningForSeconds = considerHealthyAfterRunningForSeconds;

Expand All @@ -134,7 +134,7 @@ public SingularityDeployBuilder toBuilder() {
.setHealthcheckIntervalSeconds(healthcheckIntervalSeconds)
.setHealthcheckTimeoutSeconds(healthcheckTimeoutSeconds)
.setSkipHealthchecksOnDeploy(skipHealthchecksOnDeploy)
.setHealthcheckScheme(healthcheckScheme)
.setHealthcheckProtocol(healthcheckProtocol)

.setConsiderHealthyAfterRunningForSeconds(considerHealthyAfterRunningForSeconds)
.setDeployHealthTimeoutSeconds(deployHealthTimeoutSeconds)
Expand Down Expand Up @@ -239,8 +239,8 @@ public Optional<String> getHealthcheckUri() {
}

@ApiModelProperty(required=false, value="Healthcheck scheme")
public Optional<String> getHealthcheckScheme() {
return healthcheckScheme;
public Optional<HealthcheckProtocol> getHealthcheckProtocol() {
return healthcheckProtocol;
}

@ApiModelProperty(required=false, value="Health check interval in seconds.")
Expand Down Expand Up @@ -303,7 +303,7 @@ public String toString() {
", skipHealthchecksOnDeploy=" + skipHealthchecksOnDeploy +
", deployHealthTimeoutSeconds=" + deployHealthTimeoutSeconds +
", considerHealthyAfterRunningForSeconds=" + considerHealthyAfterRunningForSeconds +
", healthcheckScheme=" + healthcheckScheme +
", healthcheckProtocol=" + healthcheckProtocol +
", serviceBasePath=" + serviceBasePath +
", loadBalancerGroups=" + loadBalancerGroups +
", loadBalancerOptions=" + loadBalancerOptions +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class SingularityDeployBuilder {
private Optional<Long> healthcheckIntervalSeconds;
private Optional<Long> healthcheckTimeoutSeconds;
private Optional<Boolean> skipHealthchecksOnDeploy;
private Optional<String> healthcheckScheme;
private Optional<HealthcheckProtocol> healthcheckProtocol;

private Optional<Long> deployHealthTimeoutSeconds;

Expand Down Expand Up @@ -69,7 +69,7 @@ public SingularityDeployBuilder(String requestId, String id) {
this.healthcheckTimeoutSeconds = Optional.absent();
this.skipHealthchecksOnDeploy = Optional.absent();
this.deployHealthTimeoutSeconds = Optional.absent();
this.healthcheckScheme = Optional.absent();
this.healthcheckProtocol = Optional.absent();
this.considerHealthyAfterRunningForSeconds = Optional.absent();
this.serviceBasePath = Optional.absent();
this.loadBalancerGroups = Optional.absent();
Expand All @@ -78,7 +78,7 @@ public SingularityDeployBuilder(String requestId, String id) {

public SingularityDeploy build() {
return new SingularityDeploy(requestId, id, command, arguments, containerInfo, customExecutorCmd, customExecutorId, customExecutorSource, customExecutorResources, resources, env, uris, metadata, executorData, version, timestamp, deployHealthTimeoutSeconds, healthcheckUri, healthcheckIntervalSeconds,
healthcheckTimeoutSeconds, serviceBasePath, loadBalancerGroups, considerHealthyAfterRunningForSeconds, loadBalancerOptions, skipHealthchecksOnDeploy, healthcheckScheme);
healthcheckTimeoutSeconds, serviceBasePath, loadBalancerGroups, considerHealthyAfterRunningForSeconds, loadBalancerOptions, skipHealthchecksOnDeploy, healthcheckProtocol);
}

public String getRequestId() {
Expand Down Expand Up @@ -301,12 +301,12 @@ public SingularityDeployBuilder setSkipHealthchecksOnDeploy(Optional<Boolean> sk
return this;
}

public Optional<String> getHealthcheckScheme() {
return healthcheckScheme;
public Optional<HealthcheckProtocol> getHealthcheckProtocol() {
return healthcheckProtocol;
}

public SingularityDeployBuilder setHealthcheckScheme(Optional<String> healthcheckScheme) {
this.healthcheckScheme = healthcheckScheme;
public SingularityDeployBuilder setHealthcheckProtocol(Optional<HealthcheckProtocol> healthcheckProtocol) {
this.healthcheckProtocol = healthcheckProtocol;
return this;
}

Expand Down Expand Up @@ -335,7 +335,7 @@ public String toString() {
", skipHealthchecksOnDeploy=" + skipHealthchecksOnDeploy +
", deployHealthTimeoutSeconds=" + deployHealthTimeoutSeconds +
", considerHealthyAfterRunningForSeconds=" + considerHealthyAfterRunningForSeconds +
", healthcheckScheme=" + healthcheckScheme +
", healthcheckProtocol=" + healthcheckProtocol +
", serviceBasePath=" + serviceBasePath +
", loadBalancerGroups=" + loadBalancerGroups +
", loadBalancerOptions=" + loadBalancerOptions +
Expand Down

0 comments on commit 90ed855

Please sign in to comment.