Builder(ServiceSpec source) { this.name = source.name(); this.labels = source.labels(); this.taskTemplate = source.taskTemplate(); this.mode = source.mode(); this.updateConfig = source.updateConfig(); this.networks = source.networks(); this.endpointSpec = source.endpointSpec(); } @Override
public String getServiceName() { return service.spec().name(); }
@JsonCreator static ServiceSpec create( @JsonProperty("Name") final String name, @JsonProperty("Labels") final Map<String, String> labels, @JsonProperty("TaskTemplate") final TaskSpec taskTemplate, @JsonProperty("Mode") final ServiceMode mode, @JsonProperty("UpdateConfig") final UpdateConfig updateConfig, @JsonProperty("Networks") final List<NetworkAttachmentConfig> networks, @JsonProperty("EndpointSpec") final EndpointSpec endpointSpec) { return builder() .name(name) .labels(labels) .taskTemplate(taskTemplate) .mode(mode) .updateConfig(updateConfig) .endpointSpec(endpointSpec) .networks(networks) .build(); } }
logger.info("Found qualifying docker service["+service.spec().name()+"] " + "on network: " + network.name() +"["+ network.id() + ":" +vip.addr() +"]"); List<Task> tasks = docker.listTasks(Task.Criteria.builder().serviceName(service.spec().name()).build()); logger.warning("docker.listTasks() returned NULL for service:" + service.spec().name() + ", skipping this service"); continue; " name:" + task.name() + " nodeid:" + task.nodeId() + " I am skipping this task for service: " + service.spec().name()); continue;
@JsonCreator static ServiceSpec create( @JsonProperty("Name") final String name, @JsonProperty("Labels") final Map<String, String> labels, @JsonProperty("TaskTemplate") final TaskSpec taskTemplate, @JsonProperty("Mode") final ServiceMode mode, @JsonProperty("UpdateConfig") final UpdateConfig updateConfig, @JsonProperty("Networks") final List<NetworkAttachmentConfig> networks, @JsonProperty("EndpointSpec") final EndpointSpec endpointSpec) { return builder() .name(name) .labels(labels) .taskTemplate(taskTemplate) .mode(mode) .updateConfig(updateConfig) .endpointSpec(endpointSpec) .labels(labels) .networks(networks) .build(); } }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ServiceSpec) { ServiceSpec that = (ServiceSpec) o; return ((this.name == null) ? (that.name() == null) : this.name.equals(that.name())) && ((this.labels == null) ? (that.labels() == null) : this.labels.equals(that.labels())) && (this.taskTemplate.equals(that.taskTemplate())) && ((this.mode == null) ? (that.mode() == null) : this.mode.equals(that.mode())) && ((this.updateConfig == null) ? (that.updateConfig() == null) : this.updateConfig.equals(that.updateConfig())) && ((this.networks == null) ? (that.networks() == null) : this.networks.equals(that.networks())) && ((this.endpointSpec == null) ? (that.endpointSpec() == null) : this.endpointSpec.equals(that.endpointSpec())); } return false; }
Builder(ServiceSpec source) { this.name = source.name(); this.labels = source.labels(); this.taskTemplate = source.taskTemplate(); this.mode = source.mode(); this.updateConfig = source.updateConfig(); this.networks = source.networks(); this.endpointSpec = source.endpointSpec(); } @Override
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof ServiceSpec) { ServiceSpec that = (ServiceSpec) o; return ((this.name == null) ? (that.name() == null) : this.name.equals(that.name())) && ((this.labels == null) ? (that.labels() == null) : this.labels.equals(that.labels())) && (this.taskTemplate.equals(that.taskTemplate())) && ((this.mode == null) ? (that.mode() == null) : this.mode.equals(that.mode())) && ((this.updateConfig == null) ? (that.updateConfig() == null) : this.updateConfig.equals(that.updateConfig())) && ((this.networks == null) ? (that.networks() == null) : this.networks.equals(that.networks())) && ((this.endpointSpec == null) ? (that.endpointSpec() == null) : this.endpointSpec.equals(that.endpointSpec())); } return false; }