From 912bc8b903dfa6d438c2469ecdad35c181c71830 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 25 Jan 2021 21:29:12 +0100 Subject: Improving usability, massive refactoring. * Moving all Drools code into their own modules. This fixes ri-engine to acme dependency. * Now they all inherit from their own parent, should be used by third party code too. * Separating acme planning code into its own module. * Splitting rules code from ri-engine into ri-base. ri-engine is now a pure launcher for modules. * Dumping kogito for the most part, but it seems like the planner still requires that. --- .../main/java/io/trygvis/rules/dba/Container.java | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 module/ri-base/src/main/java/io/trygvis/rules/dba/Container.java (limited to 'module/ri-base/src/main/java/io/trygvis/rules/dba/Container.java') diff --git a/module/ri-base/src/main/java/io/trygvis/rules/dba/Container.java b/module/ri-base/src/main/java/io/trygvis/rules/dba/Container.java new file mode 100644 index 0000000..3888661 --- /dev/null +++ b/module/ri-base/src/main/java/io/trygvis/rules/dba/Container.java @@ -0,0 +1,59 @@ +package io.trygvis.rules.dba; + +import com.fasterxml.jackson.annotation.JsonIdentityReference; +import io.trygvis.rules.machine.Machine; +import io.trygvis.rules.machine.MachineSpecification; + +//@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, property = "id") +public class Container { + public final String id; + +// @JsonIdentityReference(alwaysAsId = true) + public final Cluster cluster; + public final String name; + public final String machineRole; + public final String image; + public final String tag; + + private Machine machine; + public final MachineSpecification machineSpecification; + + public Container(Cluster cluster, String name, String machineRole, String image, String tag, + MachineSpecification machineSpecification) { + this.id = cluster.name + "-" + name; + this.cluster = cluster; + this.name = name; + this.machineRole = machineRole; + this.image = image; + this.tag = tag; + this.machineSpecification = machineSpecification; + } + + public Cluster getCluster() { + return cluster; + } + + public String getName() { + return name; + } + + public String getMachineRole() { + return machineRole; + } + + public String getImage() { + return image; + } + + public String getTag() { + return tag; + } + + public Machine getMachine() { + return machine; + } + + public void setMachine(Machine machine) { + this.machine = machine; + } +} -- cgit v1.2.3