diff --git a/constraints/build.gradle b/constraints/build.gradle index 0bf3022b69..4d6eb916bb 100644 --- a/constraints/build.gradle +++ b/constraints/build.gradle @@ -30,8 +30,8 @@ repositories { dependencies { implementation project(':merlin-driver') - implementation project(':merlin-sdk') implementation project(':parsing-utilities') + implementation project(':type-utils') testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' diff --git a/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java b/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java index 96e9144dc3..8a3c8758c3 100644 --- a/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java +++ b/constraints/src/main/java/gov/nasa/jpl/aerie/constraints/model/ActivityInstance.java @@ -1,12 +1,11 @@ package gov.nasa.jpl.aerie.constraints.model; import gov.nasa.jpl.aerie.constraints.time.Interval; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Map; -import java.util.Objects; import java.util.Optional; public record ActivityInstance( diff --git a/e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/BindingsTests.java b/e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/BindingsTests.java index 4e3ae03126..222413bb40 100644 --- a/e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/BindingsTests.java +++ b/e2e-tests/src/test/java/gov/nasa/jpl/aerie/e2e/BindingsTests.java @@ -1118,7 +1118,7 @@ void invalidModelId(){ assertEquals(200, response.status()); final var expectedBody = Json.createObjectBuilder() .add("status", "failure") - .add("reason", "No mission model exists with id `MissionModelId[id=-1]`") + .add("reason", "No mission model exists with id `-1`") .build(); assertEquals(expectedBody, getBody(response)); } diff --git a/examples/banananation/build.gradle b/examples/banananation/build.gradle index 19cdec5193..6de69cccb3 100644 --- a/examples/banananation/build.gradle +++ b/examples/banananation/build.gradle @@ -43,6 +43,8 @@ dependencies { implementation 'org.apache.commons:commons-lang3:3.13.0' testImplementation project(':merlin-framework-junit') + testImplementation project(':orchestration-utils') + testImplementation project(':type-utils') testImplementation 'org.assertj:assertj-core:3.24.2' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' diff --git a/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/ActivityInstanceTest.java b/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/ActivityInstanceTest.java index ec44be8cf9..717a92500c 100644 --- a/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/ActivityInstanceTest.java +++ b/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/ActivityInstanceTest.java @@ -1,12 +1,12 @@ package gov.nasa.jpl.aerie.banananation; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.engine.SimulationEngine; import gov.nasa.jpl.aerie.merlin.driver.timeline.TemporalEventSource; import gov.nasa.jpl.aerie.merlin.protocol.driver.Topic; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.Test; diff --git a/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/Main.java b/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/Main.java index 11148a57ff..63c86536bc 100644 --- a/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/Main.java +++ b/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/Main.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.banananation; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Pair; import java.util.Map; diff --git a/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/SimulationUtility.java b/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/SimulationUtility.java index 83651c76e3..093b93fce7 100644 --- a/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/SimulationUtility.java +++ b/examples/banananation/src/test/java/gov/nasa/jpl/aerie/banananation/SimulationUtility.java @@ -2,9 +2,10 @@ import gov.nasa.jpl.aerie.banananation.generated.GeneratedModelType; import gov.nasa.jpl.aerie.merlin.driver.*; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.protocol.model.ModelType; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Pair; import java.nio.file.Path; diff --git a/examples/foo-missionmodel/build.gradle b/examples/foo-missionmodel/build.gradle index 5e8bcd7354..f74026a8de 100644 --- a/examples/foo-missionmodel/build.gradle +++ b/examples/foo-missionmodel/build.gradle @@ -36,6 +36,7 @@ dependencies { implementation project(':merlin-framework') implementation project(':contrib') + implementation project(':type-utils') testImplementation project(':merlin-framework-junit') testImplementation 'org.assertj:assertj-core:3.24.2' diff --git a/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/FooSimulationDuplicationTest.java b/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/FooSimulationDuplicationTest.java index f183d23824..4da242a48e 100644 --- a/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/FooSimulationDuplicationTest.java +++ b/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/FooSimulationDuplicationTest.java @@ -1,21 +1,21 @@ package gov.nasa.jpl.aerie.foomissionmodel; import gov.nasa.jpl.aerie.foomissionmodel.generated.GeneratedModelType; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.CachedEngineStore; import gov.nasa.jpl.aerie.merlin.driver.CachedSimulationEngine; import gov.nasa.jpl.aerie.merlin.driver.CheckpointSimulationDriver; import gov.nasa.jpl.aerie.merlin.driver.DirectiveTypeRegistry; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.MissionModelBuilder; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.SimulationDriver; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.framework.ThreadedTask; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; diff --git a/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/SimulateMapSchedule.java b/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/SimulateMapSchedule.java index a5eafc5d2f..63f65609ed 100644 --- a/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/SimulateMapSchedule.java +++ b/examples/foo-missionmodel/src/test/java/gov/nasa/jpl/aerie/foomissionmodel/SimulateMapSchedule.java @@ -2,11 +2,11 @@ import gov.nasa.jpl.aerie.foomissionmodel.generated.GeneratedModelType; import gov.nasa.jpl.aerie.merlin.driver.*; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.json.JsonEncoding; -import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import org.apache.commons.lang3.tuple.Pair; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import javax.json.Json; import java.time.Instant; diff --git a/merlin-driver/build.gradle b/merlin-driver/build.gradle index c6ad4e9c7d..a07b237cb7 100644 --- a/merlin-driver/build.gradle +++ b/merlin-driver/build.gradle @@ -39,6 +39,7 @@ dependencies { api project(':merlin-sdk') api 'org.glassfish:javax.json:1.1.4' + implementation project(':type-utils') implementation 'it.unimi.dsi:fastutil:8.5.12' implementation 'org.slf4j:slf4j-simple:2.0.7' diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java index 48d1a0dc49..4fa9e27b24 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityInstance.java @@ -2,6 +2,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.time.Instant; import java.util.List; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CachedSimulationEngine.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CachedSimulationEngine.java index 2ce636965a..ae55cdddd6 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CachedSimulationEngine.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CachedSimulationEngine.java @@ -5,6 +5,8 @@ import gov.nasa.jpl.aerie.merlin.driver.resources.InMemorySimulationResourceManager; import gov.nasa.jpl.aerie.merlin.protocol.driver.Topic; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.time.Instant; import java.util.Map; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CheckpointSimulationDriver.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CheckpointSimulationDriver.java index 6f6d42cee8..4ec5787a90 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CheckpointSimulationDriver.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/CheckpointSimulationDriver.java @@ -9,6 +9,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.model.TaskFactory; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.InstantiationException; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModel.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModel.java index fc9b477e34..8cbea7efbb 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModel.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModel.java @@ -11,6 +11,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.InstantiationException; import gov.nasa.jpl.aerie.merlin.protocol.types.TaskStatus; import gov.nasa.jpl.aerie.merlin.protocol.types.Unit; +import gov.nasa.jpl.aerie.types.SerializedActivity; import java.util.Collections; import java.util.List; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModelId.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModelId.java deleted file mode 100644 index 5f3d95bd8c..0000000000 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/MissionModelId.java +++ /dev/null @@ -1,3 +0,0 @@ -package gov.nasa.jpl.aerie.merlin.driver; - -public record MissionModelId(long id) {} diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDriver.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDriver.java index 29f7ea7dcf..ae6e4f1332 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDriver.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDriver.java @@ -10,6 +10,9 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.InstantiationException; import gov.nasa.jpl.aerie.merlin.protocol.types.Unit; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Pair; import java.util.ArrayList; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationEngineConfiguration.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationEngineConfiguration.java index 3f1f4e4294..bfef673b75 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationEngineConfiguration.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationEngineConfiguration.java @@ -1,6 +1,7 @@ package gov.nasa.jpl.aerie.merlin.driver; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.MissionModelId; import java.time.Instant; import java.util.Map; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationException.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationException.java index 87548c924e..d74cd39a89 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationException.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationException.java @@ -1,6 +1,8 @@ package gov.nasa.jpl.aerie.merlin.driver; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import java.time.Instant; import java.time.ZoneOffset; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResultsComputerInputs.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResultsComputerInputs.java index 6f34c1504f..50edc898fb 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResultsComputerInputs.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SimulationResultsComputerInputs.java @@ -3,9 +3,8 @@ import gov.nasa.jpl.aerie.merlin.driver.engine.SimulationEngine; import gov.nasa.jpl.aerie.merlin.driver.engine.SpanId; import gov.nasa.jpl.aerie.merlin.driver.resources.SimulationResourceManager; -import gov.nasa.jpl.aerie.merlin.driver.timeline.TemporalEventSource; import gov.nasa.jpl.aerie.merlin.protocol.driver.Topic; -import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.time.Instant; import java.util.Map; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/StartOffsetReducer.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/StartOffsetReducer.java index 3611545ea9..c86f3cd35b 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/StartOffsetReducer.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/StartOffsetReducer.java @@ -1,6 +1,8 @@ package gov.nasa.jpl.aerie.merlin.driver; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.apache.commons.lang3.tuple.Pair; import java.util.ArrayList; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java index 7e87f20582..b6ef8f4a60 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/UnfinishedActivity.java @@ -1,6 +1,7 @@ package gov.nasa.jpl.aerie.merlin.driver; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.time.Instant; import java.util.List; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/DirectiveDetail.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/DirectiveDetail.java index ab2531069c..5a48ba83f4 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/DirectiveDetail.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/DirectiveDetail.java @@ -1,8 +1,7 @@ package gov.nasa.jpl.aerie.merlin.driver.engine; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; -import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.SerializedActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.List; import java.util.Optional; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java index fed9782634..331514fda5 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java +++ b/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/engine/SimulationEngine.java @@ -1,8 +1,6 @@ package gov.nasa.jpl.aerie.merlin.driver.engine; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.MissionModel.SerializableTopic; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.resources.SimulationResourceManager; @@ -28,6 +26,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.TaskStatus; import gov.nasa.jpl.aerie.merlin.protocol.types.Unit; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.mutable.Mutable; import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.lang3.mutable.MutableObject; diff --git a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java index 976f9d4457..2e87d5e944 100644 --- a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java +++ b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/AnchorSimulationTest.java @@ -2,6 +2,9 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; diff --git a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDuplicationTest.java b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDuplicationTest.java index 24286636ab..abf7213e42 100644 --- a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDuplicationTest.java +++ b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/SimulationDuplicationTest.java @@ -2,6 +2,7 @@ import gov.nasa.jpl.aerie.merlin.driver.resources.InMemorySimulationResourceManager; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java index 3df904ceee..cd67abdd32 100644 --- a/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java +++ b/merlin-driver/src/test/java/gov/nasa/jpl/aerie/merlin/driver/TemporalSubsetSimulationTests.java @@ -2,6 +2,9 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; diff --git a/merlin-server/build.gradle b/merlin-server/build.gradle index b9d145a482..8b8cb10212 100644 --- a/merlin-server/build.gradle +++ b/merlin-server/build.gradle @@ -79,6 +79,7 @@ application { } dependencies { + implementation project(':type-utils') implementation project(':merlin-driver') implementation project(':parsing-utilities') implementation project(':constraints') diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/HasuraParsers.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/HasuraParsers.java index ef0ab785ca..6d556d7cfe 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/HasuraParsers.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/HasuraParsers.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.http; import gov.nasa.jpl.aerie.json.JsonParser; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.server.models.HasuraAction; import gov.nasa.jpl.aerie.merlin.server.models.HasuraMissionModelEvent; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinBindings.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinBindings.java index 2300df6420..2558cd3278 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinBindings.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinBindings.java @@ -2,7 +2,7 @@ import gov.nasa.jpl.aerie.constraints.InputMismatchException; import gov.nasa.jpl.aerie.json.JsonParser; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.protocol.types.InstantiationException; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanDatasetException; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsers.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsers.java index 3b0e903e3b..12501047cf 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsers.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsers.java @@ -3,15 +3,15 @@ import gov.nasa.jpl.aerie.json.JsonParseResult; import gov.nasa.jpl.aerie.json.JsonParser; import gov.nasa.jpl.aerie.json.SchemaCache; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.SimulationFailure; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.services.UnexpectedSubtypeError; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Timestamp; import javax.json.Json; import javax.json.JsonObject; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java index 8e16964305..a32f70e568 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/http/ResponseSerializers.java @@ -5,7 +5,6 @@ import gov.nasa.jpl.aerie.constraints.model.ConstraintResult; import gov.nasa.jpl.aerie.constraints.time.Interval; import gov.nasa.jpl.aerie.json.JsonParseResult.FailureReason; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.UnfinishedActivity; import gov.nasa.jpl.aerie.merlin.driver.json.ValueSchemaJsonParser; @@ -27,6 +26,7 @@ import gov.nasa.jpl.aerie.merlin.server.services.MissionModelService.BulkEffectiveArgumentResponse; import gov.nasa.jpl.aerie.merlin.server.services.MissionModelService.BulkArgumentValidationResponse; import gov.nasa.jpl.aerie.merlin.server.services.UnexpectedSubtypeError; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.apache.commons.lang3.tuple.Pair; import javax.json.Json; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/mocks/InMemoryPlanRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/mocks/InMemoryPlanRepository.java index fc84054035..56538dbecf 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/mocks/InMemoryPlanRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/mocks/InMemoryPlanRepository.java @@ -1,18 +1,18 @@ package gov.nasa.jpl.aerie.merlin.server.mocks; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; import gov.nasa.jpl.aerie.merlin.server.models.Constraint; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.PlanRepository; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import java.util.HashMap; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveForValidation.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveForValidation.java index 6aefe8ca42..c293612460 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveForValidation.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveForValidation.java @@ -1,6 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.models; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import java.sql.Timestamp; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveId.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveId.java deleted file mode 100644 index 09d741c365..0000000000 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/ActivityDirectiveId.java +++ /dev/null @@ -1,3 +0,0 @@ -package gov.nasa.jpl.aerie.merlin.server.models; - -public record ActivityDirectiveId(long id) {} diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraAction.java index 26a1f4fd17..1fcf8faba2 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraAction.java @@ -1,7 +1,9 @@ package gov.nasa.jpl.aerie.merlin.server.models; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.Timestamp; import java.util.List; import java.util.Map; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraMissionModelEvent.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraMissionModelEvent.java index 9ba33e4c5e..9932d2145c 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraMissionModelEvent.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/HasuraMissionModelEvent.java @@ -1,3 +1,5 @@ package gov.nasa.jpl.aerie.merlin.server.models; +import gov.nasa.jpl.aerie.types.MissionModelId; + public record HasuraMissionModelEvent(MissionModelId missionModelId) { } diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/MissionModelRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/MissionModelRepository.java index 9be6348e9e..cbe6e2d1b4 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/MissionModelRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/MissionModelRepository.java @@ -4,9 +4,9 @@ import gov.nasa.jpl.aerie.merlin.protocol.model.Resource; import gov.nasa.jpl.aerie.merlin.server.models.ActivityDirectiveForValidation; import gov.nasa.jpl.aerie.merlin.server.models.ActivityType; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.MissionModelJar; import gov.nasa.jpl.aerie.merlin.server.services.MissionModelService.BulkArgumentValidationResponse; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import java.util.List; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepository.java index 7eabd94ffe..97aaab5a5b 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepository.java @@ -1,18 +1,18 @@ package gov.nasa.jpl.aerie.merlin.server.remotes; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanDatasetException; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.models.Constraint; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.services.RevisionData; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import java.util.List; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreatePlanDatasetAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreatePlanDatasetAction.java index 2a8fbd3e73..76251987ad 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreatePlanDatasetAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreatePlanDatasetAction.java @@ -2,7 +2,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreateSimulationDatasetAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreateSimulationDatasetAction.java index 88003d00b3..aae2ea5f7f 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreateSimulationDatasetAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/CreateSimulationDatasetAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.postgres.SimulationStateRecord.Status; import org.intellij.lang.annotations.Language; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetAllPlansAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetAllPlansAction.java index b3d7ebd123..5a5d6a129b 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetAllPlansAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetAllPlansAction.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetPlanAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetPlanAction.java index 900908249e..aa9213ca2a 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetPlanAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetPlanAction.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationAction.java index 1bc4a828ea..726e48923f 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationAction.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetAction.java index f5071d8ba4..da16519746 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.postgres.SimulationStateRecord.Status; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetByIdAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetByIdAction.java index cd32f9f5e1..90c527fa8e 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetByIdAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSimulationDatasetByIdAction.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSpanRecords.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSpanRecords.java index 6b31e9821e..5b35e293c8 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSpanRecords.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetSpanRecords.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetUnvalidatedDirectivesAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetUnvalidatedDirectivesAction.java index 2f69e85c46..8971e8caf4 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetUnvalidatedDirectivesAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/GetUnvalidatedDirectivesAction.java @@ -1,9 +1,9 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.server.models.ActivityDirectiveForValidation; -import gov.nasa.jpl.aerie.merlin.server.models.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import java.sql.Connection; @@ -26,7 +26,7 @@ public class GetUnvalidatedDirectivesAction implements AutoCloseable { join merlin.plan p on ad.plan_id = p.id where adv.status = 'pending'; - """; + """; private final PreparedStatement statement; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/InsertSimulationEventsAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/InsertSimulationEventsAction.java index 7b0f9c7a04..8ed6d66189 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/InsertSimulationEventsAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/InsertSimulationEventsAction.java @@ -3,7 +3,7 @@ import gov.nasa.jpl.aerie.merlin.driver.engine.EventRecord; import gov.nasa.jpl.aerie.merlin.driver.timeline.EventGraph; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import org.intellij.lang.annotations.Language; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/LookupSimulationDatasetAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/LookupSimulationDatasetAction.java index 6faf4162d0..fe63058a59 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/LookupSimulationDatasetAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/LookupSimulationDatasetAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.postgres.SimulationStateRecord.Status; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PlanRecord.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PlanRecord.java index 1da8c516c5..b7e7588ebf 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PlanRecord.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PlanRecord.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; public record PlanRecord( long id, diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostSpansAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostSpansAction.java index 11ec124c47..5c2307379a 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostSpansAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostSpansAction.java @@ -2,7 +2,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import java.sql.Connection; @@ -11,7 +11,6 @@ import java.sql.Statement; import java.sql.Types; import java.time.temporal.ChronoUnit; -import java.util.HashMap; import java.util.Map; import java.util.Optional; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresMissionModelRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresMissionModelRepository.java index f2e9d9ffda..0d97d8ec82 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresMissionModelRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresMissionModelRepository.java @@ -4,10 +4,10 @@ import gov.nasa.jpl.aerie.merlin.protocol.model.Resource; import gov.nasa.jpl.aerie.merlin.server.models.ActivityDirectiveForValidation; import gov.nasa.jpl.aerie.merlin.server.models.ActivityType; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.MissionModelJar; import gov.nasa.jpl.aerie.merlin.server.remotes.MissionModelRepository; import gov.nasa.jpl.aerie.merlin.server.services.MissionModelService; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import javax.sql.DataSource; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsers.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsers.java index bad5dc32fb..87cf3d3057 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsers.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsers.java @@ -7,8 +7,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.services.UnexpectedSubtypeError; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import org.postgresql.util.PGInterval; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresPlanRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresPlanRepository.java index 9c7cf1862c..10a496fe4f 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresPlanRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresPlanRepository.java @@ -1,7 +1,5 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; @@ -9,13 +7,15 @@ import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.models.Constraint; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.PlanRepository; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import javax.sql.DataSource; @@ -278,7 +278,7 @@ public List> getExternalDatasets( } @Override - public Map getExternalResourceSchemas(final PlanId planId, final Optional simulationDatasetId) throws NoSuchPlanException { + public Map getExternalResourceSchemas(final PlanId planId, final Optional simulationDatasetId) throws DatabaseException { try (final var connection = this.dataSource.getConnection()) { final var planDatasets = ProfileRepository.getPlanDatasetsForPlan(connection, planId, simulationDatasetId); final var result = new HashMap(); diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java index e6d1c54b6c..39b7cd2f5e 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresResultsCellRepository.java @@ -1,6 +1,5 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationException; @@ -19,8 +18,9 @@ import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; import gov.nasa.jpl.aerie.merlin.server.models.SimulationResultsHandle; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.ResultsCellRepository; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Triple; import org.slf4j.Logger; @@ -407,9 +407,7 @@ private static void postActivities( final Map unfinishedActivities, final Timestamp simulationStart ) throws SQLException { - try ( - final var postActivitiesAction = new PostSpansAction(connection); - ) { + try (final var postActivitiesAction = new PostSpansAction(connection)) { final var simulatedActivityRecords = simulatedActivities.entrySet().stream() .collect(Collectors.toMap( e -> e.getKey().id(), diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PreparedStatements.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PreparedStatements.java index 639561e6f5..135704b712 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PreparedStatements.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PreparedStatements.java @@ -5,8 +5,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.server.http.MerlinParsers; import gov.nasa.jpl.aerie.merlin.server.http.ResponseSerializers; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.services.MissionModelService; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import javax.json.Json; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationDatasetRecord.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationDatasetRecord.java index 6bdc107ebe..3c1f6d4158 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationDatasetRecord.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationDatasetRecord.java @@ -1,6 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; + +import gov.nasa.jpl.aerie.types.Timestamp; public record SimulationDatasetRecord( long simulationId, diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationRecord.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationRecord.java index e209d44b86..a8a87babf9 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationRecord.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/SimulationRecord.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.merlin.server.remotes.postgres; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import java.util.Map; import java.util.Optional; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationService.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationService.java index f99a0f440c..2070154031 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationService.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationService.java @@ -8,9 +8,9 @@ import gov.nasa.jpl.aerie.merlin.server.http.InvalidJsonException; import gov.nasa.jpl.aerie.merlin.server.models.ConstraintsCompilationError; import gov.nasa.jpl.aerie.constraints.json.ConstraintParsers; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; +import gov.nasa.jpl.aerie.types.MissionModelId; import javax.json.Json; import javax.json.JsonObject; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/GenerateConstraintsLibAction.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/GenerateConstraintsLibAction.java index 7210b5f1c6..0eb357875d 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/GenerateConstraintsLibAction.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/GenerateConstraintsLibAction.java @@ -1,8 +1,8 @@ package gov.nasa.jpl.aerie.merlin.server.services; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; +import gov.nasa.jpl.aerie.types.MissionModelId; import java.io.IOException; import java.nio.file.Files; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalMissionModelService.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalMissionModelService.java index 1d74324e2f..f2d4fa4658 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalMissionModelService.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalMissionModelService.java @@ -1,10 +1,12 @@ package gov.nasa.jpl.aerie.merlin.server.services; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.DirectiveTypeRegistry; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.MissionModelLoader; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.SimulationDriver; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.resources.SimulationResourceManager; @@ -17,9 +19,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.models.ActivityDirectiveForValidation; import gov.nasa.jpl.aerie.merlin.server.models.ActivityType; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.MissionModelJar; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.remotes.MissionModelRepository; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalPlanService.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalPlanService.java index e12c366e67..93bdf89134 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalPlanService.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/LocalPlanService.java @@ -6,12 +6,12 @@ import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.models.Constraint; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.PlanRepository; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import java.util.List; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/MissionModelService.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/MissionModelService.java index 56a9f1870a..cb3bda30e5 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/MissionModelService.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/MissionModelService.java @@ -1,8 +1,10 @@ package gov.nasa.jpl.aerie.merlin.server.services; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.MissionModelLoader; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.resources.SimulationResourceManager; import gov.nasa.jpl.aerie.merlin.protocol.model.InputType.Parameter; @@ -12,9 +14,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.models.ActivityType; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.MissionModelJar; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import java.util.List; import java.util.Map; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/PlanService.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/PlanService.java index f70ce35c35..4bd652b3fe 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/PlanService.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/PlanService.java @@ -6,11 +6,11 @@ import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.models.Constraint; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import java.util.List; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/SimulationAgent.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/SimulationAgent.java index 317825bf89..96556b223b 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/SimulationAgent.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/SimulationAgent.java @@ -7,8 +7,8 @@ import gov.nasa.jpl.aerie.merlin.server.ResultsProtocol; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.http.ResponseSerializers; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; +import gov.nasa.jpl.aerie.types.Plan; import javax.json.Json; import java.util.Map; diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceAdapter.java b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceAdapter.java index 18bc66d273..98c02dfb80 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceAdapter.java +++ b/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceAdapter.java @@ -4,9 +4,9 @@ import gov.nasa.jpl.aerie.constraints.TypescriptCodeGenerationService; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; +import gov.nasa.jpl.aerie.types.MissionModelId; import java.util.HashMap; import java.util.Map; diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsersTest.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsersTest.java index 3c09fdb901..c2c594f04a 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsersTest.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/http/MerlinParsersTest.java @@ -4,7 +4,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.server.models.HasuraAction; import gov.nasa.jpl.aerie.merlin.server.models.HasuraMissionModelEvent; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.Test; import javax.json.Json; diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubMissionModelService.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubMissionModelService.java index b68538420a..391dea2529 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubMissionModelService.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubMissionModelService.java @@ -1,7 +1,9 @@ package gov.nasa.jpl.aerie.merlin.server.mocks; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.driver.resources.SimulationResourceManager; import gov.nasa.jpl.aerie.merlin.protocol.model.InputType.Parameter; @@ -10,9 +12,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.models.ActivityType; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.MissionModelJar; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.services.LocalMissionModelService; import gov.nasa.jpl.aerie.merlin.server.services.MissionModelService; @@ -208,11 +208,11 @@ public SimulationResults runSimulation( } @Override - public void refreshModelParameters(final MissionModelId missionModelId) throws NoSuchMissionModelException {} + public void refreshModelParameters(final MissionModelId missionModelId) {} @Override - public void refreshActivityTypes(final MissionModelId missionModelId) throws NoSuchMissionModelException {} + public void refreshActivityTypes(final MissionModelId missionModelId) {} @Override - public void refreshResourceTypes(final MissionModelId missionModelId) throws NoSuchMissionModelException {} + public void refreshResourceTypes(final MissionModelId missionModelId) {} } diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java index 580bcd5eaf..2fd44de131 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/mocks/StubPlanService.java @@ -1,21 +1,21 @@ package gov.nasa.jpl.aerie.merlin.server.mocks; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.models.Constraint; import gov.nasa.jpl.aerie.merlin.server.models.DatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; import gov.nasa.jpl.aerie.merlin.server.models.ProfileSet; import gov.nasa.jpl.aerie.merlin.server.models.SimulationDatasetId; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.services.PlanService; import gov.nasa.jpl.aerie.merlin.server.services.RevisionData; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import java.time.Instant; diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelTest.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelTest.java index d13b4532b3..3a03e9cdbc 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelTest.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelTest.java @@ -2,7 +2,7 @@ import gov.nasa.jpl.aerie.foomissionmodel.generated.GeneratedModelType; import gov.nasa.jpl.aerie.merlin.driver.DirectiveTypeRegistry; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; +import gov.nasa.jpl.aerie.types.SerializedActivity; import gov.nasa.jpl.aerie.merlin.protocol.model.InputType.Parameter; import gov.nasa.jpl.aerie.merlin.protocol.types.InstantiationException; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepositoryContractTest.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepositoryContractTest.java index e49a550042..54718d4b5c 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepositoryContractTest.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/PlanRepositoryContractTest.java @@ -4,11 +4,11 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.mocks.InMemoryPlanRepository; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.PlanRepository.CreatedPlan; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsersTest.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsersTest.java index 08cde20175..aabbeb4cdb 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsersTest.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/remotes/postgres/PostgresParsersTest.java @@ -4,7 +4,7 @@ import static gov.nasa.jpl.aerie.merlin.server.remotes.postgres.PostgresParsers.pgTimestampP; import static org.junit.jupiter.api.Assertions.assertEquals; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.junit.jupiter.api.Test; public final class PostgresParsersTest { diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java index 8b0276f15c..e4ae572a8d 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/ConstraintsDSLCompilationServiceTests.java @@ -52,8 +52,8 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.server.mocks.StubMissionModelService; import gov.nasa.jpl.aerie.merlin.server.mocks.StubPlanService; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java index 33cfdaae2f..660d0cf143 100644 --- a/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java +++ b/merlin-server/src/test/java/gov/nasa/jpl/aerie/merlin/server/services/TypescriptCodeGenerationServiceTest.java @@ -3,8 +3,8 @@ import gov.nasa.jpl.aerie.merlin.server.exceptions.NoSuchPlanException; import gov.nasa.jpl.aerie.merlin.server.mocks.StubMissionModelService; import gov.nasa.jpl.aerie.merlin.server.mocks.StubPlanService; -import gov.nasa.jpl.aerie.merlin.server.models.MissionModelId; import gov.nasa.jpl.aerie.merlin.server.models.PlanId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.Test; import java.util.Optional; diff --git a/orchestration-utils/build.gradle b/orchestration-utils/build.gradle index d8c785f80b..78f1a41230 100644 --- a/orchestration-utils/build.gradle +++ b/orchestration-utils/build.gradle @@ -37,6 +37,7 @@ dependencies { implementation project(':merlin-server') implementation project(':merlin-driver') implementation project(':parsing-utilities') + implementation project(':type-utils') implementation 'commons-cli:commons-cli:1.8.0' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' diff --git a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/PlanJsonParser.java b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/PlanJsonParser.java index 9edc8adf42..25c1bb3158 100644 --- a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/PlanJsonParser.java +++ b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/PlanJsonParser.java @@ -1,8 +1,6 @@ package gov.nasa.jpl.aerie.orchestration; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import static gov.nasa.jpl.aerie.merlin.server.remotes.postgres.PostgresParsers.activityArgumentsP; import static gov.nasa.jpl.aerie.merlin.server.remotes.postgres.PostgresParsers.pgTimestampP; @@ -10,8 +8,11 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; + import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonObject; diff --git a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java index 1efc87fb0d..9b4fab105b 100644 --- a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java +++ b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationResultsWriter.java @@ -10,7 +10,6 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.RealDynamics; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import javax.json.Json; import javax.json.JsonObject; @@ -28,8 +27,9 @@ import java.util.Map; import java.util.concurrent.RecursiveTask; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; -import gov.nasa.jpl.aerie.merlin.server.models.Timestamp; import gov.nasa.jpl.aerie.merlin.server.remotes.postgres.EventGraphFlattener; +import gov.nasa.jpl.aerie.types.Plan; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Triple; @@ -226,7 +226,7 @@ private void printFile(JsonGenerator resultsGenerator, StringWriter stringWriter /** Write the beginning and top-level fields of the results JSON */ private void writeOpening(JsonGenerator resultsGenerator, boolean canceled) { - final Timestamp simEndTime = plan.simulationStartTimestamp.plusMicros(extent.in(Duration.MICROSECOND)); + final var simEndTime = plan.simulationStartTimestamp.plusMicros(extent.in(Duration.MICROSECOND)); resultsGenerator.writeStartObject(); resultsGenerator.write("version", SCHEMA_VERSION); diff --git a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationUtility.java b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationUtility.java index 2fa3eb39d3..153fca61e6 100644 --- a/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationUtility.java +++ b/orchestration-utils/src/main/java/gov/nasa/jpl/aerie/orchestration/simulation/SimulationUtility.java @@ -13,7 +13,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.model.ModelType; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; +import gov.nasa.jpl.aerie.types.Plan; import javax.json.Json; import javax.json.JsonObject; diff --git a/scheduler-driver/build.gradle b/scheduler-driver/build.gradle index de8ee99f58..41c84dac59 100644 --- a/scheduler-driver/build.gradle +++ b/scheduler-driver/build.gradle @@ -37,6 +37,7 @@ dependencies { implementation 'org.slf4j:slf4j-simple:2.0.7' implementation 'org.apache.commons:commons-collections4:4.4' implementation project(':merlin-framework') + implementation project(':type-utils') testImplementation project(':merlin-framework-junit') testImplementation project(':constraints') diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/DirectiveIdGenerator.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/DirectiveIdGenerator.java index 4b69e3f82a..cf178f9651 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/DirectiveIdGenerator.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/DirectiveIdGenerator.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.scheduler; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; public class DirectiveIdGenerator { private long counter; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingActivityTemplateConflict.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingActivityTemplateConflict.java index 823eb7f87b..b9de83ec9a 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingActivityTemplateConflict.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingActivityTemplateConflict.java @@ -2,12 +2,12 @@ import gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment; import gov.nasa.jpl.aerie.constraints.time.Windows; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; import gov.nasa.jpl.aerie.scheduler.goals.ActivityTemplateGoal; import gov.nasa.jpl.aerie.scheduler.goals.Goal; import gov.nasa.jpl.aerie.scheduler.solver.ScheduleAt; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Optional; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingAssociationConflict.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingAssociationConflict.java index e1c7a6ef3c..a62f203551 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingAssociationConflict.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/conflicts/MissingAssociationConflict.java @@ -2,9 +2,9 @@ import gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment; import gov.nasa.jpl.aerie.constraints.time.Windows; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; import gov.nasa.jpl.aerie.scheduler.goals.Goal; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Collection; import java.util.Optional; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CardinalityGoal.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CardinalityGoal.java index 6363bf4c9e..25a5852055 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CardinalityGoal.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CardinalityGoal.java @@ -4,7 +4,6 @@ import gov.nasa.jpl.aerie.constraints.model.SimulationResults; import gov.nasa.jpl.aerie.constraints.time.Interval; import gov.nasa.jpl.aerie.constraints.time.Windows; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.Range; @@ -15,6 +14,7 @@ import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.solver.ScheduleAt; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CoexistenceGoal.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CoexistenceGoal.java index 18fc3f95f7..cf6c695231 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CoexistenceGoal.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/CoexistenceGoal.java @@ -7,7 +7,6 @@ import gov.nasa.jpl.aerie.constraints.time.Spans; import gov.nasa.jpl.aerie.constraints.time.Windows; import gov.nasa.jpl.aerie.constraints.tree.Expression; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.conflicts.Conflict; @@ -19,6 +18,7 @@ import gov.nasa.jpl.aerie.scheduler.model.PersistentTimeAnchor; import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.solver.ScheduleAt; import java.util.ArrayList; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/Goal.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/Goal.java index 5fc75c9e2a..59db44d9da 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/Goal.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/Goal.java @@ -7,19 +7,15 @@ import gov.nasa.jpl.aerie.constraints.tree.And; import gov.nasa.jpl.aerie.constraints.tree.Expression; import gov.nasa.jpl.aerie.constraints.tree.WindowsWrapperExpression; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.conflicts.Conflict; import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; -import org.apache.commons.collections4.BidiMap; import java.util.LinkedList; import java.util.List; import java.util.Set; -import java.util.Optional; /** * describes some criteria that is desired in the solution plans diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/OptionGoal.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/OptionGoal.java index be5d7c9912..3d9e2f23ec 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/OptionGoal.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/goals/OptionGoal.java @@ -2,18 +2,15 @@ import gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment; import gov.nasa.jpl.aerie.constraints.model.SimulationResults; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.scheduler.conflicts.Conflict; import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.solver.optimizers.Optimizer; -import org.apache.commons.collections4.BidiMap; import org.apache.commons.lang3.NotImplementedException; import java.util.ArrayList; import java.util.List; import java.util.Set; -import java.util.Optional; public class OptionGoal extends Goal { diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Plan.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Plan.java index f4c2dec08f..b896bbdc40 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Plan.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Plan.java @@ -2,10 +2,10 @@ import gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment; import gov.nasa.jpl.aerie.constraints.model.SimulationResults; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; import gov.nasa.jpl.aerie.scheduler.solver.Evaluation; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Collection; import java.util.List; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/PlanInMemory.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/PlanInMemory.java index cc97ba5d0b..51b2ba5292 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/PlanInMemory.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/PlanInMemory.java @@ -2,10 +2,10 @@ import gov.nasa.jpl.aerie.constraints.model.EvaluationEnvironment; import gov.nasa.jpl.aerie.constraints.model.SimulationResults; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; import gov.nasa.jpl.aerie.scheduler.solver.Evaluation; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.ArrayList; import java.util.Collection; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Problem.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Problem.java index c046c6a295..1af4804706 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Problem.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/Problem.java @@ -2,7 +2,6 @@ import gov.nasa.jpl.aerie.constraints.model.DiscreteProfile; import gov.nasa.jpl.aerie.constraints.model.LinearProfile; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; @@ -11,7 +10,6 @@ import gov.nasa.jpl.aerie.scheduler.simulation.SimulationFacade; import gov.nasa.jpl.aerie.scheduler.simulation.SimulationData; import gov.nasa.jpl.aerie.scheduler.simulation.SimulationResultsConverter; -import org.apache.commons.collections4.BidiMap; import java.util.ArrayList; import java.util.Collection; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulePlanGrounder.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulePlanGrounder.java index 8da3da77ca..f2d87a2ad0 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulePlanGrounder.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulePlanGrounder.java @@ -2,10 +2,10 @@ import gov.nasa.jpl.aerie.constraints.model.ActivityInstance; import gov.nasa.jpl.aerie.constraints.time.Interval; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.StartOffsetReducer; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.apache.commons.lang3.tuple.Pair; import java.util.HashMap; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulingActivity.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulingActivity.java index b2e55bc2f9..114df90155 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulingActivity.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/model/SchedulingActivity.java @@ -5,10 +5,10 @@ import gov.nasa.jpl.aerie.constraints.model.SimulationResults; import gov.nasa.jpl.aerie.constraints.time.Interval; import gov.nasa.jpl.aerie.constraints.tree.ProfileExpression; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Comparator; import java.util.HashMap; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacade.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacade.java index a597106377..9a921a510b 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacade.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacade.java @@ -1,11 +1,8 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.CachedSimulationEngine; import gov.nasa.jpl.aerie.merlin.driver.CheckpointSimulationDriver; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.driver.SimulationResultsComputerInputs; import gov.nasa.jpl.aerie.merlin.framework.ThreadedTask; @@ -16,6 +13,9 @@ import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacade.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacade.java index 14c82a3671..051a4908de 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacade.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacade.java @@ -1,13 +1,13 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResultsComputerInputs; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.SchedulingInterruptedException; import gov.nasa.jpl.aerie.scheduler.model.ActivityType; import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Collection; import java.util.HashSet; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java index 69d510fd6a..772172fae5 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/simulation/SimulationFacadeUtils.java @@ -1,8 +1,5 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResultsComputerInputs; @@ -14,6 +11,9 @@ import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/solver/PrioritySolver.java b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/solver/PrioritySolver.java index d5040493d0..de6564cb4a 100644 --- a/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/solver/PrioritySolver.java +++ b/scheduler-driver/src/main/java/gov/nasa/jpl/aerie/scheduler/solver/PrioritySolver.java @@ -6,7 +6,6 @@ import gov.nasa.jpl.aerie.constraints.time.Segment; import gov.nasa.jpl.aerie.constraints.time.Windows; import gov.nasa.jpl.aerie.constraints.tree.Expression; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.DurationType; import gov.nasa.jpl.aerie.merlin.protocol.types.InstantiationException; @@ -35,6 +34,7 @@ import gov.nasa.jpl.aerie.scheduler.simulation.SimulationData; import gov.nasa.jpl.aerie.scheduler.simulation.SimulationFacade; import gov.nasa.jpl.aerie.scheduler.solver.stn.TaskNetworkAdapter; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/FixedDurationTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/FixedDurationTest.java index 828b7ff81e..e3d5f57893 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/FixedDurationTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/FixedDurationTest.java @@ -5,7 +5,6 @@ import gov.nasa.jpl.aerie.constraints.tree.SpansFromWindows; import gov.nasa.jpl.aerie.constraints.tree.WindowsWrapperExpression; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; import gov.nasa.jpl.aerie.scheduler.constraints.timeexpressions.TimeExpressionRelative; @@ -16,6 +15,7 @@ import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.scheduler.simulation.CheckpointSimulationFacade; import gov.nasa.jpl.aerie.scheduler.solver.PrioritySolver; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/ParametricDurationTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/ParametricDurationTest.java index bcc1632f89..158a819e44 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/ParametricDurationTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/ParametricDurationTest.java @@ -4,7 +4,6 @@ import gov.nasa.jpl.aerie.constraints.time.Windows; import gov.nasa.jpl.aerie.constraints.tree.SpansFromWindows; import gov.nasa.jpl.aerie.constraints.tree.WindowsWrapperExpression; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.scheduler.simulation.InMemoryCachedEngineStore; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; @@ -17,6 +16,7 @@ import gov.nasa.jpl.aerie.scheduler.model.Problem; import gov.nasa.jpl.aerie.scheduler.simulation.CheckpointSimulationFacade; import gov.nasa.jpl.aerie.scheduler.solver.PrioritySolver; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/PrioritySolverTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/PrioritySolverTest.java index c5c6f82b7b..6272b58c81 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/PrioritySolverTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/PrioritySolverTest.java @@ -5,7 +5,6 @@ import gov.nasa.jpl.aerie.constraints.time.Windows; import gov.nasa.jpl.aerie.constraints.tree.WindowsWrapperExpression; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; import gov.nasa.jpl.aerie.scheduler.constraints.timeexpressions.TimeAnchor; @@ -24,6 +23,7 @@ import gov.nasa.jpl.aerie.scheduler.simulation.SimulationFacade; import gov.nasa.jpl.aerie.scheduler.solver.Evaluation; import gov.nasa.jpl.aerie.scheduler.solver.PrioritySolver; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.Test; import java.time.Instant; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SchedulingGrounderTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SchedulingGrounderTest.java index d42f887caf..6d5e425ab4 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SchedulingGrounderTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SchedulingGrounderTest.java @@ -2,12 +2,12 @@ import gov.nasa.jpl.aerie.constraints.model.ActivityInstance; import gov.nasa.jpl.aerie.constraints.time.Interval; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.model.ActivityType; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; import gov.nasa.jpl.aerie.scheduler.model.SchedulePlanGrounder; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.junit.jupiter.api.Test; import java.util.List; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SimulationUtility.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SimulationUtility.java index b2e03d19c6..20ed13e4d5 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SimulationUtility.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/SimulationUtility.java @@ -5,13 +5,13 @@ import gov.nasa.jpl.aerie.merlin.driver.DirectiveTypeRegistry; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.MissionModelBuilder; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; import gov.nasa.jpl.aerie.scheduler.model.Problem; import gov.nasa.jpl.aerie.scheduler.simulation.InMemoryCachedEngineStore; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.scheduler.simulation.CheckpointSimulationFacade; +import gov.nasa.jpl.aerie.types.MissionModelId; import java.nio.file.Path; import java.time.Instant; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestApplyWhen.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestApplyWhen.java index 80e391c7c6..a3e0f4721f 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestApplyWhen.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestApplyWhen.java @@ -23,7 +23,6 @@ import gov.nasa.jpl.aerie.constraints.tree.SpansWrapperExpression; import gov.nasa.jpl.aerie.constraints.tree.ValueAt; import gov.nasa.jpl.aerie.constraints.tree.WindowsWrapperExpression; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.scheduler.constraints.activities.ActivityExpression; @@ -40,6 +39,7 @@ import gov.nasa.jpl.aerie.scheduler.simulation.InMemoryCachedEngineStore; import gov.nasa.jpl.aerie.scheduler.solver.PrioritySolver; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestPersistentAnchor.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestPersistentAnchor.java index c4ac77b15f..2e022cfa57 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestPersistentAnchor.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/TestPersistentAnchor.java @@ -10,8 +10,6 @@ import gov.nasa.jpl.aerie.constraints.tree.Expression; import gov.nasa.jpl.aerie.constraints.tree.ForEachActivitySpans; import gov.nasa.jpl.aerie.constraints.tree.WindowsWrapperExpression; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; @@ -23,6 +21,8 @@ import gov.nasa.jpl.aerie.scheduler.simulation.CheckpointSimulationFacade; import gov.nasa.jpl.aerie.scheduler.simulation.InMemoryCachedEngineStore; import gov.nasa.jpl.aerie.scheduler.solver.PrioritySolver; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.function.TriFunction; import org.junit.jupiter.api.Test; import org.slf4j.Logger; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java index e9196c5a76..b09ef69b90 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/AnchorSchedulerTest.java @@ -1,14 +1,10 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.CachedSimulationEngine; import gov.nasa.jpl.aerie.merlin.driver.CheckpointSimulationDriver; import gov.nasa.jpl.aerie.merlin.driver.DirectiveTypeRegistry; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.OneStepTask; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; @@ -29,7 +25,10 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.TaskStatus; import gov.nasa.jpl.aerie.merlin.protocol.types.Unit; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; -import gov.nasa.jpl.aerie.scheduler.SchedulingInterruptedException; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.SerializedActivity; import org.apache.commons.lang3.tuple.Triple; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -138,7 +137,7 @@ private static void assertEqualsAsideFromChildren(ActivityInstance expected, Act @Test @DisplayName("Activities depending on no activities simulate at the correct time") - public void activitiesAnchoredToPlan() throws SchedulingInterruptedException { + public void activitiesAnchoredToPlan() { final var minusOneMinute = Duration.of(-60, Duration.SECONDS); final var resolveToPlanStartAnchors = new HashMap(415); final Map simulatedActivities = new HashMap<>(415); @@ -245,7 +244,7 @@ public void activitiesAnchoredToPlan() throws SchedulingInterruptedException { @Test @DisplayName("Activities depending on another activities simulate at the correct time") - public void activitiesAnchoredToOtherActivities() throws SchedulingInterruptedException { + public void activitiesAnchoredToOtherActivities() { final var allEndTimeAnchors = new HashMap(400); final var endTimeAnchorEveryFifth = new HashMap(400); final Map simulatedActivities = new HashMap<>(800); @@ -356,7 +355,7 @@ public void activitiesAnchoredToOtherActivities() throws SchedulingInterruptedEx @Test @DisplayName("Reference to anchored activities are correctly maintained by the driver") - public void activitiesAnchoredToOtherActivitiesSimple() throws SchedulingInterruptedException { + public void activitiesAnchoredToOtherActivitiesSimple() { final var activitiesToSimulate = new HashMap(2); activitiesToSimulate.put( new ActivityDirectiveId(0), @@ -371,7 +370,7 @@ public void activitiesAnchoredToOtherActivitiesSimple() throws SchedulingInterru @Test @DisplayName("Decomposition and anchors do not interfere with each other") - public void decomposingActivitiesAndAnchors() throws SchedulingInterruptedException{ + public void decomposingActivitiesAndAnchors() { // Given positions Left, Center, Right in an anchor chain, where each position can either contain a Non-Decomposition (ND) activity or a Decomposition (D) activity, // and the connection between Center and Left and Right and Center can be either Start (<-s-) or End (<-e-), // and two NDs cannot be adjacent to each other, there are 20 permutations. @@ -611,7 +610,7 @@ public void decomposingActivitiesAndAnchors() throws SchedulingInterruptedExcept @Test @DisplayName("Activities arranged in a wide anchor tree simulate at the correct time") - public void naryTreeAnchorChain() throws SchedulingInterruptedException{ + public void naryTreeAnchorChain() { // Full and complete 5-ary tree, 6 levels deep // Number of activity directives = 5^0 + 5^1 + 5^2 + 5^3 + 5^4 + 5^5 = 3906 diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacadeTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacadeTest.java index 6425adbd4f..6bf447e4b0 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacadeTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/CheckpointSimulationFacadeTest.java @@ -1,6 +1,5 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.framework.ThreadedTask; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; @@ -12,6 +11,7 @@ import gov.nasa.jpl.aerie.scheduler.model.PlanInMemory; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; import gov.nasa.jpl.aerie.scheduler.model.SchedulingActivity; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/InMemoryCachedEngineStoreTest.java b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/InMemoryCachedEngineStoreTest.java index 9edf6e229a..7334871761 100644 --- a/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/InMemoryCachedEngineStoreTest.java +++ b/scheduler-driver/src/test/java/gov/nasa/jpl/aerie/scheduler/simulation/InMemoryCachedEngineStoreTest.java @@ -1,14 +1,14 @@ package gov.nasa.jpl.aerie.scheduler.simulation; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.CachedSimulationEngine; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.driver.engine.SimulationEngine; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.resources.InMemorySimulationResourceManager; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.scheduler.SimulationUtility; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/scheduler-server/build.gradle b/scheduler-server/build.gradle index 80affd74df..c4ddee4905 100644 --- a/scheduler-server/build.gradle +++ b/scheduler-server/build.gradle @@ -24,6 +24,7 @@ dependencies { implementation project(':permissions') implementation project(':constraints') implementation project(':scheduler-driver') + implementation project(':type-utils') implementation 'io.javalin:javalin:5.6.3' implementation 'org.eclipse:yasson:3.0.3' diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchActivityInstanceException.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchActivityInstanceException.java index 37733a8f6f..9f1197099e 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchActivityInstanceException.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchActivityInstanceException.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.scheduler.server.exceptions; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; public class NoSuchActivityInstanceException extends Exception { private final ActivityDirectiveId id; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchMissionModelException.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchMissionModelException.java index 050ff5ebb4..5dd1742cf6 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchMissionModelException.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/exceptions/NoSuchMissionModelException.java @@ -1,6 +1,6 @@ package gov.nasa.jpl.aerie.scheduler.server.exceptions; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; +import gov.nasa.jpl.aerie.types.MissionModelId; public class NoSuchMissionModelException extends Exception { private final MissionModelId id; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsers.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsers.java index 03e79be087..884ee472e8 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsers.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsers.java @@ -7,7 +7,7 @@ import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; import gov.nasa.jpl.aerie.merlin.protocol.types.ValueSchema; import gov.nasa.jpl.aerie.scheduler.server.models.ActivityAttributesRecord; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.tuple.Pair; import org.postgresql.util.PGInterval; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/http/SchedulerParsers.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/http/SchedulerParsers.java index 21d2b1a770..abf6b5da35 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/http/SchedulerParsers.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/http/SchedulerParsers.java @@ -2,11 +2,11 @@ import gov.nasa.jpl.aerie.json.JsonParser; import gov.nasa.jpl.aerie.scheduler.server.models.HasuraAction; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanId; import gov.nasa.jpl.aerie.scheduler.server.models.SpecificationId; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; import gov.nasa.jpl.aerie.scheduler.server.services.ScheduleFailure; +import gov.nasa.jpl.aerie.types.MissionModelId; +import gov.nasa.jpl.aerie.types.Timestamp; import java.util.Optional; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/HasuraAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/HasuraAction.java index 8c111b7e64..c3c0c9b88a 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/HasuraAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/HasuraAction.java @@ -1,5 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.models; +import gov.nasa.jpl.aerie.types.MissionModelId; + import java.util.Optional; public record HasuraAction(String name, I input, Session session) diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MerlinPlan.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MerlinPlan.java index 015f4550f3..64f24ea2b9 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MerlinPlan.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MerlinPlan.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.models; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import java.util.Collections; import java.util.HashMap; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MissionModelId.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MissionModelId.java deleted file mode 100644 index 917dc5f6d0..0000000000 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/MissionModelId.java +++ /dev/null @@ -1,3 +0,0 @@ -package gov.nasa.jpl.aerie.scheduler.server.models; - -public record MissionModelId(long id) {} diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Specification.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Specification.java index 8f92a55986..42d471e34f 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Specification.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Specification.java @@ -1,6 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.models; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; +import gov.nasa.jpl.aerie.types.Timestamp; import java.util.List; import java.util.Map; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Timestamp.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Timestamp.java deleted file mode 100644 index c8459e74c0..0000000000 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/models/Timestamp.java +++ /dev/null @@ -1,50 +0,0 @@ -package gov.nasa.jpl.aerie.scheduler.server.models; - -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeFormatterBuilder; -import java.time.format.DateTimeParseException; -import java.time.temporal.ChronoField; -import java.time.temporal.ChronoUnit; - -public record Timestamp(ZonedDateTime time) { - // This builder must be used to get optional subsecond values - // See: https://stackoverflow.com/questions/30090710/java-8-datetimeformatter-parsing-for-optional-fractional-seconds-of-varying-sign - public static final DateTimeFormatter format = - new DateTimeFormatterBuilder() - .appendPattern("uuuu-DDD'T'HH:mm:ss") - .appendFraction(ChronoField.MICRO_OF_SECOND, 0, 6, true) - .toFormatter(); - - private Timestamp(String timestamp) throws DateTimeParseException { - this(LocalDateTime.parse(timestamp, format).atZone(ZoneOffset.UTC)); - } - - public Timestamp(Instant instant) { - this(instant.atZone(ZoneOffset.UTC)); - } - - public static Timestamp fromString(String timestamp) throws DateTimeParseException { - return new Timestamp(timestamp); - } - - public Timestamp plusMicros(final long micros) { - return new Timestamp(this.time.plus(micros, ChronoUnit.MICROS)); - } - - public long microsUntil(final Timestamp other) { - return this.time.until(other.time, ChronoUnit.MICROS); - } - - public Instant toInstant() { - return time.toInstant(); - } - - @Override - public String toString() { - return format.format(time); - } -} diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetCreatedActivitiesAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetCreatedActivitiesAction.java index 7bbd88b621..0caeafdd23 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetCreatedActivitiesAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetCreatedActivitiesAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSatisfyingActivitiesAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSatisfyingActivitiesAction.java index 19240ee2af..4254634d26 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSatisfyingActivitiesAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSatisfyingActivitiesAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSpecificationAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSpecificationAction.java index 5ed47ae8d1..0a1639db26 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSpecificationAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GetSpecificationAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.remotes.postgres; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.intellij.lang.annotations.Language; import javax.json.Json; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GoalBuilder.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GoalBuilder.java index bd4050a00d..6059c06b7a 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GoalBuilder.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/GoalBuilder.java @@ -27,8 +27,8 @@ import gov.nasa.jpl.aerie.scheduler.model.PersistentTimeAnchor; import gov.nasa.jpl.aerie.scheduler.model.PlanningHorizon; import gov.nasa.jpl.aerie.scheduler.server.models.SchedulingDSL; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; import gov.nasa.jpl.aerie.scheduler.server.services.UnexpectedSubtypeError; +import gov.nasa.jpl.aerie.types.Timestamp; import org.apache.commons.lang3.function.TriFunction; import org.jetbrains.annotations.NotNull; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertCreatedActivitiesAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertCreatedActivitiesAction.java index 8a17bc5279..65770d1da5 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertCreatedActivitiesAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertCreatedActivitiesAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertSatisfyingActivitiesAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertSatisfyingActivitiesAction.java index 1282c5891d..0b6b9a5f79 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertSatisfyingActivitiesAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/InsertSatisfyingActivitiesAction.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.remotes.postgres; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.intellij.lang.annotations.Language; import java.sql.Connection; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresParsers.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresParsers.java index 901a1502f3..07beef7596 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresParsers.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresParsers.java @@ -4,8 +4,8 @@ import gov.nasa.jpl.aerie.json.JsonParser; import gov.nasa.jpl.aerie.json.SchemaCache; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; import gov.nasa.jpl.aerie.scheduler.server.services.UnexpectedSubtypeError; +import gov.nasa.jpl.aerie.types.Timestamp; import javax.json.Json; import javax.json.JsonObject; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresResultsCellRepository.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresResultsCellRepository.java index 11455b06c2..87bd7daaf0 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresResultsCellRepository.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/PostgresResultsCellRepository.java @@ -8,7 +8,6 @@ import java.util.HashMap; import java.util.Optional; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.SchedulingInterruptedException; import gov.nasa.jpl.aerie.scheduler.server.ResultsProtocol; import gov.nasa.jpl.aerie.scheduler.server.exceptions.NoSuchRequestException; @@ -21,6 +20,7 @@ import gov.nasa.jpl.aerie.scheduler.server.services.ScheduleRequest; import gov.nasa.jpl.aerie.scheduler.server.services.ScheduleResults; import gov.nasa.jpl.aerie.scheduler.server.services.ScheduleResults.GoalResult; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/SpecificationRecord.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/SpecificationRecord.java index c97bca9a34..c01fbe846a 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/SpecificationRecord.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/remotes/postgres/SpecificationRecord.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.remotes.postgres; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import java.util.Map; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GenerateSchedulingLibAction.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GenerateSchedulingLibAction.java index ff38298154..6782920a8b 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GenerateSchedulingLibAction.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GenerateSchedulingLibAction.java @@ -10,8 +10,8 @@ import gov.nasa.jpl.aerie.scheduler.server.exceptions.NoSuchMissionModelException; import gov.nasa.jpl.aerie.scheduler.server.exceptions.NoSuchPlanException; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanId; +import gov.nasa.jpl.aerie.types.MissionModelId; public record GenerateSchedulingLibAction( MerlinDatabaseService.ReaderRole merlinDatabaseService diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java index a2be8388c6..f1d3e5e111 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/GraphQLMerlinDatabaseService.java @@ -4,8 +4,6 @@ import gov.nasa.jpl.aerie.constraints.model.LinearProfile; import gov.nasa.jpl.aerie.json.BasicParsers; import gov.nasa.jpl.aerie.json.JsonParser; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstance; import gov.nasa.jpl.aerie.merlin.driver.ActivityInstanceId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; @@ -37,12 +35,14 @@ import gov.nasa.jpl.aerie.scheduler.server.models.ExternalProfiles; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; import gov.nasa.jpl.aerie.scheduler.server.models.MerlinPlan; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanMetadata; import gov.nasa.jpl.aerie.scheduler.server.models.ProfileSet; import gov.nasa.jpl.aerie.scheduler.server.models.ResourceType; import gov.nasa.jpl.aerie.scheduler.server.models.UnwrappedProfileSet; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.lang3.tuple.Triple; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/MerlinDatabaseService.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/MerlinDatabaseService.java index 8120ce5d95..8856c101fc 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/MerlinDatabaseService.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/MerlinDatabaseService.java @@ -1,6 +1,5 @@ package gov.nasa.jpl.aerie.scheduler.server.services; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; @@ -17,10 +16,11 @@ import gov.nasa.jpl.aerie.scheduler.server.models.ExternalProfiles; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; import gov.nasa.jpl.aerie.scheduler.server.models.MerlinPlan; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanMetadata; import gov.nasa.jpl.aerie.scheduler.server.models.ResourceType; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import java.io.IOException; diff --git a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/ScheduleResults.java b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/ScheduleResults.java index ec7699dad3..755ca3c313 100644 --- a/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/ScheduleResults.java +++ b/scheduler-server/src/main/java/gov/nasa/jpl/aerie/scheduler/server/services/ScheduleResults.java @@ -3,8 +3,8 @@ import java.util.Collection; import java.util.Map; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; /** * summary of results from running the scheduler, including goal satisfaction metrics and changes made diff --git a/scheduler-server/src/test/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsersTest.java b/scheduler-server/src/test/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsersTest.java index 7afe66fa4a..23ebddbcf2 100644 --- a/scheduler-server/src/test/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsersTest.java +++ b/scheduler-server/src/test/java/gov/nasa/jpl/aerie/scheduler/server/graphql/GraphQLParsersTest.java @@ -1,7 +1,7 @@ package gov.nasa.jpl.aerie.scheduler.server.graphql; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; +import gov.nasa.jpl.aerie.types.Timestamp; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; diff --git a/scheduler-worker/build.gradle b/scheduler-worker/build.gradle index ccd1ccaebf..b139bcbc25 100644 --- a/scheduler-worker/build.gradle +++ b/scheduler-worker/build.gradle @@ -108,6 +108,7 @@ javadoc.options.addStringOption('Xdoclint:none', '-quiet') dependencies { implementation project(':merlin-driver') + implementation project(':type-utils') implementation project(':scheduler-driver') implementation project(':scheduler-server') implementation project(':parsing-utilities') diff --git a/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java b/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java index dfc27ccaaa..56a1af35e2 100644 --- a/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java +++ b/scheduler-worker/src/main/java/gov/nasa/jpl/aerie/scheduler/worker/services/SynchronousSchedulerAgent.java @@ -20,9 +20,7 @@ import java.util.jar.JarFile; import java.util.stream.Collectors; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.MissionModel; -import gov.nasa.jpl.aerie.merlin.driver.MissionModelId; import gov.nasa.jpl.aerie.merlin.driver.MissionModelLoader; import gov.nasa.jpl.aerie.merlin.driver.SimulationEngineConfiguration; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; @@ -71,6 +69,8 @@ import gov.nasa.jpl.aerie.scheduler.simulation.InMemoryCachedEngineStore; import gov.nasa.jpl.aerie.scheduler.simulation.SimulationData; import gov.nasa.jpl.aerie.scheduler.solver.PrioritySolver; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/MockMerlinDatabaseService.java b/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/MockMerlinDatabaseService.java index aead83f693..67ba1bbe02 100644 --- a/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/MockMerlinDatabaseService.java +++ b/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/MockMerlinDatabaseService.java @@ -1,7 +1,5 @@ package gov.nasa.jpl.aerie.scheduler.worker.services; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.SimulationResults; import gov.nasa.jpl.aerie.merlin.protocol.model.SchedulerModel; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; @@ -16,11 +14,13 @@ import gov.nasa.jpl.aerie.scheduler.server.models.ExternalProfiles; import gov.nasa.jpl.aerie.scheduler.server.models.GoalId; import gov.nasa.jpl.aerie.scheduler.server.models.MerlinPlan; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanMetadata; import gov.nasa.jpl.aerie.scheduler.server.models.ResourceType; import gov.nasa.jpl.aerie.scheduler.server.services.MerlinDatabaseService; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import java.nio.file.Path; diff --git a/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingDSLCompilationServiceTests.java b/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingDSLCompilationServiceTests.java index dd6848d4b2..d2e0c2fc26 100644 --- a/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingDSLCompilationServiceTests.java +++ b/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingDSLCompilationServiceTests.java @@ -35,13 +35,13 @@ import gov.nasa.jpl.aerie.scheduler.server.models.DatasetId; import gov.nasa.jpl.aerie.scheduler.server.models.ExternalProfiles; import gov.nasa.jpl.aerie.scheduler.server.models.MerlinPlan; -import gov.nasa.jpl.aerie.scheduler.server.models.MissionModelId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanId; import gov.nasa.jpl.aerie.scheduler.server.models.PlanMetadata; import gov.nasa.jpl.aerie.scheduler.server.models.ResourceType; import gov.nasa.jpl.aerie.scheduler.server.models.SchedulingDSL; import gov.nasa.jpl.aerie.scheduler.server.services.MerlinDatabaseService; import gov.nasa.jpl.aerie.scheduler.server.services.MerlinServiceException; +import gov.nasa.jpl.aerie.types.MissionModelId; import org.apache.commons.lang3.tuple.Pair; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; @@ -80,45 +80,37 @@ public MerlinDatabaseService.MissionModelTypes getMissionModelTypes(final Missio } @Override - public long getPlanRevision(final PlanId planId) throws IOException, NoSuchPlanException, MerlinServiceException { + public long getPlanRevision(final PlanId planId) { return 0; } @Override - public PlanMetadata getPlanMetadata(final PlanId planId) - throws IOException, NoSuchPlanException, MerlinServiceException - { + public PlanMetadata getPlanMetadata(final PlanId planId) { return null; } @Override - public MerlinPlan getPlanActivityDirectives(final PlanMetadata planMetadata, final Problem mission) - throws IOException, NoSuchPlanException, MerlinServiceException, InvalidJsonException, InstantiationException - { + public MerlinPlan getPlanActivityDirectives(final PlanMetadata planMetadata, final Problem mission) { return null; } @Override - public void ensurePlanExists(final PlanId planId) throws IOException, NoSuchPlanException, MerlinServiceException { + public void ensurePlanExists(final PlanId planId) { } @Override - public Optional> getSimulationResults(final PlanMetadata planMetadata) - throws MerlinServiceException, IOException, InvalidJsonException - { + public Optional> getSimulationResults(final PlanMetadata planMetadata) { return Optional.empty(); } @Override - public ExternalProfiles getExternalProfiles(final PlanId planId) throws MerlinServiceException, IOException { + public ExternalProfiles getExternalProfiles(final PlanId planId) { return null; } @Override - public Collection getResourceTypes(final PlanId planId) - throws IOException, MerlinServiceException, NoSuchPlanException - { + public Collection getResourceTypes(final PlanId planId) { return null; } }; diff --git a/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingIntegrationTests.java b/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingIntegrationTests.java index 70b2d2d71d..3242e7ef39 100644 --- a/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingIntegrationTests.java +++ b/scheduler-worker/src/test/java/gov/nasa/jpl/aerie/scheduler/worker/services/SchedulingIntegrationTests.java @@ -27,10 +27,7 @@ import gov.nasa.jpl.aerie.constraints.model.DiscreteProfile; import gov.nasa.jpl.aerie.constraints.time.Interval; import gov.nasa.jpl.aerie.constraints.time.Segment; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.driver.MissionModelLoader; -import gov.nasa.jpl.aerie.merlin.driver.SerializedActivity; import gov.nasa.jpl.aerie.merlin.protocol.model.DirectiveType; import gov.nasa.jpl.aerie.merlin.protocol.model.InputType.Parameter; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; @@ -51,13 +48,16 @@ import gov.nasa.jpl.aerie.scheduler.server.models.ResourceType; import gov.nasa.jpl.aerie.scheduler.server.models.Specification; import gov.nasa.jpl.aerie.scheduler.server.models.SpecificationId; -import gov.nasa.jpl.aerie.scheduler.server.models.Timestamp; import gov.nasa.jpl.aerie.scheduler.server.remotes.postgres.SpecificationRevisionData; import gov.nasa.jpl.aerie.scheduler.server.services.MerlinDatabaseService; import gov.nasa.jpl.aerie.scheduler.server.services.ScheduleRequest; import gov.nasa.jpl.aerie.scheduler.server.services.ScheduleResults; import gov.nasa.jpl.aerie.scheduler.model.Plan; import gov.nasa.jpl.aerie.scheduler.server.services.SpecificationService; +import gov.nasa.jpl.aerie.types.ActivityDirective; +import gov.nasa.jpl.aerie.types.ActivityDirectiveId; +import gov.nasa.jpl.aerie.types.SerializedActivity; +import gov.nasa.jpl.aerie.types.Timestamp; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; @@ -166,7 +166,7 @@ export default function myGoal() { specification : {duration: Temporal.Duration.from({seconds: 10})} }) } - """, true)),List.of(createAutoMutex("GrowBanana")), PLANNING_HORIZON); + """, true)),List.of(createAutoMutex("GrowBanana")), PLANNING_HORIZON); assertEquals(1, results.scheduleResults.goalResults().size()); final var goalResult = results.scheduleResults.goalResults().get(new GoalId(0L, 0L)); @@ -207,7 +207,7 @@ export default function myGoal() { specification : {occurrence: 10} }) } - """, true)),List.of(createAutoMutex("GrowBanana")),PLANNING_HORIZON); + """, true)),List.of(createAutoMutex("GrowBanana")),PLANNING_HORIZON); assertEquals(1, results.scheduleResults.goalResults().size()); final var goalResult = results.scheduleResults.goalResults().get(new GoalId(0L, 0L)); @@ -655,7 +655,7 @@ export default () => Goal.CoexistenceGoal({ assertEquals(2, planByTime.get(MINUTES.times(10)).size()); var lookingFor = false; final var expectedCreation = new SerializedActivity("GrowBanana", - Map.of("quantity", SerializedValue.of(1), + Map.of("quantity", SerializedValue.of(1), "growingDuration", SerializedValue.of(MINUTES.in(MICROSECONDS)))); for(final var actAtTime10: planByTime.get(MINUTES.times(10))){ if(actAtTime10.serializedActivity().equals(expectedCreation)){ @@ -751,7 +751,7 @@ export default function myGoal() { specification : {duration: Temporal.Duration.from({seconds: 10})} }) } - """, true)),List.of(createAutoMutex("GrowBanana")), PLANNING_HORIZON); + """, true)),List.of(createAutoMutex("GrowBanana")), PLANNING_HORIZON); assertEquals(1, results.scheduleResults.goalResults().size()); final var goalResult = results.scheduleResults.goalResults().get(new GoalId(0L, 0L)); @@ -2531,7 +2531,7 @@ export default function myGoal() { interval: Temporal.Duration.from({hours: 1}) }) } - """, true)), + """, true)), PLANNING_HORIZON); assertEquals(96, results.updatedPlan().size()); } @@ -2553,7 +2553,7 @@ export default (): Goal => { interval: Temporal.Duration.from({ days: 30}) }) } - """, true)), PLANNING_HORIZON); + """, true)), PLANNING_HORIZON); //parent takes much more than 134 - 90 = 44 days to finish assertEquals(0, results.updatedPlan.size()); final var goalResult = results.scheduleResults.goalResults().get(new GoalId(0L, 0L)); @@ -3261,7 +3261,7 @@ export default () => Goal.CoexistenceGoal({ activityTemplate: ActivityTemplates.BananaNap(), startsAt: TimingConstraint.singleton(WindowProperty.START).plus(Temporal.Duration.from({ minutes: 5 })) }) - """, true, true) + """, true, true) ), PLANNING_HORIZON); @@ -3441,7 +3441,7 @@ export default function myGoal() { specification : {occurrence: 1} }) } - """, true)),List.of(), PLANNING_HORIZON); + """, true)),List.of(), PLANNING_HORIZON); assertEquals(1, results.scheduleResults.goalResults().size()); final var goalResult = results.scheduleResults.goalResults().get(new GoalId(0L, 0L)); diff --git a/settings.gradle b/settings.gradle index ce6c145ad4..cd72036376 100644 --- a/settings.gradle +++ b/settings.gradle @@ -43,3 +43,4 @@ include 'examples:minimal-mission-model' include 'examples:streamline-demo' include 'stateless-aerie' include 'orchestration-utils' +include 'type-utils' diff --git a/stateless-aerie/build.gradle b/stateless-aerie/build.gradle index 2168fc812a..fd6c9ac8bd 100644 --- a/stateless-aerie/build.gradle +++ b/stateless-aerie/build.gradle @@ -16,10 +16,11 @@ java { jar { dependsOn(':parsing-utilities:jar') - dependsOn(':merlin-sdk:jar') - dependsOn(':merlin-driver:jar') - dependsOn(':constraints:jar') + dependsOn(':type-utils:jar') dependsOn(':orchestration-utils:jar') + dependsOn(':constraints:jar') + dependsOn(':merlin-driver:jar') + dependsOn(':merlin-sdk:jar') duplicatesStrategy = DuplicatesStrategy.EXCLUDE @@ -55,9 +56,9 @@ javadoc.options.links 'https://commons.apache.org/proper/commons-lang/javadocs/a javadoc.options.addStringOption('Xdoclint:none', '-quiet') dependencies { + implementation project(':type-utils') implementation project(':orchestration-utils') implementation project(':merlin-driver') - implementation project(':merlin-server') implementation 'commons-cli:commons-cli:1.8.0' testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.10.0' diff --git a/stateless-aerie/src/main/java/gov/nasa/jpl/aerie/stateless/Main.java b/stateless-aerie/src/main/java/gov/nasa/jpl/aerie/stateless/Main.java index 6fdc079d2d..07c4acafd6 100644 --- a/stateless-aerie/src/main/java/gov/nasa/jpl/aerie/stateless/Main.java +++ b/stateless-aerie/src/main/java/gov/nasa/jpl/aerie/stateless/Main.java @@ -8,7 +8,6 @@ import gov.nasa.jpl.aerie.merlin.driver.MissionModel; import gov.nasa.jpl.aerie.merlin.driver.MissionModelLoader; import gov.nasa.jpl.aerie.merlin.driver.SimulationException; -import gov.nasa.jpl.aerie.merlin.server.models.Plan; import java.nio.file.Path; import java.util.Map; @@ -16,6 +15,7 @@ import java.util.concurrent.ExecutionException; import gov.nasa.jpl.aerie.orchestration.simulation.SimulationUtility; +import gov.nasa.jpl.aerie.types.Plan; import org.apache.commons.cli.*; import javax.json.Json; diff --git a/type-utils/build.gradle b/type-utils/build.gradle new file mode 100644 index 0000000000..b83c826453 --- /dev/null +++ b/type-utils/build.gradle @@ -0,0 +1,23 @@ +plugins { + id 'java' +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(21) + } + + withJavadocJar() + withSourcesJar() +} + +dependencies { + implementation project(":merlin-sdk") + + testImplementation platform('org.junit:junit-bom:5.10.0') + testImplementation 'org.junit.jupiter:junit-jupiter' +} + +test { + useJUnitPlatform() +} diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityDirective.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityDirective.java similarity index 94% rename from merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityDirective.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityDirective.java index 76b87e312f..461db012ab 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityDirective.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityDirective.java @@ -1,4 +1,4 @@ -package gov.nasa.jpl.aerie.merlin.driver; +package gov.nasa.jpl.aerie.types; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityDirectiveId.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityDirectiveId.java similarity index 52% rename from merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityDirectiveId.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityDirectiveId.java index cc0e0d6376..c264c39dfc 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/ActivityDirectiveId.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/ActivityDirectiveId.java @@ -1,3 +1,3 @@ -package gov.nasa.jpl.aerie.merlin.driver; +package gov.nasa.jpl.aerie.types; public record ActivityDirectiveId(long id) {} diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelId.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/MissionModelId.java similarity index 72% rename from merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelId.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/MissionModelId.java index d212b7f442..eb6f31d445 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/MissionModelId.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/MissionModelId.java @@ -1,4 +1,4 @@ -package gov.nasa.jpl.aerie.merlin.server.models; +package gov.nasa.jpl.aerie.types; public record MissionModelId(long id) { @Override diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/Plan.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/Plan.java similarity index 97% rename from merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/Plan.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/Plan.java index 35d4a8c82c..eb1efdf0e1 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/Plan.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/Plan.java @@ -1,7 +1,5 @@ -package gov.nasa.jpl.aerie.merlin.server.models; +package gov.nasa.jpl.aerie.types; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirective; -import gov.nasa.jpl.aerie.merlin.driver.ActivityDirectiveId; import gov.nasa.jpl.aerie.merlin.protocol.types.Duration; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; diff --git a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SerializedActivity.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/SerializedActivity.java similarity index 96% rename from merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SerializedActivity.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/SerializedActivity.java index 712eabebe7..a861b64592 100644 --- a/merlin-driver/src/main/java/gov/nasa/jpl/aerie/merlin/driver/SerializedActivity.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/SerializedActivity.java @@ -1,4 +1,4 @@ -package gov.nasa.jpl.aerie.merlin.driver; +package gov.nasa.jpl.aerie.types; import gov.nasa.jpl.aerie.merlin.protocol.types.SerializedValue; @@ -68,6 +68,6 @@ public int hashCode() { @Override public String toString() { - return "SerializedActivity { typeName = " + this.typeName + ", arguments = " + this.arguments.toString() + " }"; + return "SerializedActivity { typeName = " + this.typeName + ", arguments = " + this.arguments + " }"; } } diff --git a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/Timestamp.java b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/Timestamp.java similarity index 96% rename from merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/Timestamp.java rename to type-utils/src/main/java/gov/nasa/jpl/aerie/types/Timestamp.java index 16932f0fde..309c756d21 100644 --- a/merlin-server/src/main/java/gov/nasa/jpl/aerie/merlin/server/models/Timestamp.java +++ b/type-utils/src/main/java/gov/nasa/jpl/aerie/types/Timestamp.java @@ -1,4 +1,4 @@ -package gov.nasa.jpl.aerie.merlin.server.models; +package gov.nasa.jpl.aerie.types; import java.time.Instant; import java.time.LocalDateTime;