-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #952 from eclipse/CHE-253
CHE-253: Refactor Che docker client
- Loading branch information
Showing
55 changed files
with
6,113 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
973 changes: 704 additions & 269 deletions
973
...gin-docker-client/src/main/java/org/eclipse/che/plugin/docker/client/DockerConnector.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
...he-plugin-docker-client/src/main/java/org/eclipse/che/plugin/docker/client/json/Node.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2012-2016 Codenvy, S.A. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Codenvy, S.A. - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.che.plugin.docker.client.json; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Describe docker node in swarm model | ||
* | ||
* @author Eugene Voevodin | ||
* @author Alexander Garagatyi | ||
*/ | ||
public class Node { | ||
|
||
private String id; | ||
private String name; | ||
private String addr; | ||
private String ip; | ||
private int cpus; | ||
private long memory; | ||
|
||
private Map<String, String> labels = new HashMap<>(); | ||
|
||
public String getID() { | ||
return id; | ||
} | ||
|
||
public void setID(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getAddr() { | ||
return addr; | ||
} | ||
|
||
public void setAddr(String addr) { | ||
this.addr = addr; | ||
} | ||
|
||
public String getIP() { | ||
return ip; | ||
} | ||
|
||
public void setIP(String ip) { | ||
this.ip = ip; | ||
} | ||
|
||
public int getCpus() { | ||
return cpus; | ||
} | ||
|
||
public void setCpus(int cpus) { | ||
this.cpus = cpus; | ||
} | ||
|
||
public long getMemory() { | ||
return memory; | ||
} | ||
|
||
public void setMemory(long memory) { | ||
this.memory = memory; | ||
} | ||
|
||
public Map<String, String> getLabels() { | ||
return labels; | ||
} | ||
|
||
public void setLabels(Map<String, String> labels) { | ||
this.labels = labels; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Node{" + | ||
"ID='" + id + '\'' + | ||
", name='" + name + '\'' + | ||
", addr='" + addr + '\'' + | ||
", IP='" + ip + '\'' + | ||
", cpus=" + cpus + | ||
", memory=" + memory + | ||
", labels=" + labels + | ||
'}'; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (!(o instanceof Node)) return false; | ||
Node node = (Node)o; | ||
return Objects.equals(getCpus(), node.getCpus()) && | ||
Objects.equals(getMemory(), node.getMemory()) && | ||
Objects.equals(getID(), node.getID()) && | ||
Objects.equals(getName(), node.getName()) && | ||
Objects.equals(getAddr(), node.getAddr()) && | ||
Objects.equals(getIP(), node.getIP()) && | ||
Objects.equals(getLabels(), node.getLabels()); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(getID(), getName(), getAddr(), getIP(), getCpus(), getMemory(), getLabels()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.