Skip to content

Commit

Permalink
IGDD-1848 enable direct access to ndlp storage (#19)
Browse files Browse the repository at this point in the history
* Updated IDestination to add default methods for is* methods.

* Reporting fault originalBody as response body on HubClientFault.

* Added generic I/O Exception case to DestinationConnectionFault.

* Replace cast with null check in setProcessError

* Fix missing whitespace in Fault message strings.
  • Loading branch information
keithboone authored Dec 16, 2024
1 parent c815971 commit 2ea4763
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import gov.cdc.izgateway.logging.markers.Markers2;
import gov.cdc.izgateway.soap.fault.Fault;
import gov.cdc.izgateway.soap.fault.FaultSupport;
import gov.cdc.izgateway.soap.fault.HubClientFault;
import gov.cdc.izgateway.soap.fault.UnexpectedExceptionFault;
import gov.cdc.izgateway.soap.fault.UnsupportedOperationFault;
import gov.cdc.izgateway.logging.info.SourceInfo;
Expand Down Expand Up @@ -665,6 +666,9 @@ public void setProcessError(Exception fault) {
s = f;
} else if (fault instanceof Fault f) {
s = f;
if (f instanceof HubClientFault hcf && hcf.getOriginalBody() != null) {
this.setResponse(hcf.getOriginalBody());
}
} else {
s = new UnexpectedExceptionFault(fault, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ public class DestinationConnectionFault extends Fault implements HasDestinationU
FAULT_NAME,
"20",
"Write Error", "Error writing message to the destination endpoint",
"There was an IO Error writing to the destination endpoint. This may indicate a problem with the networking infrastructure between"
"There was an IO Error writing to the destination endpoint. This may indicate a problem with the networking infrastructure between "
+ "IZ Gateway and the endpoint.",
RetryStrategy.NORMAL
),
new MessageSupport(
FAULT_NAME,
"21",
"Read Error", "Error reading message from the destination endpoint",
"There was an IO Error reading from the destination endpoint. This may indicate a problem with the networking infrastructure between"
"There was an IO Error reading from the destination endpoint. This may indicate a problem with the networking infrastructure between "
+ "IZ Gateway and the endpoint.",
RetryStrategy.NORMAL
),
Expand All @@ -133,6 +133,14 @@ public class DestinationConnectionFault extends Fault implements HasDestinationU
"There was an error establishing a trusted connection between IZ Gateway and the destination endpoint. The destination endpoint does not trust IZ Gateway. This can result from a problem with the destination's"
+ "acceptance of the IZ Gateway trust parameters including supported protocol versions, encryption suites or the destination certificate.",
RetryStrategy.CONTACT_SUPPORT
),
new MessageSupport(
FAULT_NAME,
"24",
"IO Error At Destination", "Error communicating from/to destination",
"There was an IO Error accessing the destination endpoint. This may indicate a problem with the networking infrastructure between "
+ "IZ Gateway and the endpoint.",
RetryStrategy.NORMAL
)
};
static {
Expand Down Expand Up @@ -227,6 +235,9 @@ public static DestinationConnectionFault readError(IDestination routing, IOExcep
}
return new DestinationConnectionFault(11, routing, ex.getMessage(), ex);
}
public static DestinationConnectionFault ioError(IDestination routing, IOException ex) {
return new DestinationConnectionFault(14, routing, ex.getMessage(), ex);
}

public static DestinationConnectionFault tlsErrorAtDestination(IDestination routing, TlsFatalAlertReceived tlsErr, long elapsedTimeIIS) {
return new DestinationConnectionFault(13, routing, tlsErr.getMessage(), tlsErr);
Expand Down

0 comments on commit 2ea4763

Please sign in to comment.