Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path subclasses InetSocketAddress - v3 #84

Closed
wants to merge 13 commits into from

Conversation

tzaeschke
Copy link
Collaborator

@tzaeschke tzaeschke commented Jun 10, 2024

Path objects should be a subclass of InetSocketAddressinorder to be returnable from DatagramChannel.receive().

This approach (version 3) moves Path, RequestPath and RepsonsePath to new package-private classes PathImpl, RequestPathImpl and RepsonsePathImpl to new classes. For the public API we get three new interfaces Path, RequestPath and RepsonsePath. PathImpl now extends InetSocketAddress.

This allows paths to be returned by DatagramChannel.receive(). At the same time, a normal Path does not expose any InetSocketAddress methods to avoid confusion. In particular, as far as the user is concerned an InetSocketAddress is never a SCION address (it does not have ISD/AS), and a SCION resolved address is always a Path.

The fact that a Path is internally implemented as InetSocketAddresss is hidden from the user.

@tzaeschke tzaeschke self-assigned this Jun 10, 2024
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

Attention: Patch coverage is 65.85366% with 56 lines in your changes missing coverage. Please review.

Files Coverage Δ Complexity Δ
src/main/java/org/scion/jpan/RequestPath.java 100.00% <100.00%> (+54.41%) 1.00 <1.00> (-10.00) ⬆️
src/main/java/org/scion/jpan/RequestPathImpl.java 100.00% <100.00%> (ø) 6.00 <6.00> (?)
src/main/java/org/scion/jpan/ResponsePath.java 100.00% <100.00%> (+15.38%) 1.00 <1.00> (-5.00) ⬆️
src/main/java/org/scion/jpan/ScionService.java 71.42% <100.00%> (+0.36%) 54.00 <8.00> (+4.00)
src/main/java/org/scion/jpan/ScionUtil.java 96.55% <100.00%> (+0.04%) 30.00 <4.00> (ø)
src/main/java/org/scion/jpan/ScmpChannel.java 84.21% <100.00%> (ø) 18.00 <0.00> (ø)
.../main/java/org/scion/jpan/ScionDatagramSocket.java 54.96% <66.66%> (+0.17%) 57.00 <0.00> (ø)
src/main/java/org/scion/jpan/ResponsePathImpl.java 86.66% <86.66%> (ø) 7.00 <7.00> (?)
...main/java/org/scion/jpan/ScionDatagramChannel.java 93.10% <83.33%> (-3.33%) 13.00 <0.00> (ø)
src/main/java/org/scion/jpan/PathPolicy.java 24.48% <20.00%> (ø) 1.00 <0.00> (ø)
... and 3 more

... and 1 file with indirect coverage changes

@tzaeschke
Copy link
Collaborator Author

Closed. Refactoring was implemented in #94 & #95

@tzaeschke tzaeschke closed this Jun 21, 2024
@tzaeschke tzaeschke deleted the fix/69-PathSocketAddress-v3 branch June 21, 2024 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant