@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Task) { Task that = (Task) o; return (this.id.equals(that.id())) && (this.version.equals(that.version())) && (this.createdAt.equals(that.createdAt())) && (this.updatedAt.equals(that.updatedAt())) && ((this.name == null) ? (that.name() == null) : this.name.equals(that.name())) && ((this.labels == null) ? (that.labels() == null) : this.labels.equals(that.labels())) && (this.spec.equals(that.spec())) && (this.serviceId.equals(that.serviceId())) && ((this.slot == null) ? (that.slot() == null) : this.slot.equals(that.slot())) && ((this.nodeId == null) ? (that.nodeId() == null) : this.nodeId.equals(that.nodeId())) && (this.status.equals(that.status())) && (this.desiredState.equals(that.desiredState())) && ((this.networkAttachments == null) ? (that.networkAttachments() == null) : this.networkAttachments.equals(that.networkAttachments())); } return false; }
ImmutableList<NetworkAttachment> networkAttachments = task.networkAttachments(); if (networkAttachments == null) { logger.warning("task.networkAttachments() returned NULL for task " + "id:" + task.id() + " name:" + task.name() + " nodeid:" + task.nodeId() + " I am skipping this task for service: " + service.spec().name()); continue; if (TaskStatus.TASK_STATE_RUNNING.equals(task.status().state()) || foundSelfService) { logger.info("Found qualifying docker service task[taskId: " +task.id() + ", container: "+task.status().containerStatus().containerId()+ ", state: " + task.status().state()+ "] " + "on network: " + network.name() +"["+ network.id() + ":" + networkAttachment.addresses().iterator().next() +"]");
public String getContainerId() { return task.status().containerStatus().containerId(); }
public String getContainerImage() { return task.spec().containerSpec().image(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof Task) { Task that = (Task) o; return (this.id.equals(that.id())) && (this.version.equals(that.version())) && (this.createdAt.equals(that.createdAt())) && (this.updatedAt.equals(that.updatedAt())) && ((this.name == null) ? (that.name() == null) : this.name.equals(that.name())) && ((this.labels == null) ? (that.labels() == null) : this.labels.equals(that.labels())) && (this.spec.equals(that.spec())) && (this.serviceId.equals(that.serviceId())) && ((this.slot == null) ? (that.slot() == null) : this.slot.equals(that.slot())) && ((this.nodeId == null) ? (that.nodeId() == null) : this.nodeId.equals(that.nodeId())) && (this.status.equals(that.status())) && (this.desiredState.equals(that.desiredState())) && ((this.networkAttachments == null) ? (that.networkAttachments() == null) : this.networkAttachments.equals(that.networkAttachments())); } return false; }