Package org.rhq.enterprise.server.plugin.pc.content

Examples of org.rhq.enterprise.server.plugin.pc.content.PackageSource


        if (!(provider instanceof PackageSource)) {
            // Nothing to do.
            return tracker;
        }

        PackageSource packageSource = (PackageSource) provider;

        // Load packages to send to package source
        // --------------------------------------------
        long start = System.currentTimeMillis();

        List<PackageVersionContentSource> existingPVCS; // already know about this source
        Set<ContentProviderPackageDetails> allDetails; // send to plugin
        Map<ContentProviderPackageDetailsKey, PackageVersionContentSource> keyPVCSMap;

        Subject overlord = subjectManager.getOverlord();
        existingPVCS = contentSourceManager.getPackageVersionsFromContentSourceForRepo(overlord, source.getId(), repo
            .getId());

        int existingCount = existingPVCS.size();
        keyPVCSMap = new HashMap<ContentProviderPackageDetailsKey, PackageVersionContentSource>(existingCount);
        allDetails = new HashSet<ContentProviderPackageDetails>(existingCount);

        translateDomainToDto(existingPVCS, allDetails, keyPVCSMap);

        log.info("Synchronize Packages: [" + source.getName() + "]: loaded existing list of size=[" + existingCount
            + "] (" + (System.currentTimeMillis() - start) + ")ms");

        // Ask source to do the sync
        // --------------------------------------------
        start = System.currentTimeMillis();

        PackageSyncReport report = new PackageSyncReport();
        packageSource.synchronizePackages(repo.getName(), report, allDetails);
        tracker.setPackageSyncCount(report.getNewPackages().size() + report.getUpdatedPackages().size());

        log.info("Synchronize Packages: [" + source.getName() + "]: got sync report from adapter=[" + report + "] ("
            + (System.currentTimeMillis() - start) + ")ms.  Have: " + tracker.getPackageSyncCount()
            + " packages to sync");
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.plugin.pc.content.PackageSource

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.