Skip to content

Commit

Permalink
Cleanup unused DSP variables
Browse files Browse the repository at this point in the history
  • Loading branch information
jkosternl committed Dec 18, 2024
1 parent 86bb218 commit f93f4bd
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public JitPortCallServiceAction(
serviceType != null ? "Port Call Service: " + serviceType.name() : "Port Call Service");
validator = context.componentFactory().getMessageSchemaValidator(JitSchema.PORT_CALL_SERVICE);
if (serviceType == null && previousAction instanceof JitPortCallServiceAction && dsp != null) {
serviceType = dsp.chosenServiceType();
serviceType = dsp.portCallServiceType();
}
this.serviceType = serviceType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ protected void doHandleExchange(ConformanceExchange exchange) {
JitTimestamp receivedTimestamp = JitTimestamp.fromJson(requestJsonNode);
dsp =
dsp.withPreviousTimestamp(dsp.currentTimestamp())
.withCurrentTimestamp(receivedTimestamp)
.withTimestampDateTime(receivedTimestamp.dateTime())
.withTimestampType(
JitTimestampType.fromClassifierCode(receivedTimestamp.classifierCode()));
.withCurrentTimestamp(receivedTimestamp);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,10 @@ public void handlePartyInput(JsonNode partyInput) {
new DynamicScenarioParameters(
null,
null,
null,
null,
null,
suppliedScenarioParameters.serviceType(),
suppliedScenarioParameters.portCallID(),
suppliedScenarioParameters.terminalCallID(),
suppliedScenarioParameters.portCallServiceID(),
suppliedScenarioParameters.serviceType(),
selector);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,22 @@
import org.dcsa.conformance.core.party.ScenarioParameters;
import org.dcsa.conformance.standards.jit.model.JitServiceTypeSelector;
import org.dcsa.conformance.standards.jit.model.JitTimestamp;
import org.dcsa.conformance.standards.jit.model.JitTimestampType;
import org.dcsa.conformance.standards.jit.model.PortCallServiceType;

@With
@JsonInclude(JsonInclude.Include.NON_NULL)
public record DynamicScenarioParameters(
JitTimestampType timestampType,
JitTimestamp previousTimestamp,
JitTimestamp currentTimestamp,
PortCallServiceType portCallServiceType,
String timestampDateTime,
String portCallID,
String terminalCallID,
String portCallServiceID,
PortCallServiceType chosenServiceType,
JitServiceTypeSelector selector)
implements ScenarioParameters {

public DynamicScenarioParameters() {
this(null, null, null, null, null, null, null, null, null, null);
this(null, null, null, null, null, null, null);
}

public static DynamicScenarioParameters fromJson(JsonNode jsonNode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private void portCallServiceRequest(JsonNode actionPrompt) {
if (actionPrompt.has(JitPortCallServiceAction.SERVICE_TYPE)) {
serviceType = actionPrompt.required(JitPortCallServiceAction.SERVICE_TYPE).asText();
} else {
serviceType = dsp.chosenServiceType().name();
serviceType = dsp.portCallServiceType().name();
}
dsp = dsp.withPortCallServiceType(PortCallServiceType.fromName(serviceType));
JsonNode jsonBody = replacePlaceHolders("port-call-service", dsp);
Expand Down

0 comments on commit f93f4bd

Please sign in to comment.