Package org.candlepin.model

Examples of org.candlepin.model.ProvidedProduct


        Date endDate = createDate(2011, 1, 1);
        Pool testPool = createPoolAndSub(owner, parentProduct, 1L,
            startDate, endDate);

        // Add some provided products to this pool:
        ProvidedProduct p1 = new ProvidedProduct(providedProduct1.getId(),
            providedProduct1.getName());
        ProvidedProduct p2 = new ProvidedProduct(providedProduct2.getId(),
            providedProduct2.getName());
        testPool.addProvidedProduct(p1);
        testPool.addProvidedProduct(p2);
        poolCurator.create(testPool);
View Full Code Here


            // If a sub product id is on the pool, we want to define the sub pool
            // with the sub product data that was defined on the parent pool,
            // allowing the sub pool to have different attributes than the parent.
            Set<ProvidedProduct> providedProducts = new HashSet<ProvidedProduct>();
            for (DerivedProvidedProduct subProvided : pool.getDerivedProvidedProducts()) {
                providedProducts.add(new ProvidedProduct(subProvided.getProductId(),
                                                         subProvided.getProductName()));
            }

            consumerSpecificPool = createPool(pool.getDerivedProductId(), pool.getOwner(),
                quantity, pool.getStartDate(), pool.getEndDate(),
View Full Code Here

     * @param source subscription
     * @param destination pool
     */
    public void copyProvidedProducts(Subscription source, Pool destination) {
        for (Product providedProduct : source.getProvidedProducts()) {
            destination.addProvidedProduct(new ProvidedProduct(providedProduct.getId(),
                providedProduct.getName()));
        }

    }
View Full Code Here

            contractNumber, accountNumber, orderNumber);

        // Must be sure to copy the provided products, not try to re-use them directly:
        for (ProvidedProduct pp : providedProducts) {
            pool.addProvidedProduct(
                new ProvidedProduct(pp.getProductId(), pp.getProductName()));
        }

        if (sourceEntitlement != null && sourceEntitlement.getPool() != null) {
            if (sourceEntitlement.getPool().isStacked()) {
                pool.setSourceStack(new SourceStack(sourceEntitlement.getConsumer(),
View Full Code Here

     */
    private void accumulateProvidedProducts(Pool stackedSubPool, Pool nextStackedPool) {
        if (nextStackedPool.getDerivedProductId() == null) {
            for (ProvidedProduct pp : nextStackedPool.getProvidedProducts()) {
                expectedProvidedProds.add(
                    new ProvidedProduct(pp.getProductId(), pp.getProductName(),
                        stackedSubPool));
            }
        }
        else {
            for (DerivedProvidedProduct pp :
                nextStackedPool.getDerivedProvidedProducts()) {
                expectedProvidedProds.add(
                    new ProvidedProduct(pp.getProductId(), pp.getProductName(),
                        stackedSubPool));
            }
        }
    }
View Full Code Here

                    sub.getOrderNumber());
            newPool.setDerivedProvidedProducts(subProvidedProducts);

            if (sub.getProvidedProducts() != null) {
                for (Product p : sub.getProvidedProducts()) {
                    ProvidedProduct providedProduct = new ProvidedProduct(p.getId(),
                        p.getName());
                    providedProduct.setPool(newPool);
                    providedProducts.add(providedProduct);
                }
            }

            if (sub.getDerivedProvidedProducts() != null) {
                for (Product p : sub.getDerivedProvidedProducts()) {
                    DerivedProvidedProduct providedProduct =
                        new DerivedProvidedProduct(p.getId(), p.getName());
                    providedProduct.setPool(newPool);
                    subProvidedProducts.add(providedProduct);
                }
            }

            helper.copyProductAttributesOntoPool(sub.getProduct().getId(), newPool);
View Full Code Here

    private Set<ProvidedProduct> getExpectedProvidedProducts(Subscription sub,
        Pool existingPool) {
        Set<ProvidedProduct> incomingProvided = new HashSet<ProvidedProduct>();
        if (sub.getProvidedProducts() != null) {
            for (Product p : sub.getProvidedProducts()) {
                incomingProvided.add(new ProvidedProduct(p.getId(), p.getName(),
                    existingPool));
            }
        }
        return incomingProvided;
    }
View Full Code Here

TOP

Related Classes of org.candlepin.model.ProvidedProduct

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.