public class EusReleaseComparator extends java.lang.Object implements java.util.Comparator<EssentialChannelDto>
Compare two RHEL releases, where the behavior can differ depending on which version of RHEL we're dealing with. (RHEL 4 in particular needs special attention.)
"Release" in this context ends up appearing more like what we'd call a version, i.e. 5.3.0.3. Thus a simple string comparison will not suffice. (5.10 > 5.9)
Additionally, for all versions of RHEL, we may need to trim pieces of the version off to do the comparison.
Sample releases:
RHEL 4: 7.6, 8, 9 RHEL 5: 5.1.0.1, 5.2.0.2, 5.3.0.3
Constructor and Description |
---|
EusReleaseComparator(java.lang.String rhelVersionIn)
Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
compare(EssentialChannelDto chan1,
EssentialChannelDto chan2)
Compare two EUS channel releases.
|
int |
compare(EssentialChannelDto dto,
PackageEvr pevr)
Compare a PackageEvr (specifically, a redhat-release PEVR) to the
release/version of a specific EUS channel - specifically, "how does
a system with redhat-release 'pever' compare to a particular EUS
channel?" If the answer is "PEVR is same or greater", then the system
with that redhat-release is allowed to subscribe to the specified
channel.
|
int |
compare(java.lang.String rhelRelease1,
java.lang.String rhelRelease2)
Compare two EUS channel releases.
|
public EusReleaseComparator(java.lang.String rhelVersionIn)
rhelVersionIn
- RHEL version we're comparing release for. (5Server, 4AS, 4ES)public int compare(EssentialChannelDto chan1, EssentialChannelDto chan2)
compare
in interface java.util.Comparator<EssentialChannelDto>
chan1
- First channel.chan2
- Second channel.public int compare(java.lang.String rhelRelease1, java.lang.String rhelRelease2)
rhelRelease1
- First channel release.rhelRelease2
- Second channel release.public int compare(EssentialChannelDto dto, PackageEvr pevr)
dto
- Channel-info we might want to subscribe topevr
- PackageEvr of the redhat-release RPM that is installed
on the system of interest