Package com.saasovation.agilepm.domain.model.product

Examples of com.saasovation.agilepm.domain.model.product.Product


    public void startDiscussionInitiation(StartDiscussionInitiationCommand aCommand) {

        ApplicationServiceLifeCycle.begin();

        try {
            Product product =
                    this.productRepository()
                        .productOfId(
                                new TenantId(aCommand.getTenantId()),
                                new ProductId(aCommand.getProductId()));

            if (product == null) {
                throw new IllegalStateException(
                        "Unknown product of tenant id: "
                        + aCommand.getTenantId()
                        + " and product id: "
                        + aCommand.getProductId());
            }

            String timedOutEventName =
                    ProductDiscussionRequestTimedOut.class.getName();

            TimeConstrainedProcessTracker tracker =
                    new TimeConstrainedProcessTracker(
                            product.tenantId().id(),
                            ProcessId.newProcessId(),
                            "Create discussion for product: "
                                + product.name(),
                            new Date(),
                            5L * 60L * 1000L, // retries every 5 minutes
                            3, // 3 total retries
                            timedOutEventName);

            this.processTrackerRepository().save(tracker);

            product.startDiscussionInitiation(tracker.processId().id());

            this.productRepository().save(product);

            ApplicationServiceLifeCycle.success();

View Full Code Here


        try {
            ProcessId processId = ProcessId.existingProcessId(aCommand.getProcessId());

            TenantId tenantId = new TenantId(aCommand.getTenantId());

            Product product =
                    this.productRepository()
                        .productOfDiscussionInitiationId(
                                tenantId,
                                processId.id());

            this.sendEmailForTimedOutProcess(product);

            product.failDiscussionInitiation();

            this.productRepository().save(product);

            ApplicationServiceLifeCycle.success();
View Full Code Here

                    this.productOwnerRepository()
                        .productOwnerOfIdentity(
                                tenantId,
                                aProductOwnerId);

            Product product =
                    new Product(
                            tenantId,
                            productId,
                            productOwner.productOwnerId(),
                            aName,
                            aDescription,
View Full Code Here

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.readOnly(this.database());

        List<Object> keys = uow.readKeys(productsOfTenant);

        for (Object productId : keys) {
            Product product = uow.readObject(productId.toString().getBytes(), Product.class);

            if (product != null) {
                products.add(product);
            }
        }
View Full Code Here

    @Override
    public Product productOfDiscussionInitiationId(
            TenantId aTenantId,
            String aDiscussionInitiationId) {

        Product product = null;

        LevelDBKey productsOfDiscussion =
                new LevelDBKey(
                        PRODUCT_OF_DISCUSSION,
                        aTenantId.id(),
View Full Code Here

    @Override
    public Product productOfId(TenantId aTenantId, ProductId aProductId) {
        LevelDBKey primaryKey = new LevelDBKey(PRIMARY, aTenantId.id(), aProductId.id());

        Product product =
                LevelDBUnitOfWork.readOnly(this.database())
                    .readObject(primaryKey.key().getBytes(), Product.class);

        return product;
    }
View Full Code Here

    public ProductApplicationCommonTest() {
        super();
    }

    protected Product persistedProductForTest() {
        Product product = this.productForTest();

        LevelDBUnitOfWork.start(this.database);

        this.productRepository.save(product);
View Full Code Here

        assertEquals(changedName, release.name());
    }

    public void testReorderFrom() throws Exception {
        Product product = this.productForTest();
        Release release = this.releaseForTest(product);

        BacklogItem backlogItem1 = this.backlogItem1ForTest(product);
        BacklogItem backlogItem2 = this.backlogItem2ForTest(product);
        BacklogItem backlogItem3 = this.backlogItem3ForTest(product);
View Full Code Here

        assertEquals(2, scheduledBacklogItem1.ordering());
        assertEquals(3, scheduledBacklogItem2.ordering());
    }

    public void testSchedule() throws Exception {
        Product product = this.productForTest();
        Release release = this.releaseForTest(product);

        BacklogItem backlogItem1 = this.backlogItem1ForTest(product);
        BacklogItem backlogItem2 = this.backlogItem2ForTest(product);
        BacklogItem backlogItem3 = this.backlogItem3ForTest(product);
View Full Code Here

            }
        }
    }

    public void testUnschedule() throws Exception {
        Product product = this.productForTest();
        Release release = this.releaseForTest(product);

        BacklogItem backlogItem1 = this.backlogItem1ForTest(product);
        BacklogItem backlogItem2 = this.backlogItem2ForTest(product);
        BacklogItem backlogItem3 = this.backlogItem3ForTest(product);
View Full Code Here

TOP

Related Classes of com.saasovation.agilepm.domain.model.product.Product

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.