Package org.rhq.core.domain.content.composite

Examples of org.rhq.core.domain.content.composite.PackageVersionComposite


        }

        Collections.sort(modifiedResults, new Comparator() {

            public int compare(Object o1, Object o2) {
                PackageVersionComposite p1 = (PackageVersionComposite) o1;
                PackageVersionComposite p2 = (PackageVersionComposite) o2;
                return p1.getPackageName().compareToIgnoreCase(p2.getPackageName());
            }
        });

        return new PageList<PackageVersionComposite>(modifiedResults, (int) count, pc);
    }
View Full Code Here


            testResults.add(result);
        }

        List<PackageVersionComposite> latestResults = new ArrayList<PackageVersionComposite>();

        PackageVersionComposite latestPackage = null;

        for (PackageVersionComposite newPackage : modifiedResults) {
            latestPackage = newPackage;

            for (PackageVersionComposite pack : testResults) {
                if (pack.getPackageName().equals(latestPackage.getPackageName())
                    && latestPackage.getPackageVersion().getVersion().compareTo(pack.getPackageVersion().getVersion()) < 0) {
                    latestPackage = pack;
                }
            }
            latestResults.add(latestPackage);
        }

        List<PackageVersionComposite> finalResults = new ArrayList<PackageVersionComposite>();

        long count = 0;
        for (PackageVersionComposite pack : latestResults) {
            if (finalResults.contains(pack)) {
                continue;
            } else {
                finalResults.add(pack);
                count++;
            }
        }

        Collections.sort(finalResults, new Comparator() {

            public int compare(Object o1, Object o2) {
                PackageVersionComposite p1 = (PackageVersionComposite) o1;
                PackageVersionComposite p2 = (PackageVersionComposite) o2;
                return p1.getPackageName().compareToIgnoreCase(p2.getPackageName());
            }
        });

        return new PageList<PackageVersionComposite>(finalResults, (int) count, pc);
    }
View Full Code Here

    }

    public PackageVersionComposite loadPackageVersionComposite(Subject user, int packageVersionId) {
        Query q = entityManager.createNamedQuery(PackageVersion.QUERY_FIND_COMPOSITE_BY_ID);
        q.setParameter("id", packageVersionId);
        PackageVersionComposite pv = (PackageVersionComposite) q.getSingleResult();
        return pv;
    }
View Full Code Here

    }

    public PackageVersionComposite loadPackageVersionCompositeWithExtraProperties(Subject user, int packageVersionId) {
        Query q = entityManager.createNamedQuery(PackageVersion.QUERY_FIND_COMPOSITE_BY_ID_WITH_PROPS);
        q.setParameter("id", packageVersionId);
        PackageVersionComposite pv = (PackageVersionComposite) q.getSingleResult();
        return pv;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.content.composite.PackageVersionComposite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.