diff --git a/.github/workflows/dev_build.yml b/.github/workflows/dev_build.yml
index 17cc8c9..9b18ee0 100644
--- a/.github/workflows/dev_build.yml
+++ b/.github/workflows/dev_build.yml
@@ -26,11 +26,10 @@ jobs:
distribution: 'temurin'
cache: maven
- - name: Get GCM and Taskit Version
+ - name: Get GCM Version
run: |
echo "gcm_version=v$(mvn help:evaluate -Dexpression=gcm.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
- echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
-
+
- name: Checkout GCM
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
@@ -39,6 +38,11 @@ jobs:
path: gcm
ref: dev
+ - name: Get Taskit Version
+ if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
+ run: |
+ echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
+
- name: Checkout Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
@@ -48,9 +52,9 @@ jobs:
ref: dev
- name: Get Util Version
- if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
+ if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: |
- echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
+ echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file taskit/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Util
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
@@ -64,14 +68,14 @@ jobs:
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file util/pom.xml
- - name: Build GCM
- if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
- run: mvn clean install -DskipTests --file gcm/simulation/pom.xml
-
- name: Build Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file taskit/pom.xml
+ - name: Build GCM
+ if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
+ run: mvn clean install -DskipTests --file gcm/simulation/pom.xml
+
- name: Build GCM Taskit
run: mvn clean install --file pom.xml
diff --git a/.github/workflows/dev_pr_build.yml b/.github/workflows/dev_pr_build.yml
index ab6b996..7ba298b 100644
--- a/.github/workflows/dev_pr_build.yml
+++ b/.github/workflows/dev_pr_build.yml
@@ -26,11 +26,10 @@ jobs:
distribution: 'temurin'
cache: maven
- - name: Get GCM and Taskit Version
+ - name: Get GCM Version
run: |
echo "gcm_version=v$(mvn help:evaluate -Dexpression=gcm.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
- echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file pom.xml)" >> "$GITHUB_ENV"
-
+
- name: Checkout GCM
if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
@@ -39,6 +38,11 @@ jobs:
path: gcm
ref: dev
+ - name: Get Taskit Version
+ if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
+ run: |
+ echo "taskit_version=v$(mvn help:evaluate -Dexpression=taskit.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
+
- name: Checkout Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
uses: actions/checkout@v4
@@ -48,9 +52,9 @@ jobs:
ref: dev
- name: Get Util Version
- if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
+ if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: |
- echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file gcm/pom.xml)" >> "$GITHUB_ENV"
+ echo "util_version=v$(mvn help:evaluate -Dexpression=util.version -q -DforceStdout --file taskit/pom.xml)" >> "$GITHUB_ENV"
- name: Checkout Util
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
@@ -64,14 +68,14 @@ jobs:
if: ${{ endsWith(env.util_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file util/pom.xml
- - name: Build GCM
- if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
- run: mvn clean install -DskipTests --file gcm/simulation/pom.xml
-
- name: Build Taskit
if: ${{ endsWith(env.taskit_version, 'SNAPSHOT') }}
run: mvn clean install -DskipTests --file taskit/pom.xml
+ - name: Build GCM
+ if: ${{ endsWith(env.gcm_version, 'SNAPSHOT') }}
+ run: mvn clean install -DskipTests --file gcm/simulation/pom.xml
+
- name: Build GCM Taskit
run: mvn clean install --file pom.xml
diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml
index e1f4edf..3a20de8 100644
--- a/.github/workflows/release_build.yml
+++ b/.github/workflows/release_build.yml
@@ -60,6 +60,7 @@ jobs:
skipIfReleaseExists: true
update-gcm-pipeline:
+ if: ${{ !endsWith(needs.release.outputs.gcm_taskit_version, '0') }}
needs: release
runs-on: ubuntu-latest
permissions:
diff --git a/pom.xml b/pom.xml
index 8aac035..38a2640 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,7 +50,7 @@
- 2.8.5
+ 3.0.0
UTF-8
@@ -59,20 +59,19 @@
1.6.0
- 3.2.5
- 3.2.5
+ 3.4.0
+ 3.4.0
3.3.1
3.1.2
3.1.2
- 3.6.3
- 3.2.4
- 0.4.0
+ 3.8.0
+ 3.2.5
+ 0.5.0
- 4.1.0
- 4.2.3
+ 4.3.0
0.8.12
- 5.10.2
+ 5.11.0
diff --git a/protobuf/pom.xml b/protobuf/pom.xml
index 0f89edb..ec53204 100644
--- a/protobuf/pom.xml
+++ b/protobuf/pom.xml
@@ -26,8 +26,8 @@
1.7.1
- 3.6.1
- 3.5.0
+ 3.7.1
+ 3.6.0
0.6.1
1.4.1
@@ -37,11 +37,6 @@
-
- gov.hhs.aspr.ms.taskit
- protobuf
- ${taskit.version}
-
com.google.protobuf
protoc
@@ -94,20 +89,14 @@
unpack-protos
generate-sources
- unpack
+ unpack-dependencies
-
-
- gov.hhs.aspr.ms.taskit
- protobuf
- ${taskit.version}
- true
- ${project.build.outputDirectory}
- **/*.proto
- **/testsupport/*.proto
-
-
+ **/*.proto
+ **/testsupport/*.proto
+ ${project.build.outputDirectory}
+ protobuf
+ jar
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/NucleusTranslator.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/NucleusTranslator.java
deleted file mode 100644
index c6c0c35..0000000
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/NucleusTranslator.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.ExperimentParameterDataInput;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.SimulationStateInput;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translationSpecs.ExampleDimensionTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs.DimensionTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs.ExperimentParameterDataTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs.PlannerTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs.SimulationStateTranslationSpec;
-import gov.hhs.aspr.ms.taskit.core.TranslationSpec;
-import gov.hhs.aspr.ms.taskit.core.Translator;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationEngine;
-
-/**
- * Translator for Nucleus Using this Translator will add all the necessary
- * TanslationSpecs needed to read and write the classes within Nucleus
- */
-public class NucleusTranslator {
-
- private NucleusTranslator() {
- }
-
- protected static List> getTranslationSpecs() {
- List> list = new ArrayList<>();
-
- list.add(new SimulationStateTranslationSpec());
- list.add(new PlannerTranslationSpec());
- list.add(new DimensionTranslationSpec());
- list.add(new ExampleDimensionTranslationSpec());
- list.add(new ExperimentParameterDataTranslationSpec());
-
- return list;
- }
-
- /**
- * Returns a Translator Builder that already includes the necessary
- * TranslationSpecs needed to read and write the classes within Nucleus
- */
- private static Translator.Builder builder() {
- Translator.Builder builder = Translator.builder()
- .setTranslatorId(NucleusTranslatorId.TRANSLATOR_ID)
- .setInitializer((translatorContext) -> {
- ProtobufTranslationEngine.Builder translationEngineBuilder = translatorContext
- .getTranslationEngineBuilder(ProtobufTranslationEngine.Builder.class);
-
- for (TranslationSpec, ?> translationSpec : getTranslationSpecs()) {
- translationEngineBuilder.addTranslationSpec(translationSpec);
- }
-
- translationEngineBuilder.addFieldToIncludeDefaultValue(
- SimulationStateInput.getDescriptor().findFieldByName("startTime"));
-
- translationEngineBuilder.addFieldToIncludeDefaultValue(
- ExperimentParameterDataInput.getDescriptor().findFieldByName("threadCount"))
- .addFieldToIncludeDefaultValue(
- ExperimentParameterDataInput.getDescriptor().findFieldByName("startRecordingIsScheduled"))
- .addFieldToIncludeDefaultValue(
- ExperimentParameterDataInput.getDescriptor().findFieldByName("simulationHaltTime"))
- .addFieldToIncludeDefaultValue(
- ExperimentParameterDataInput.getDescriptor().findFieldByName("haltOnException"))
- .addFieldToIncludeDefaultValue(
- ExperimentParameterDataInput.getDescriptor().findFieldByName("experimentProgressLogPath"))
- .addFieldToIncludeDefaultValue(
- ExperimentParameterDataInput.getDescriptor().findFieldByName("continueFromProgressLog"));
- });
-
- return builder;
- }
-
- /**
- * Returns a Translator that includes TranslationSpecs for the
- * classes within Nucleus
- */
- public static Translator getTranslator() {
- return builder().build();
- }
-}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/testsupport/translationSpecs/ExampleDimensionTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/testsupport/translation/specs/ExampleDimensionTranslationSpec.java
similarity index 75%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/testsupport/translationSpecs/ExampleDimensionTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/testsupport/translation/specs/ExampleDimensionTranslationSpec.java
index b46b021..62cd25a 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/testsupport/translationSpecs/ExampleDimensionTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/testsupport/translation/specs/ExampleDimensionTranslationSpec.java
@@ -1,18 +1,18 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translation.specs;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.ExampleDimension;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.input.ExampleDimensionInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class ExampleDimensionTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected ExampleDimension convertInputObject(ExampleDimensionInput inputObject) {
+ protected ExampleDimension translateInputObject(ExampleDimensionInput inputObject) {
return new ExampleDimension(inputObject.getLevelName());
}
@Override
- protected ExampleDimensionInput convertAppObject(ExampleDimension appObject) {
+ protected ExampleDimensionInput translateAppObject(ExampleDimension appObject) {
return ExampleDimensionInput.newBuilder().setLevelName(appObject.getLevelName()).build();
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/NucleusTranslator.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/NucleusTranslator.java
new file mode 100644
index 0000000..a667f4b
--- /dev/null
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/NucleusTranslator.java
@@ -0,0 +1,85 @@
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.ExperimentParameterDataInput;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.SimulationStateInput;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.testsupport.translation.specs.ExampleDimensionTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.DimensionTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.ExperimentParameterDataTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.PlannerTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs.SimulationStateTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.translation.Translator;
+import gov.hhs.aspr.ms.taskit.protobuf.engine.IProtobufTaskitEngineBuilder;
+import gov.hhs.aspr.ms.taskit.protobuf.engine.ProtobufJsonTaskitEngine;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
+
+/**
+ * Translator for Nucleus Using this Translator will add all the necessary
+ * TranslationSpecs needed to read and write the classes within Nucleus
+ */
+public class NucleusTranslator {
+
+ private NucleusTranslator() {
+ }
+
+ protected static List> getTranslationSpecs() {
+ List> list = new ArrayList<>();
+
+ list.add(new SimulationStateTranslationSpec());
+ list.add(new PlannerTranslationSpec());
+ list.add(new DimensionTranslationSpec());
+ list.add(new ExampleDimensionTranslationSpec());
+ list.add(new ExperimentParameterDataTranslationSpec());
+
+ return list;
+ }
+
+ /**
+ * Returns a Translator Builder that already includes the necessary
+ * TranslationSpecs needed to read and write the classes within Nucleus
+ */
+ private static Translator.Builder builder() {
+ Translator.Builder builder = Translator.builder()
+ .setTranslatorId(NucleusTranslatorId.TRANSLATOR_ID)
+ .setInitializer((translatorContext) -> {
+ IProtobufTaskitEngineBuilder taskitEngineBuilder = translatorContext
+ .getTaskitEngineBuilder(IProtobufTaskitEngineBuilder.class);
+
+ for (ProtobufTranslationSpec, ?> translationSpec : getTranslationSpecs()) {
+ taskitEngineBuilder.addTranslationSpec(translationSpec);
+ }
+
+ if (taskitEngineBuilder instanceof ProtobufJsonTaskitEngine.Builder) {
+ ((ProtobufJsonTaskitEngine.Builder) taskitEngineBuilder).addFieldToIncludeDefaultValue(
+ SimulationStateInput.getDescriptor().findFieldByName("startTime"));
+
+ ((ProtobufJsonTaskitEngine.Builder) taskitEngineBuilder)
+ .addFieldToIncludeDefaultValue(
+ ExperimentParameterDataInput.getDescriptor().findFieldByName("threadCount"))
+ .addFieldToIncludeDefaultValue(ExperimentParameterDataInput.getDescriptor()
+ .findFieldByName("startRecordingIsScheduled"))
+ .addFieldToIncludeDefaultValue(ExperimentParameterDataInput.getDescriptor()
+ .findFieldByName("simulationHaltTime"))
+ .addFieldToIncludeDefaultValue(
+ ExperimentParameterDataInput.getDescriptor().findFieldByName("haltOnException"))
+ .addFieldToIncludeDefaultValue(ExperimentParameterDataInput.getDescriptor()
+ .findFieldByName("experimentProgressLogPath"))
+ .addFieldToIncludeDefaultValue(ExperimentParameterDataInput.getDescriptor()
+ .findFieldByName("continueFromProgressLog"));
+ }
+
+ });
+
+ return builder;
+ }
+
+ /**
+ * Returns a Translator that includes TranslationSpecs for the classes within
+ * Nucleus
+ */
+ public static Translator getTranslator() {
+ return builder().build();
+ }
+}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/NucleusTranslatorId.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/NucleusTranslatorId.java
similarity index 65%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/NucleusTranslatorId.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/NucleusTranslatorId.java
index 2ef77c8..ed22c4d 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/NucleusTranslatorId.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/NucleusTranslatorId.java
@@ -1,6 +1,6 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation;
-import gov.hhs.aspr.ms.taskit.core.TranslatorId;
+import gov.hhs.aspr.ms.taskit.core.translation.TranslatorId;
/**
* TranslatorId for the Nucleus Translator
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/DimensionTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/DimensionTranslationSpec.java
similarity index 50%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/DimensionTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/DimensionTranslationSpec.java
index e50d6c9..780199e 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/DimensionTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/DimensionTranslationSpec.java
@@ -1,19 +1,19 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.nucleus.Dimension;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.DimensionInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class DimensionTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected Dimension convertInputObject(DimensionInput inputObject) {
- return this.translationEngine.getObjectFromAny(inputObject.getDimension());
+ protected Dimension translateInputObject(DimensionInput inputObject) {
+ return this.taskitEngine.getObjectFromAny(inputObject.getDimension());
}
@Override
- protected DimensionInput convertAppObject(Dimension appObject) {
- return DimensionInput.newBuilder().setDimension(this.translationEngine.getAnyFromObject(appObject)).build();
+ protected DimensionInput translateAppObject(Dimension appObject) {
+ return DimensionInput.newBuilder().setDimension(this.taskitEngine.getAnyFromObject(appObject)).build();
}
@Override
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/ExperimentParameterDataTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/ExperimentParameterDataTranslationSpec.java
similarity index 85%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/ExperimentParameterDataTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/ExperimentParameterDataTranslationSpec.java
index 7a7bc5b..4a6ae70 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/ExperimentParameterDataTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/ExperimentParameterDataTranslationSpec.java
@@ -1,11 +1,11 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs;
import java.nio.file.Path;
import gov.hhs.aspr.ms.gcm.simulation.nucleus.ExperimentParameterData;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.ExperimentParameterDataInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
/**
@@ -17,9 +17,9 @@ public class ExperimentParameterDataTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected ExperimentParameterData convertInputObject(ExperimentParameterDataInput inputObject) {
+ protected ExperimentParameterData translateInputObject(ExperimentParameterDataInput inputObject) {
if (!ExperimentParameterData.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
ExperimentParameterData.Builder builder = ExperimentParameterData.builder()
@@ -44,7 +44,7 @@ protected ExperimentParameterData convertInputObject(ExperimentParameterDataInpu
}
@Override
- protected ExperimentParameterDataInput convertAppObject(ExperimentParameterData appObject) {
+ protected ExperimentParameterDataInput translateAppObject(ExperimentParameterData appObject) {
ExperimentParameterDataInput.Builder builder = ExperimentParameterDataInput.newBuilder()
.setThreadCount(appObject.getThreadCount())
.setStartRecordingIsScheduled(appObject.stateRecordingIsScheduled())
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/PlannerTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/PlannerTranslationSpec.java
similarity index 71%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/PlannerTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/PlannerTranslationSpec.java
index ead3384..fa7d5cc 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/PlannerTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/PlannerTranslationSpec.java
@@ -1,8 +1,8 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.nucleus.Planner;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.PlannerInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* TranslationSpec that defines how to convert between {@linkplain PlannerInput}
@@ -11,12 +11,12 @@
public class PlannerTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected Planner convertInputObject(PlannerInput inputObject) {
+ protected Planner translateInputObject(PlannerInput inputObject) {
return Planner.valueOf(inputObject.name());
}
@Override
- protected PlannerInput convertAppObject(Planner appObject) {
+ protected PlannerInput translateAppObject(Planner appObject) {
return PlannerInput.valueOf(appObject.name());
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/SimulationStateTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/SimulationStateTranslationSpec.java
similarity index 69%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/SimulationStateTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/SimulationStateTranslationSpec.java
index 87cc1c2..16e61b2 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translationSpecs/SimulationStateTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/nucleus/translation/specs/SimulationStateTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.translation.specs;
import java.time.LocalDate;
@@ -6,8 +6,8 @@
import gov.hhs.aspr.ms.gcm.simulation.nucleus.SimulationState;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.nucleus.input.SimulationStateInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
/**
@@ -17,9 +17,9 @@
public class SimulationStateTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected SimulationState convertInputObject(SimulationStateInput inputObject) {
+ protected SimulationState translateInputObject(SimulationStateInput inputObject) {
if (!SimulationState.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
SimulationState.Builder builder = SimulationState.builder();
@@ -27,7 +27,7 @@ protected SimulationState convertInputObject(SimulationStateInput inputObject) {
builder.setStartTime(inputObject.getStartTime());
if (inputObject.hasBaseDate()) {
- LocalDate LocalDate = this.translationEngine.convertObject(inputObject.getBaseDate());
+ LocalDate LocalDate = this.taskitEngine.translateObject(inputObject.getBaseDate());
builder.setBaseDate(LocalDate);
}
@@ -35,12 +35,12 @@ protected SimulationState convertInputObject(SimulationStateInput inputObject) {
}
@Override
- protected SimulationStateInput convertAppObject(SimulationState appObject) {
+ protected SimulationStateInput translateAppObject(SimulationState appObject) {
SimulationStateInput.Builder builder = SimulationStateInput.newBuilder()
.setStartTime(appObject.getStartTime())
.setVersion(appObject.getVersion());
- Date date = this.translationEngine.convertObject(appObject.getBaseDate());
+ Date date = this.taskitEngine.translateObject(appObject.getBaseDate());
builder.setBaseDate(date);
return builder.build();
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/GlobalPropertiesTranslator.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/GlobalPropertiesTranslator.java
similarity index 56%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/GlobalPropertiesTranslator.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/GlobalPropertiesTranslator.java
index 4fcbb88..107a692 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/GlobalPropertiesTranslator.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/GlobalPropertiesTranslator.java
@@ -1,31 +1,31 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation;
import java.util.ArrayList;
import java.util.List;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs.GlobalPropertiesPluginDataTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs.GlobalPropertyDimensionTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs.GlobalPropertyIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs.GlobalPropertyReportPluginDataTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs.TestGlobalPropertyIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.PropertiesTranslatorId;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.ReportsTranslatorId;
-import gov.hhs.aspr.ms.taskit.core.TranslationSpec;
-import gov.hhs.aspr.ms.taskit.core.Translator;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationEngine;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertiesPluginDataTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyDimensionTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.GlobalPropertyReportPluginDataTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs.TestGlobalPropertyIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.translation.PropertiesTranslatorId;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.translation.ReportsTranslatorId;
+import gov.hhs.aspr.ms.taskit.core.translation.Translator;
+import gov.hhs.aspr.ms.taskit.protobuf.engine.IProtobufTaskitEngineBuilder;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* Translator for the GlobalProperties Plugin. Using this Translator will add
- * all the necessary TanslationSpecs needed to read and write
- * the GlobalPropertiesPlugin
+ * all the necessary TranslationSpecs needed to read and write the
+ * GlobalPropertiesPlugin
*/
public class GlobalPropertiesTranslator {
private GlobalPropertiesTranslator() {
}
- protected static List> getTranslationSpecs() {
- List> list = new ArrayList<>();
+ protected static List> getTranslationSpecs() {
+ List> list = new ArrayList<>();
list.add(new GlobalPropertiesPluginDataTranslationSpec());
list.add(new GlobalPropertyIdTranslationSpec());
@@ -38,8 +38,8 @@ private GlobalPropertiesTranslator() {
/**
* Returns a Translator Builder that already includes the necessary
- * TranslationSpecs needed to read and write the GlobalPropertiesPluginData and its
- * respective reports
+ * TranslationSpecs needed to read and write the GlobalPropertiesPluginData and
+ * its respective reports
*/
private static Translator.Builder builder() {
@@ -48,11 +48,11 @@ private static Translator.Builder builder() {
.addDependency(PropertiesTranslatorId.TRANSLATOR_ID)
.addDependency(ReportsTranslatorId.TRANSLATOR_ID)
.setInitializer((translatorContext) -> {
- ProtobufTranslationEngine.Builder translationEngineBuilder = translatorContext
- .getTranslationEngineBuilder(ProtobufTranslationEngine.Builder.class);
+ IProtobufTaskitEngineBuilder taskitEngineBuilder = translatorContext
+ .getTaskitEngineBuilder(IProtobufTaskitEngineBuilder.class);
- for (TranslationSpec, ?> translationSpec : getTranslationSpecs()) {
- translationEngineBuilder.addTranslationSpec(translationSpec);
+ for (ProtobufTranslationSpec, ?> translationSpec : getTranslationSpecs()) {
+ taskitEngineBuilder.addTranslationSpec(translationSpec);
}
});
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/GlobalPropertiesTranslatorId.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/GlobalPropertiesTranslatorId.java
similarity index 81%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/GlobalPropertiesTranslatorId.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/GlobalPropertiesTranslatorId.java
index effe01f..6f95323 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/GlobalPropertiesTranslatorId.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/GlobalPropertiesTranslatorId.java
@@ -1,6 +1,6 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation;
-import gov.hhs.aspr.ms.taskit.core.TranslatorId;
+import gov.hhs.aspr.ms.taskit.core.translation.TranslatorId;
/**
* TranslatorId for the GlobalProperties Translator
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertiesPluginDataTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertiesPluginDataTranslationSpec.java
similarity index 75%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertiesPluginDataTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertiesPluginDataTranslationSpec.java
index 70ecd6a..94b9118 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertiesPluginDataTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertiesPluginDataTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs;
import com.google.protobuf.Any;
@@ -9,8 +9,8 @@
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyDefinitionInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyDefinitionMapInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyValueMapInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
/**
@@ -22,18 +22,18 @@ public class GlobalPropertiesPluginDataTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GlobalPropertiesPluginData convertInputObject(GlobalPropertiesPluginDataInput inputObject) {
+ protected GlobalPropertiesPluginData translateInputObject(GlobalPropertiesPluginDataInput inputObject) {
if (!GlobalPropertiesPluginData.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
GlobalPropertiesPluginData.Builder builder = GlobalPropertiesPluginData.builder();
for (PropertyDefinitionMapInput propertyDefinitionMapInput : inputObject.getGlobalPropertyDefinitinionsList()) {
- GlobalPropertyId propertyId = this.translationEngine
+ GlobalPropertyId propertyId = this.taskitEngine
.getObjectFromAny(propertyDefinitionMapInput.getPropertyId());
- PropertyDefinition propertyDefinition = this.translationEngine
- .convertObject(propertyDefinitionMapInput.getPropertyDefinition());
+ PropertyDefinition propertyDefinition = this.taskitEngine
+ .translateObject(propertyDefinitionMapInput.getPropertyDefinition());
builder.defineGlobalProperty(propertyId, propertyDefinition,
propertyDefinitionMapInput.getPropertyDefinitionTime());
@@ -41,9 +41,8 @@ protected GlobalPropertiesPluginData convertInputObject(GlobalPropertiesPluginDa
for (PropertyValueMapInput propertyValueMapInput : inputObject.getGlobalPropertyValuesList()) {
- GlobalPropertyId propertyId = this.translationEngine
- .getObjectFromAny(propertyValueMapInput.getPropertyId());
- Object value = this.translationEngine.getObjectFromAny(propertyValueMapInput.getPropertyValue());
+ GlobalPropertyId propertyId = this.taskitEngine.getObjectFromAny(propertyValueMapInput.getPropertyId());
+ Object value = this.taskitEngine.getObjectFromAny(propertyValueMapInput.getPropertyValue());
builder.setGlobalPropertyValue(propertyId, value, propertyValueMapInput.getPropertyValueTime());
}
@@ -52,7 +51,7 @@ protected GlobalPropertiesPluginData convertInputObject(GlobalPropertiesPluginDa
}
@Override
- protected GlobalPropertiesPluginDataInput convertAppObject(GlobalPropertiesPluginData appObject) {
+ protected GlobalPropertiesPluginDataInput translateAppObject(GlobalPropertiesPluginData appObject) {
GlobalPropertiesPluginDataInput.Builder builder = GlobalPropertiesPluginDataInput.newBuilder();
builder.setVersion(appObject.getVersion());
@@ -60,11 +59,11 @@ protected GlobalPropertiesPluginDataInput convertAppObject(GlobalPropertiesPlugi
for (GlobalPropertyId globalPropertyId : appObject.getGlobalPropertyDefinitions().keySet()) {
PropertyDefinition propertyDefinition = appObject.getGlobalPropertyDefinition(globalPropertyId);
- PropertyDefinitionInput propertyDefinitionInput = this.translationEngine.convertObject(propertyDefinition);
+ PropertyDefinitionInput propertyDefinitionInput = this.taskitEngine.translateObject(propertyDefinition);
PropertyDefinitionMapInput propertyDefinitionMapInput = PropertyDefinitionMapInput.newBuilder()
.setPropertyDefinition(propertyDefinitionInput)
- .setPropertyId(this.translationEngine.getAnyFromObject(globalPropertyId))
+ .setPropertyId(this.taskitEngine.getAnyFromObject(globalPropertyId))
.setPropertyDefinitionTime(appObject.getGlobalPropertyDefinitionTime(globalPropertyId))
.setPropertyTrackingPolicy(true)
.build();
@@ -73,11 +72,11 @@ protected GlobalPropertiesPluginDataInput convertAppObject(GlobalPropertiesPlugi
}
for (GlobalPropertyId globalPropertyId : appObject.getGlobalPropertyValues().keySet()) {
- Any propertyValueInput = this.translationEngine
+ Any propertyValueInput = this.taskitEngine
.getAnyFromObject(appObject.getGlobalPropertyValue(globalPropertyId).get());
PropertyValueMapInput.Builder propertyValueMapInputBuilder = PropertyValueMapInput.newBuilder()
- .setPropertyId(this.translationEngine.getAnyFromObject(globalPropertyId))
+ .setPropertyId(this.taskitEngine.getAnyFromObject(globalPropertyId))
.setPropertyValue(propertyValueInput)
.setPropertyValueTime(appObject.getGlobalPropertyTime(globalPropertyId).get());
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyDimensionTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyDimensionTranslationSpec.java
similarity index 68%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyDimensionTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyDimensionTranslationSpec.java
index 24d1514..176406a 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyDimensionTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyDimensionTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs;
import com.google.protobuf.Any;
@@ -6,21 +6,21 @@
import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.support.GlobalPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.support.input.GlobalPropertyDimensionInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.support.input.GlobalPropertyIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class GlobalPropertyDimensionTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GlobalPropertyDimension convertInputObject(GlobalPropertyDimensionInput inputObject) {
+ protected GlobalPropertyDimension translateInputObject(GlobalPropertyDimensionInput inputObject) {
GlobalPropertyDimension.Builder builder = GlobalPropertyDimension.builder();
- GlobalPropertyId globalPropertyId = this.translationEngine.convertObject(inputObject.getGlobalPropertyId());
+ GlobalPropertyId globalPropertyId = this.taskitEngine.translateObject(inputObject.getGlobalPropertyId());
builder.setGlobalPropertyId(globalPropertyId).setAssignmentTime(inputObject.getAssignmentTime());
for (Any anyValue : inputObject.getValuesList()) {
- Object value = this.translationEngine.getObjectFromAny(anyValue);
+ Object value = this.taskitEngine.getObjectFromAny(anyValue);
builder.addValue(value);
}
@@ -28,16 +28,16 @@ protected GlobalPropertyDimension convertInputObject(GlobalPropertyDimensionInpu
}
@Override
- protected GlobalPropertyDimensionInput convertAppObject(GlobalPropertyDimension appObject) {
+ protected GlobalPropertyDimensionInput translateAppObject(GlobalPropertyDimension appObject) {
GlobalPropertyDimensionInput.Builder builder = GlobalPropertyDimensionInput.newBuilder();
- GlobalPropertyIdInput globalPropertyIdInput = this.translationEngine
- .convertObjectAsSafeClass(appObject.getGlobalPropertyId(), GlobalPropertyId.class);
+ GlobalPropertyIdInput globalPropertyIdInput = this.taskitEngine
+ .translateObjectAsClassSafe(appObject.getGlobalPropertyId(), GlobalPropertyId.class);
builder.setGlobalPropertyId(globalPropertyIdInput).setAssignmentTime(appObject.getAssignmentTime());
for (Object objValue : appObject.getValues()) {
- builder.addValues(this.translationEngine.getAnyFromObject(objValue));
+ builder.addValues(this.taskitEngine.getAnyFromObject(objValue));
}
return builder.build();
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyIdTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyIdTranslationSpec.java
similarity index 63%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyIdTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyIdTranslationSpec.java
index ac0a2fb..17ffad8 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyIdTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyIdTranslationSpec.java
@@ -1,8 +1,8 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.support.GlobalPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.support.input.GlobalPropertyIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* TranslationSpec that defines how to convert between
@@ -11,13 +11,13 @@
public class GlobalPropertyIdTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected GlobalPropertyId convertInputObject(GlobalPropertyIdInput inputObject) {
- return this.translationEngine.getObjectFromAny(inputObject.getId());
+ protected GlobalPropertyId translateInputObject(GlobalPropertyIdInput inputObject) {
+ return this.taskitEngine.getObjectFromAny(inputObject.getId());
}
@Override
- protected GlobalPropertyIdInput convertAppObject(GlobalPropertyId appObject) {
- return GlobalPropertyIdInput.newBuilder().setId(this.translationEngine.getAnyFromObject(appObject)).build();
+ protected GlobalPropertyIdInput translateAppObject(GlobalPropertyId appObject) {
+ return GlobalPropertyIdInput.newBuilder().setId(this.taskitEngine.getAnyFromObject(appObject)).build();
}
@Override
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyReportPluginDataTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyReportPluginDataTranslationSpec.java
similarity index 72%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyReportPluginDataTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyReportPluginDataTranslationSpec.java
index 0cd322f..385d92a 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/GlobalPropertyReportPluginDataTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/GlobalPropertyReportPluginDataTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.reports.GlobalPropertyReportPluginData;
import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.support.GlobalPropertyId;
@@ -6,8 +6,8 @@
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.reports.input.GlobalPropertyReportPluginDataInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.support.input.GlobalPropertyIdInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.support.input.ReportLabelInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
/**
@@ -19,25 +19,25 @@ public class GlobalPropertyReportPluginDataTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GlobalPropertyReportPluginData convertInputObject(GlobalPropertyReportPluginDataInput inputObject) {
+ protected GlobalPropertyReportPluginData translateInputObject(GlobalPropertyReportPluginDataInput inputObject) {
if (!GlobalPropertyReportPluginData.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
GlobalPropertyReportPluginData.Builder builder = GlobalPropertyReportPluginData.builder();
- ReportLabel reportLabel = this.translationEngine.convertObject(inputObject.getReportLabel());
+ ReportLabel reportLabel = this.taskitEngine.translateObject(inputObject.getReportLabel());
builder.setReportLabel(reportLabel);
builder.setDefaultInclusion(inputObject.getDefaultInclusionPolicy());
for (GlobalPropertyIdInput globalPropertyIdInput : inputObject.getIncludedPropertiesList()) {
- GlobalPropertyId globalPropertyId = this.translationEngine.convertObject(globalPropertyIdInput);
+ GlobalPropertyId globalPropertyId = this.taskitEngine.translateObject(globalPropertyIdInput);
builder.includeGlobalProperty(globalPropertyId);
}
for (GlobalPropertyIdInput globalPropertyIdInput : inputObject.getExcludedPropertiesList()) {
- GlobalPropertyId globalPropertyId = this.translationEngine.convertObject(globalPropertyIdInput);
+ GlobalPropertyId globalPropertyId = this.taskitEngine.translateObject(globalPropertyIdInput);
builder.excludeGlobalProperty(globalPropertyId);
}
@@ -45,25 +45,25 @@ protected GlobalPropertyReportPluginData convertInputObject(GlobalPropertyReport
}
@Override
- protected GlobalPropertyReportPluginDataInput convertAppObject(GlobalPropertyReportPluginData appObject) {
+ protected GlobalPropertyReportPluginDataInput translateAppObject(GlobalPropertyReportPluginData appObject) {
GlobalPropertyReportPluginDataInput.Builder builder = GlobalPropertyReportPluginDataInput.newBuilder();
builder.setVersion(appObject.getVersion());
- ReportLabelInput reportLabelInput = this.translationEngine.convertObjectAsSafeClass(appObject.getReportLabel(),
+ ReportLabelInput reportLabelInput = this.taskitEngine.translateObjectAsClassSafe(appObject.getReportLabel(),
ReportLabel.class);
builder.setDefaultInclusionPolicy(appObject.getDefaultInclusionPolicy()).setReportLabel(reportLabelInput);
for (GlobalPropertyId globalPropertyId : appObject.getIncludedProperties()) {
- GlobalPropertyIdInput globalPropertyIdInput = this.translationEngine
- .convertObjectAsSafeClass(globalPropertyId, GlobalPropertyId.class);
+ GlobalPropertyIdInput globalPropertyIdInput = this.taskitEngine.translateObjectAsClassSafe(globalPropertyId,
+ GlobalPropertyId.class);
builder.addIncludedProperties(globalPropertyIdInput);
}
for (GlobalPropertyId globalPropertyId : appObject.getExcludedProperties()) {
- GlobalPropertyIdInput globalPropertyIdInput = this.translationEngine
- .convertObjectAsSafeClass(globalPropertyId, GlobalPropertyId.class);
+ GlobalPropertyIdInput globalPropertyIdInput = this.taskitEngine.translateObjectAsClassSafe(globalPropertyId,
+ GlobalPropertyId.class);
builder.addExcludedProperties(globalPropertyIdInput);
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/TestGlobalPropertyIdTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/TestGlobalPropertyIdTranslationSpec.java
similarity index 77%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/TestGlobalPropertyIdTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/TestGlobalPropertyIdTranslationSpec.java
index e93d8d6..5ad1fa4 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translationSpecs/TestGlobalPropertyIdTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/globalproperties/translation/specs/TestGlobalPropertyIdTranslationSpec.java
@@ -1,8 +1,8 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.globalproperties.testsupport.TestGlobalPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.globalproperties.testsupport.input.TestGlobalPropertyIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* TranslationSpec that defines how to convert between
@@ -12,12 +12,12 @@ public class TestGlobalPropertyIdTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected TestGlobalPropertyId convertInputObject(TestGlobalPropertyIdInput inputObject) {
+ protected TestGlobalPropertyId translateInputObject(TestGlobalPropertyIdInput inputObject) {
return TestGlobalPropertyId.valueOf(inputObject.name());
}
@Override
- protected TestGlobalPropertyIdInput convertAppObject(TestGlobalPropertyId appObject) {
+ protected TestGlobalPropertyIdInput translateAppObject(TestGlobalPropertyId appObject) {
return TestGlobalPropertyIdInput.valueOf(appObject.name());
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/GroupsTranslator.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/GroupsTranslator.java
similarity index 56%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/GroupsTranslator.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/GroupsTranslator.java
index 3f76cd2..7351c8e 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/GroupsTranslator.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/GroupsTranslator.java
@@ -1,40 +1,41 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation;
import java.util.ArrayList;
import java.util.List;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupIdInput;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupMemberFilterTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupPopulationReportPluginDataTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupPropertyDimensionTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupPropertyIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupPropertyReportPluginDataTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupTypeIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupTypesForPersonFilterTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupsForPersonAndGroupTypeFilterTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupsForPersonFilterTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.GroupsPluginDataTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.TestGroupPropertyIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs.TestGroupTypeIdTranslationSpec;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.people.PeopleTranslatorId;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.PropertiesTranslatorId;
-import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.ReportsTranslatorId;
-import gov.hhs.aspr.ms.taskit.core.TranslationSpec;
-import gov.hhs.aspr.ms.taskit.core.Translator;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationEngine;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupMemberFilterTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupPopulationReportPluginDataTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupPropertyDimensionTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupPropertyIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupPropertyReportPluginDataTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupTypeIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupTypesForPersonFilterTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupsForPersonAndGroupTypeFilterTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupsForPersonFilterTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.GroupsPluginDataTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.TestGroupPropertyIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs.TestGroupTypeIdTranslationSpec;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.people.translation.PeopleTranslatorId;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.translation.PropertiesTranslatorId;
+import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.translation.ReportsTranslatorId;
+import gov.hhs.aspr.ms.taskit.core.translation.Translator;
+import gov.hhs.aspr.ms.taskit.protobuf.engine.IProtobufTaskitEngineBuilder;
+import gov.hhs.aspr.ms.taskit.protobuf.engine.ProtobufJsonTaskitEngine;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* Translator for the Groups Plugin. Using this Translator will add all the
- * necessary TanslationSpecs needed to read and write the GroupsPlugin.
+ * necessary TranslationSpecs needed to read and write the GroupsPlugin.
*/
public class GroupsTranslator {
private GroupsTranslator() {
}
- protected static List> getTranslationSpecs() {
- List> list = new ArrayList<>();
+ protected static List> getTranslationSpecs() {
+ List> list = new ArrayList<>();
list.add(new GroupsPluginDataTranslationSpec());
list.add(new GroupIdTranslationSpec());
@@ -64,23 +65,24 @@ private static Translator.Builder builder() {
.addDependency(PeopleTranslatorId.TRANSLATOR_ID)
.addDependency(ReportsTranslatorId.TRANSLATOR_ID)
.setInitializer((translatorContext) -> {
- ProtobufTranslationEngine.Builder translationEngineBuilder = translatorContext
- .getTranslationEngineBuilder(ProtobufTranslationEngine.Builder.class);
+ IProtobufTaskitEngineBuilder taskitEngineBuilder = translatorContext
+ .getTaskitEngineBuilder(IProtobufTaskitEngineBuilder.class);
- for (TranslationSpec, ?> translationSpec : getTranslationSpecs()) {
- translationEngineBuilder.addTranslationSpec(translationSpec);
+ for (ProtobufTranslationSpec, ?> translationSpec : getTranslationSpecs()) {
+ taskitEngineBuilder.addTranslationSpec(translationSpec);
}
- translationEngineBuilder
- .addFieldToIncludeDefaultValue(GroupIdInput.getDescriptor().findFieldByName("id"));
+ if (taskitEngineBuilder instanceof ProtobufJsonTaskitEngine.Builder) {
+ ((ProtobufJsonTaskitEngine.Builder) taskitEngineBuilder)
+ .addFieldToIncludeDefaultValue(GroupIdInput.getDescriptor().findFieldByName("id"));
+ }
});
return builder;
}
/**
- * Returns a Translator that includes TranslationSpecs for the
- * GroupsPlugin.
+ * Returns a Translator that includes TranslationSpecs for the GroupsPlugin.
*/
public static Translator getTranslator() {
return builder().build();
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/GroupsTranslatorId.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/GroupsTranslatorId.java
similarity index 63%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/GroupsTranslatorId.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/GroupsTranslatorId.java
index 3791448..15d9a67 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/GroupsTranslatorId.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/GroupsTranslatorId.java
@@ -1,6 +1,6 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation;
-import gov.hhs.aspr.ms.taskit.core.TranslatorId;
+import gov.hhs.aspr.ms.taskit.core.translation.TranslatorId;
/**
* TranslatorId for the Groups Translator
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupIdTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupIdTranslationSpec.java
similarity index 78%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupIdTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupIdTranslationSpec.java
index 84940fb..1159978 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupIdTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupIdTranslationSpec.java
@@ -1,8 +1,8 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* TranslationSpec that defines how to convert between {@linkplain GroupIdInput}
@@ -11,12 +11,12 @@
public class GroupIdTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected GroupId convertInputObject(GroupIdInput inputObject) {
+ protected GroupId translateInputObject(GroupIdInput inputObject) {
return new GroupId(inputObject.getId());
}
@Override
- protected GroupIdInput convertAppObject(GroupId appObject) {
+ protected GroupIdInput translateAppObject(GroupId appObject) {
return GroupIdInput.newBuilder().setId(appObject.getValue()).build();
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupMemberFilterTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupMemberFilterTranslationSpec.java
similarity index 77%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupMemberFilterTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupMemberFilterTranslationSpec.java
index d60fb3a..5b930c6 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupMemberFilterTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupMemberFilterTranslationSpec.java
@@ -1,20 +1,20 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupId;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupMemberFilter;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupMemberFilterInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class GroupMemberFilterTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupMemberFilter convertInputObject(GroupMemberFilterInput inputObject) {
+ protected GroupMemberFilter translateInputObject(GroupMemberFilterInput inputObject) {
return new GroupMemberFilter(new GroupId(inputObject.getGId()));
}
@Override
- protected GroupMemberFilterInput convertAppObject(GroupMemberFilter appObject) {
+ protected GroupMemberFilterInput translateAppObject(GroupMemberFilter appObject) {
return GroupMemberFilterInput.newBuilder().setGId(appObject.getGroupId().getValue()).build();
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPopulationReportPluginDataTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPopulationReportPluginDataTranslationSpec.java
similarity index 59%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPopulationReportPluginDataTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPopulationReportPluginDataTranslationSpec.java
index 2d985e4..fa03f1e 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPopulationReportPluginDataTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPopulationReportPluginDataTranslationSpec.java
@@ -1,34 +1,34 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.reports.GroupPopulationReportPluginData;
import gov.hhs.aspr.ms.gcm.simulation.plugins.reports.support.ReportLabel;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.reports.input.GroupPopulationReportPluginDataInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.support.input.ReportLabelInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
public class GroupPopulationReportPluginDataTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupPopulationReportPluginData convertInputObject(GroupPopulationReportPluginDataInput inputObject) {
+ protected GroupPopulationReportPluginData translateInputObject(GroupPopulationReportPluginDataInput inputObject) {
if (!GroupPopulationReportPluginData.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
return GroupPopulationReportPluginData.builder()
- .setReportLabel(this.translationEngine.convertObject(inputObject.getReportLabel()))
- .setReportPeriod(this.translationEngine.convertObject(inputObject.getReportPeriod()))
+ .setReportLabel(this.taskitEngine.translateObject(inputObject.getReportLabel()))
+ .setReportPeriod(this.taskitEngine.translateObject(inputObject.getReportPeriod()))
.build();
}
@Override
- protected GroupPopulationReportPluginDataInput convertAppObject(GroupPopulationReportPluginData appObject) {
+ protected GroupPopulationReportPluginDataInput translateAppObject(GroupPopulationReportPluginData appObject) {
return GroupPopulationReportPluginDataInput.newBuilder()
- .setReportLabel((ReportLabelInput) this.translationEngine
- .convertObjectAsSafeClass(appObject.getReportLabel(), ReportLabel.class))
- .setReportPeriod(this.translationEngine.convertObject(appObject.getReportPeriod()))
+ .setReportLabel((ReportLabelInput) this.taskitEngine
+ .translateObjectAsClassSafe(appObject.getReportLabel(), ReportLabel.class))
+ .setReportPeriod(this.taskitEngine.translateObject(appObject.getReportPeriod()))
.setVersion(appObject.getVersion())
.build();
}
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyDimensionTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyDimensionTranslationSpec.java
similarity index 69%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyDimensionTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyDimensionTranslationSpec.java
index a1862b0..7bf3517 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyDimensionTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyDimensionTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import com.google.protobuf.Any;
@@ -7,22 +7,22 @@
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyDimensionInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class GroupPropertyDimensionTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupPropertyDimension convertInputObject(GroupPropertyDimensionInput inputObject) {
+ protected GroupPropertyDimension translateInputObject(GroupPropertyDimensionInput inputObject) {
GroupPropertyDimension.Builder builder = GroupPropertyDimension.builder();
- GroupPropertyId globalPropertyId = this.translationEngine.convertObject(inputObject.getGroupPropertyId());
+ GroupPropertyId globalPropertyId = this.taskitEngine.translateObject(inputObject.getGroupPropertyId());
GroupId groupId = new GroupId(inputObject.getGId());
builder.setGroupPropertyId(globalPropertyId).setGroupId(groupId);
for (Any anyValue : inputObject.getValuesList()) {
- Object value = this.translationEngine.getObjectFromAny(anyValue);
+ Object value = this.taskitEngine.getObjectFromAny(anyValue);
builder.addValue(value);
}
@@ -30,16 +30,16 @@ protected GroupPropertyDimension convertInputObject(GroupPropertyDimensionInput
}
@Override
- protected GroupPropertyDimensionInput convertAppObject(GroupPropertyDimension appObject) {
+ protected GroupPropertyDimensionInput translateAppObject(GroupPropertyDimension appObject) {
GroupPropertyDimensionInput.Builder builder = GroupPropertyDimensionInput.newBuilder();
- GroupPropertyIdInput globalPropertyIdInput = this.translationEngine
- .convertObjectAsSafeClass(appObject.getGroupPropertyId(), GroupPropertyId.class);
+ GroupPropertyIdInput globalPropertyIdInput = this.taskitEngine
+ .translateObjectAsClassSafe(appObject.getGroupPropertyId(), GroupPropertyId.class);
builder.setGroupPropertyId(globalPropertyIdInput).setGId(appObject.getGroupId().getValue());
for (Object objValue : appObject.getValues()) {
- builder.addValues(this.translationEngine.getAnyFromObject(objValue));
+ builder.addValues(this.taskitEngine.getAnyFromObject(objValue));
}
return builder.build();
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyIdTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyIdTranslationSpec.java
similarity index 63%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyIdTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyIdTranslationSpec.java
index bd901fb..14c7119 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyIdTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyIdTranslationSpec.java
@@ -1,8 +1,8 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* TranslationSpec that defines how to convert between
@@ -11,13 +11,13 @@
public class GroupPropertyIdTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected GroupPropertyId convertInputObject(GroupPropertyIdInput inputObject) {
- return this.translationEngine.getObjectFromAny(inputObject.getId());
+ protected GroupPropertyId translateInputObject(GroupPropertyIdInput inputObject) {
+ return this.taskitEngine.getObjectFromAny(inputObject.getId());
}
@Override
- protected GroupPropertyIdInput convertAppObject(GroupPropertyId appObject) {
- return GroupPropertyIdInput.newBuilder().setId(this.translationEngine.getAnyFromObject(appObject)).build();
+ protected GroupPropertyIdInput translateAppObject(GroupPropertyId appObject) {
+ return GroupPropertyIdInput.newBuilder().setId(this.taskitEngine.getAnyFromObject(appObject)).build();
}
@Override
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyReportPluginDataTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyReportPluginDataTranslationSpec.java
similarity index 71%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyReportPluginDataTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyReportPluginDataTranslationSpec.java
index ac00209..66f1a9d 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupPropertyReportPluginDataTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupPropertyReportPluginDataTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.reports.GroupPropertyReportPluginData;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyId;
@@ -9,8 +9,8 @@
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupPropertyIdInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupTypeIdInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.reports.support.input.ReportLabelInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
/**
@@ -22,32 +22,32 @@ public class GroupPropertyReportPluginDataTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupPropertyReportPluginData convertInputObject(GroupPropertyReportPluginDataInput inputObject) {
+ protected GroupPropertyReportPluginData translateInputObject(GroupPropertyReportPluginDataInput inputObject) {
if (!GroupPropertyReportPluginData.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
GroupPropertyReportPluginData.Builder builder = GroupPropertyReportPluginData.builder();
- ReportLabel reportLabel = this.translationEngine.convertObject(inputObject.getReportLabel());
+ ReportLabel reportLabel = this.taskitEngine.translateObject(inputObject.getReportLabel());
builder.setReportLabel(reportLabel);
builder.setDefaultInclusion(inputObject.getDefaultInclusionPolicy());
- builder.setReportPeriod(this.translationEngine.convertObject(inputObject.getReportPeriod()));
+ builder.setReportPeriod(this.taskitEngine.translateObject(inputObject.getReportPeriod()));
for (GroupPropertyReportPropertyMap propertyMap : inputObject.getIncludedPropertiesList()) {
- GroupTypeId groupTypeId = this.translationEngine.convertObject(propertyMap.getGroupTypeId());
+ GroupTypeId groupTypeId = this.taskitEngine.translateObject(propertyMap.getGroupTypeId());
for (GroupPropertyIdInput groupPropertyIdInput : propertyMap.getGroupPropertiesList()) {
- GroupPropertyId groupPropertyId = this.translationEngine.convertObject(groupPropertyIdInput);
+ GroupPropertyId groupPropertyId = this.taskitEngine.translateObject(groupPropertyIdInput);
builder.includeGroupProperty(groupTypeId, groupPropertyId);
}
}
for (GroupPropertyReportPropertyMap propertyMap : inputObject.getExcludedPropertiesList()) {
- GroupTypeId groupTypeId = this.translationEngine.convertObject(propertyMap.getGroupTypeId());
+ GroupTypeId groupTypeId = this.taskitEngine.translateObject(propertyMap.getGroupTypeId());
for (GroupPropertyIdInput groupPropertyIdInput : propertyMap.getGroupPropertiesList()) {
- GroupPropertyId groupPropertyId = this.translationEngine.convertObject(groupPropertyIdInput);
+ GroupPropertyId groupPropertyId = this.taskitEngine.translateObject(groupPropertyIdInput);
builder.excludeGroupProperty(groupTypeId, groupPropertyId);
}
@@ -57,36 +57,36 @@ protected GroupPropertyReportPluginData convertInputObject(GroupPropertyReportPl
}
@Override
- protected GroupPropertyReportPluginDataInput convertAppObject(GroupPropertyReportPluginData appObject) {
+ protected GroupPropertyReportPluginDataInput translateAppObject(GroupPropertyReportPluginData appObject) {
GroupPropertyReportPluginDataInput.Builder builder = GroupPropertyReportPluginDataInput.newBuilder();
builder.setVersion(appObject.getVersion());
- ReportLabelInput reportLabelInput = this.translationEngine.convertObjectAsSafeClass(appObject.getReportLabel(),
+ ReportLabelInput reportLabelInput = this.taskitEngine.translateObjectAsClassSafe(appObject.getReportLabel(),
ReportLabel.class);
builder.setDefaultInclusionPolicy(appObject.getDefaultInclusionPolicy())
.setReportLabel(reportLabelInput)
- .setReportPeriod(this.translationEngine.convertObject(appObject.getReportPeriod()));
+ .setReportPeriod(this.taskitEngine.translateObject(appObject.getReportPeriod()));
for (GroupTypeId groupTypeId : appObject.getGroupTypeIds()) {
- GroupTypeIdInput groupTypeIdInput = this.translationEngine.convertObjectAsSafeClass(groupTypeId,
+ GroupTypeIdInput groupTypeIdInput = this.taskitEngine.translateObjectAsClassSafe(groupTypeId,
GroupTypeId.class);
GroupPropertyReportPropertyMap.Builder groupPropertyReportBuilder = GroupPropertyReportPropertyMap
.newBuilder()
.setGroupTypeId(groupTypeIdInput);
for (GroupPropertyId groupPropertyId : appObject.getIncludedProperties(groupTypeId)) {
- GroupPropertyIdInput groupPropertyIdInput = this.translationEngine
- .convertObjectAsSafeClass(groupPropertyId, GroupPropertyId.class);
+ GroupPropertyIdInput groupPropertyIdInput = this.taskitEngine
+ .translateObjectAsClassSafe(groupPropertyId, GroupPropertyId.class);
groupPropertyReportBuilder.addGroupProperties(groupPropertyIdInput);
}
builder.addIncludedProperties(groupPropertyReportBuilder.build());
groupPropertyReportBuilder = GroupPropertyReportPropertyMap.newBuilder().setGroupTypeId(groupTypeIdInput);
for (GroupPropertyId groupPropertyId : appObject.getExcludedProperties(groupTypeId)) {
- GroupPropertyIdInput groupPropertyIdInput = this.translationEngine
- .convertObjectAsSafeClass(groupPropertyId, GroupPropertyId.class);
+ GroupPropertyIdInput groupPropertyIdInput = this.taskitEngine
+ .translateObjectAsClassSafe(groupPropertyId, GroupPropertyId.class);
groupPropertyReportBuilder.addGroupProperties(groupPropertyIdInput);
}
builder.addExcludedProperties(groupPropertyReportBuilder.build());
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupTypeIdTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupTypeIdTranslationSpec.java
similarity index 63%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupTypeIdTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupTypeIdTranslationSpec.java
index 6b7d247..6af6c9e 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupTypeIdTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupTypeIdTranslationSpec.java
@@ -1,8 +1,8 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupTypeId;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupTypeIdInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
/**
* TranslationSpec that defines how to convert between
@@ -11,13 +11,13 @@
public class GroupTypeIdTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected GroupTypeId convertInputObject(GroupTypeIdInput inputObject) {
- return this.translationEngine.getObjectFromAny(inputObject.getId());
+ protected GroupTypeId translateInputObject(GroupTypeIdInput inputObject) {
+ return this.taskitEngine.getObjectFromAny(inputObject.getId());
}
@Override
- protected GroupTypeIdInput convertAppObject(GroupTypeId appObject) {
- return GroupTypeIdInput.newBuilder().setId(this.translationEngine.getAnyFromObject(appObject)).build();
+ protected GroupTypeIdInput translateAppObject(GroupTypeId appObject) {
+ return GroupTypeIdInput.newBuilder().setId(this.taskitEngine.getAnyFromObject(appObject)).build();
}
@Override
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupTypesForPersonFilterTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupTypesForPersonFilterTranslationSpec.java
similarity index 71%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupTypesForPersonFilterTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupTypesForPersonFilterTranslationSpec.java
index 993bd83..bdffe54 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupTypesForPersonFilterTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupTypesForPersonFilterTranslationSpec.java
@@ -1,26 +1,25 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupTypesForPersonFilter;
import gov.hhs.aspr.ms.gcm.simulation.plugins.partitions.support.Equality;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupTypesForPersonFilterInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.partitions.support.input.EqualityInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class GroupTypesForPersonFilterTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupTypesForPersonFilter convertInputObject(GroupTypesForPersonFilterInput inputObject) {
- Equality equality = this.translationEngine.convertObject(inputObject.getEquality());
+ protected GroupTypesForPersonFilter translateInputObject(GroupTypesForPersonFilterInput inputObject) {
+ Equality equality = this.taskitEngine.translateObject(inputObject.getEquality());
int groupTypeCount = inputObject.getGroupTypeCount();
return new GroupTypesForPersonFilter(equality, groupTypeCount);
}
@Override
- protected GroupTypesForPersonFilterInput convertAppObject(GroupTypesForPersonFilter appObject) {
- EqualityInput equality = this.translationEngine.convertObjectAsSafeClass(appObject.getEquality(),
- Equality.class);
+ protected GroupTypesForPersonFilterInput translateAppObject(GroupTypesForPersonFilter appObject) {
+ EqualityInput equality = this.taskitEngine.translateObjectAsClassSafe(appObject.getEquality(), Equality.class);
int groupTypeCount = appObject.getGroupTypeCount();
return GroupTypesForPersonFilterInput.newBuilder()
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsForPersonAndGroupTypeFilterTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsForPersonAndGroupTypeFilterTranslationSpec.java
similarity index 68%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsForPersonAndGroupTypeFilterTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsForPersonAndGroupTypeFilterTranslationSpec.java
index 16033d9..d9230fb 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsForPersonAndGroupTypeFilterTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsForPersonAndGroupTypeFilterTranslationSpec.java
@@ -1,4 +1,4 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupTypeId;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupsForPersonAndGroupTypeFilter;
@@ -6,25 +6,26 @@
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupTypeIdInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupsForPersonAndGroupTypeFilterInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.partitions.support.input.EqualityInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class GroupsForPersonAndGroupTypeFilterTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupsForPersonAndGroupTypeFilter convertInputObject(GroupsForPersonAndGroupTypeFilterInput inputObject) {
- GroupTypeId groupTypeId = this.translationEngine.convertObject(inputObject.getGroupTypeId());
- Equality equality = this.translationEngine.convertObject(inputObject.getEquality());
+ protected GroupsForPersonAndGroupTypeFilter translateInputObject(
+ GroupsForPersonAndGroupTypeFilterInput inputObject) {
+ GroupTypeId groupTypeId = this.taskitEngine.translateObject(inputObject.getGroupTypeId());
+ Equality equality = this.taskitEngine.translateObject(inputObject.getEquality());
int groupCount = inputObject.getGroupCount();
return new GroupsForPersonAndGroupTypeFilter(groupTypeId, equality, groupCount);
}
@Override
- protected GroupsForPersonAndGroupTypeFilterInput convertAppObject(GroupsForPersonAndGroupTypeFilter appObject) {
- GroupTypeIdInput groupTypeIdInput = this.translationEngine.convertObjectAsSafeClass(appObject.getGroupTypeId(),
+ protected GroupsForPersonAndGroupTypeFilterInput translateAppObject(GroupsForPersonAndGroupTypeFilter appObject) {
+ GroupTypeIdInput groupTypeIdInput = this.taskitEngine.translateObjectAsClassSafe(appObject.getGroupTypeId(),
GroupTypeId.class);
- EqualityInput equalityInput = this.translationEngine.convertObjectAsSafeClass(appObject.getEquality(),
+ EqualityInput equalityInput = this.taskitEngine.translateObjectAsClassSafe(appObject.getEquality(),
Equality.class);
int groupCount = appObject.getGroupCount();
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsForPersonFilterTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsForPersonFilterTranslationSpec.java
similarity index 71%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsForPersonFilterTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsForPersonFilterTranslationSpec.java
index a21ebb0..03772a4 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsForPersonFilterTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsForPersonFilterTranslationSpec.java
@@ -1,25 +1,25 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupsForPersonFilter;
import gov.hhs.aspr.ms.gcm.simulation.plugins.partitions.support.Equality;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.support.input.GroupsForPersonFilterInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.partitions.support.input.EqualityInput;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
public class GroupsForPersonFilterTranslationSpec
extends ProtobufTranslationSpec {
@Override
- protected GroupsForPersonFilter convertInputObject(GroupsForPersonFilterInput inputObject) {
- Equality equality = this.translationEngine.convertObject(inputObject.getEquality());
+ protected GroupsForPersonFilter translateInputObject(GroupsForPersonFilterInput inputObject) {
+ Equality equality = this.taskitEngine.translateObject(inputObject.getEquality());
int groupCount = inputObject.getGroupCount();
return new GroupsForPersonFilter(equality, groupCount);
}
@Override
- protected GroupsForPersonFilterInput convertAppObject(GroupsForPersonFilter appObject) {
- EqualityInput equalityInput = this.translationEngine.convertObjectAsSafeClass(appObject.getEquality(),
+ protected GroupsForPersonFilterInput translateAppObject(GroupsForPersonFilter appObject) {
+ EqualityInput equalityInput = this.taskitEngine.translateObjectAsClassSafe(appObject.getEquality(),
Equality.class);
int groupCount = appObject.getGroupCount();
diff --git a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsPluginDataTranslationSpec.java b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsPluginDataTranslationSpec.java
similarity index 75%
rename from protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsPluginDataTranslationSpec.java
rename to protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsPluginDataTranslationSpec.java
index 1ff237b..54e52c0 100644
--- a/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translationSpecs/GroupsPluginDataTranslationSpec.java
+++ b/protobuf/src/main/java/gov/hhs/aspr/ms/gcm/taskit/protobuf/plugins/groups/translation/specs/GroupsPluginDataTranslationSpec.java
@@ -1,7 +1,9 @@
-package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translationSpecs;
+package gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.groups.translation.specs;
import java.util.*;
+import com.google.protobuf.Any;
+
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.datamanagers.GroupsPluginData;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupId;
import gov.hhs.aspr.ms.gcm.simulation.plugins.groups.support.GroupPropertyId;
@@ -19,8 +21,8 @@
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyDefinitionInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyDefinitionMapInput;
import gov.hhs.aspr.ms.gcm.taskit.protobuf.plugins.properties.support.input.PropertyValueMapInput;
-import gov.hhs.aspr.ms.taskit.core.CoreTranslationError;
-import gov.hhs.aspr.ms.taskit.protobuf.ProtobufTranslationSpec;
+import gov.hhs.aspr.ms.taskit.core.engine.TaskitError;
+import gov.hhs.aspr.ms.taskit.protobuf.translation.ProtobufTranslationSpec;
import gov.hhs.aspr.ms.util.errors.ContractException;
/**
@@ -30,16 +32,16 @@
public class GroupsPluginDataTranslationSpec extends ProtobufTranslationSpec {
@Override
- protected GroupsPluginData convertInputObject(GroupsPluginDataInput inputObject) {
+ protected GroupsPluginData translateInputObject(GroupsPluginDataInput inputObject) {
if (!GroupsPluginData.checkVersionSupported(inputObject.getVersion())) {
- throw new ContractException(CoreTranslationError.UNSUPPORTED_VERSION);
+ throw new ContractException(TaskitError.UNSUPPORTED_VERSION);
}
GroupsPluginData.Builder builder = GroupsPluginData.builder();
// Add groups
for (GroupInput groupInput : inputObject.getGroupsList()) {
- GroupTypeId groupTypeId = this.translationEngine.convertObject(groupInput.getGroupTypeId());
+ GroupTypeId groupTypeId = this.taskitEngine.translateObject(groupInput.getGroupTypeId());
for (Integer gId : groupInput.getGIdList()) {
builder.addGroup(new GroupId(gId), groupTypeId);
}
@@ -48,22 +50,22 @@ protected GroupsPluginData convertInputObject(GroupsPluginDataInput inputObject)
// Add group type ids
for (GroupTypeIdInput groupTypeIdInput : inputObject.getGroupTypeIdsList()) {
- GroupTypeId groupTypeId = this.translationEngine.convertObject(groupTypeIdInput);
+ GroupTypeId groupTypeId = this.taskitEngine.translateObject(groupTypeIdInput);
builder.addGroupTypeId(groupTypeId);
}
// Add group type property definitions
for (GroupPropertyDefinitionMapInput groupPropertyDefinitionMapInput : inputObject
.getGroupPropertyDefinitionsList()) {
- GroupTypeId groupTypeId = this.translationEngine
- .convertObject(groupPropertyDefinitionMapInput.getGroupTypeId());
+ GroupTypeId groupTypeId = this.taskitEngine
+ .translateObject(groupPropertyDefinitionMapInput.getGroupTypeId());
for (PropertyDefinitionMapInput propertyDefinitionMapInput : groupPropertyDefinitionMapInput
.getPropertyDefinitionsList()) {
- GroupPropertyId groupPropertyId = this.translationEngine
- .convertObject(propertyDefinitionMapInput.getPropertyId());
- PropertyDefinition propertyDefinition = this.translationEngine
- .convertObject(propertyDefinitionMapInput.getPropertyDefinition());
+ GroupPropertyId groupPropertyId = this.taskitEngine
+ .translateObject(propertyDefinitionMapInput.getPropertyId());
+ PropertyDefinition propertyDefinition = this.taskitEngine
+ .translateObject(propertyDefinitionMapInput.getPropertyDefinition());
builder.defineGroupProperty(groupTypeId, groupPropertyId, propertyDefinition);
}
}
@@ -74,10 +76,9 @@ protected GroupsPluginData convertInputObject(GroupsPluginDataInput inputObject)
for (int groupId : groupPropertyValueMapInput.getGIdsList()) {
- GroupPropertyId groupPropertyId = this.translationEngine
+ GroupPropertyId groupPropertyId = this.taskitEngine
.getObjectFromAny(propertyValueMapInput.getPropertyId());
- Object propertyValue = this.translationEngine
- .getObjectFromAny(propertyValueMapInput.getPropertyValue());
+ Object propertyValue = this.taskitEngine.getObjectFromAny(propertyValueMapInput.getPropertyValue());
builder.setGroupPropertyValue(new GroupId(groupId), groupPropertyId, propertyValue);
}
@@ -106,24 +107,26 @@ protected GroupsPluginData convertInputObject(GroupsPluginDataInput inputObject)
}
@Override
- protected GroupsPluginDataInput convertAppObject(GroupsPluginData appObject) {
+ protected GroupsPluginDataInput translateAppObject(GroupsPluginData appObject) {
GroupsPluginDataInput.Builder builder = GroupsPluginDataInput.newBuilder();
builder.setVersion(appObject.getVersion());
+ Map groupTypeIdTranslatedCacheMap = new HashMap<>();
+
// add group type ids
for (GroupTypeId groupTypeId : appObject.getGroupTypeIds()) {
- GroupTypeIdInput groupTypeIdInput = this.translationEngine.convertObjectAsSafeClass(groupTypeId,
+ GroupTypeIdInput groupTypeIdInput = this.taskitEngine.translateObjectAsClassSafe(groupTypeId,
GroupTypeId.class);
builder.addGroupTypeIds(groupTypeIdInput);
+ groupTypeIdTranslatedCacheMap.put(groupTypeId, groupTypeIdInput);
}
Map> groupMap = new LinkedHashMap<>();
// add groups
for (GroupId groupId : appObject.getGroupIds()) {
- GroupTypeIdInput groupTypeIdInput = this.translationEngine
- .convertObjectAsSafeClass(appObject.getGroupTypeId(groupId), GroupTypeId.class);
+ GroupTypeIdInput groupTypeIdInput = groupTypeIdTranslatedCacheMap.get(appObject.getGroupTypeId(groupId));
List groups = groupMap.get(groupTypeIdInput);
@@ -142,14 +145,15 @@ protected GroupsPluginDataInput convertAppObject(GroupsPluginData appObject) {
builder.addGroups(groupInput);
}
- // add group type property definitions
+ groupMap.clear();
+ Map groupPropertyIdTranslatedCacheMap = new HashMap<>();
+ // add group type property definitions
for (GroupTypeId groupTypeId : appObject.getGroupTypeIds()) {
GroupPropertyDefinitionMapInput.Builder groupPropDefMapInputBuilder = GroupPropertyDefinitionMapInput
.newBuilder();
- GroupTypeIdInput groupTypeIdInput = this.translationEngine.convertObjectAsSafeClass(groupTypeId,
- GroupTypeId.class);
+ GroupTypeIdInput groupTypeIdInput = groupTypeIdTranslatedCacheMap.get(groupTypeId);
groupPropDefMapInputBuilder.setGroupTypeId(groupTypeIdInput);
Set groupPropertyIds = appObject.getGroupPropertyIds(groupTypeId);
@@ -158,12 +162,18 @@ protected GroupsPluginDataInput convertAppObject(GroupsPluginData appObject) {
PropertyDefinition propertyDefinition = appObject.getGroupPropertyDefinition(groupTypeId,
groupPropertyId);
- PropertyDefinitionInput propertyDefinitionInput = this.translationEngine
- .convertObject(propertyDefinition);
+ PropertyDefinitionInput propertyDefinitionInput = this.taskitEngine.translateObject(propertyDefinition);
+
+ Any groupPropertyIdInput = groupPropertyIdTranslatedCacheMap.get(groupPropertyId);
+
+ if (groupPropertyIdInput == null) {
+ groupPropertyIdInput = this.taskitEngine.getAnyFromObject(groupPropertyId);
+ groupPropertyIdTranslatedCacheMap.put(groupPropertyId, groupPropertyIdInput);
+ }
PropertyDefinitionMapInput propertyDefInput = PropertyDefinitionMapInput.newBuilder()
.setPropertyDefinition(propertyDefinitionInput)
- .setPropertyId(this.translationEngine.getAnyFromObject(groupPropertyId))
+ .setPropertyId(groupPropertyIdInput)
.build();
groupPropDefMapInputBuilder.addPropertyDefinitions(propertyDefInput);
@@ -171,13 +181,14 @@ protected GroupsPluginDataInput convertAppObject(GroupsPluginData appObject) {
builder.addGroupPropertyDefinitions(groupPropDefMapInputBuilder.build());
}
+
+ groupTypeIdTranslatedCacheMap.clear();
+
// add group property values
Map> propValueToGroupIdsMap = new LinkedHashMap<>();
for (GroupId groupId : appObject.getGroupIds()) {
- // groupPropValMapBuilder.setGId(groupId.getValue());
-
List groupPropertyValues = appObject.getGroupPropertyValues(groupId);
for (GroupPropertyValue groupPropertyValue : groupPropertyValues) {
@@ -192,16 +203,25 @@ protected GroupsPluginDataInput convertAppObject(GroupsPluginData appObject) {
}
}
+ Map