![]() Please wait while updating issue type...
Could not save your changes
This issue has been changed since you started editing it
Data that has been changed is highlighted in red below. Undo your changes to see the updated information
You have changed this issue, but haven't saved your changes yet. To save it, press the Save changes button to the right
This issue is blocking the next release
![]() There are no comments
There is nothing attached to this issue
This issue has no duplicates
There are no code checkins for this issue |
|||||||||||||||||||||||||||||||||||||||
Really delete this comment?
A basic implementation of subnet matching. Does not handle the IllegalArgumentException that will be thrown if either of the strings provided is not in the valid format.
Really delete this comment?
Really delete this comment?
Updated my implementation, actually compiling and testing it this time. Of note:
Also added commons-net-3.3.jar to classpath.
Really delete this comment?
Really delete this comment?
Really delete this comment?
Couldn't we use the classes in the org.jppf.net package, along with the IPFilter class as a starting point?
Really delete this comment?
I agree about keeping a small footprint and no dependencies. For my proof of concept I just copied over the files directly from the atlassian-ip package, so there are no additional dependencies, plus a lot of unused methods to get rid of. But as you mention, IPFilter is probably a great starting point. It's probably simple to write a method to convert the standard CIDR notation to the IP ranges you have defined and allow both notations in both places.
Attaching the current work in progress, with InSubnet extending the CustomPolicy. I'll work up a modification to IPFilter to handle both format cases.
Attached file tested to work with
Really delete this comment?
This most notably affects the ability to use localhost "::1" which represents 0:0:0:0:0:0:0:1, but instead parses as follows:
Also the all-zeroes pattern "::" is perfectly legal in ipV6 but is disallowed in IPv6AddressPattern.
This is consistent with the way the patterns are documented in the javadoc, but inconsistent with the IPv6 standard. I expect the classes I'm working on will provide users an alternative consistent with the IPv6 shorthand.
Really delete this comment?
Laurent,
I think I have a very workable implementation for you.
Of note, the IPv4 version of the CustomPolicy will also work with the same format as inclusion/exclusion patterns because it just calls super() with an unmodified string if no netmask is included. This will also work for the IPv6 version, but only if all 8 fields are specified. (In the example cited, "::1" is treated as "::1/128".) I think I can also handle the IPv6 pattern without all 8 fields as long as there is no "::" included, and I'm working on that now.
I think this is mostly complete except for the non-:: pattern changes, and Javadoc documentation/more comments, which I'll work on (but wanted to let you take a look at it for review/comment).
I would suggest you also make the netmask version an option for inclusion/exclusion patterns in the config file(s).
Really delete this comment?
Laurent,
I've finished up the Javadocs, changed the inheritance to what I had originally intended, and changed the IPv6 to also use patterns as long as there is no "::" included. Officially ceasing work on these and turning it over to you.
Dan
Really delete this comment?
I think that uploading the file with the same name as an older version doesn't work. Here's the same file renamed... really, I'm quitting now!
Really delete this comment?
I've been through the code, and I believe it is great. There are a few changes I would like to make, as I think they really make sense:
Really delete this comment?
I only created the classes in my own package as CustomPolicy implementations in order to make them work independently of modifying the JPPF source, as an example of how it could be done simply. I had assumed you would create "first class" versions with all the other stuff included... all that was "details" that I didn't care about (or required XML schema decisions above my paygrade), I just wanted to make something that worked.
Two quick comments:
Really delete this comment?
Really delete this comment?
I made a few more changes to the original sources: renamed IPv*Subnet into IsInIPv*Subnet so the names match the predicate semantics, added a constructor that takes a Collection<String>, added toString() method that converts to XML representation.
What remains to do on this:
Really delete this comment?
Really delete this comment?