diff options
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/model/ContainerMeta.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/model/ContainerMeta.java | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/model/ContainerMeta.java b/dozentenmodul/src/main/java/org/openslx/dozmod/model/ContainerMeta.java index 0306d0ee..2f13c156 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/model/ContainerMeta.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/model/ContainerMeta.java @@ -7,29 +7,28 @@ import java.util.Objects; /** * ContainerMeta is used to store container specific information. * An object of this class will be serialized with gson to a json file. - * + * <p> * TODO remove build_context_method - * no need to distinguish beettween methods + * no need to distinguish between methods * TODO rename build_context_url to build_context */ public class ContainerMeta { public enum ContainerImageType implements org.apache.thrift.TEnum { - LECTURE("lecture"), - BATCH("batch"), - DATA("data"); + LECTURE("lecture"), BATCH("batch"), DATA("data"); private final String name; - ContainerImageType(String name){ + ContainerImageType(String name) { this.name = name; } - public boolean equalNames(String other){ + public boolean equalNames(String other) { return name.equals(other); } - public static ContainerImageType getByName(String name){ - for (ContainerImageType item : ContainerImageType.values()){ + + public static ContainerImageType getByName(String name) { + for (ContainerImageType item : ContainerImageType.values()) { if (item.name.equals(name)) return item; } @@ -37,8 +36,6 @@ public class ContainerMeta { return LECTURE; } - - @Override public String toString() { return this.name; } @@ -48,12 +45,12 @@ public class ContainerMeta { } } - private int build_context_method; private String image_repo; private String build_context_url; private String image_name; private String run_options; + private String run_command; private String image_type; private List<ContainerBindMount> bind_mount_config = new ArrayList<>(); @@ -64,6 +61,7 @@ public class ContainerMeta { build_context_url = ""; image_name = ""; run_options = ""; + run_command = ""; image_type = ContainerImageType.LECTURE.toString(); bind_mount_config = new ArrayList<>(); } @@ -73,6 +71,7 @@ public class ContainerMeta { build_context_url = containerMeta.build_context_url; image_name = containerMeta.image_name; run_options = containerMeta.run_options; + run_command = containerMeta.run_command; image_repo = containerMeta.image_repo; for (ContainerBindMount bm : containerMeta.bind_mount_config) @@ -104,6 +103,14 @@ public class ContainerMeta { this.run_options = run_options; } + public void setRunCommand(String run_command) { + this.run_command = run_command; + } + + public String getRunCommand() { + return this.run_command; + } + public String getImageName() { return image_name; } @@ -120,9 +127,13 @@ public class ContainerMeta { this.bind_mount_config = bindMountConfig; } - public String getImageRepo() { return image_repo; } + public String getImageRepo() { + return image_repo; + } - public void setImageRepo(String from_image) { this.image_repo = from_image; } + public void setImageRepo(String from_image) { + this.image_repo = from_image; + } public ContainerImageType getImageType() { if (image_type == null || image_type.length() == 0) @@ -143,12 +154,12 @@ public class ContainerMeta { ContainerMeta that = (ContainerMeta) o; return Objects.equals(build_context_url, that.build_context_url) && Objects.equals(image_name, that.image_name) && Objects.equals(run_options, that.run_options) && Objects.equals( - bind_mount_config, that.bind_mount_config) && Objects.equals(image_repo,that.image_repo) - && Objects.equals(image_type,that.image_type); + run_command, that.run_command) && Objects.equals(bind_mount_config, that.bind_mount_config) + && Objects.equals(image_repo, that.image_repo) && Objects.equals(image_type, that.image_type); } @Override public int hashCode() { - return Objects.hash(build_context_url, image_name, run_options, - bind_mount_config, image_repo, image_type); + return Objects.hash(build_context_url, image_name, run_options, run_command, bind_mount_config, + image_repo, image_type); } } |