Package com.saasovation.common.port.adapter.persistence.leveldb

Examples of com.saasovation.common.port.adapter.persistence.leveldb.LevelDBKey


    @Override
    public Collection<Sprint> allProductSprints(TenantId aTenantId, ProductId aProductId) {
        List<Sprint> sprints = new ArrayList<Sprint>();

        LevelDBKey productSprints = new LevelDBKey(PRODUCT_RELEASES, aTenantId.id(), aProductId.id());

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

        List<Object> keys = uow.readKeys(productSprints);
View Full Code Here


        return new SprintId(UUID.randomUUID().toString().toUpperCase());
    }

    @Override
    public Sprint sprintOfId(TenantId aTenantId, SprintId aSprintId) {
        LevelDBKey primaryKey = new LevelDBKey(PRIMARY, aTenantId.id(), aSprintId.id());

        Sprint sprint =
                LevelDBUnitOfWork.readOnly(this.database())
                    .readObject(primaryKey.key().getBytes(), Sprint.class);

        return sprint;
    }
View Full Code Here

        return sprint;
    }

    @Override
    public void remove(Sprint aSprint) {
        LevelDBKey lockKey = new LevelDBKey(PRIMARY, aSprint.tenantId().id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

        this.remove(aSprint, uow);
    }
View Full Code Here

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (Sprint sprint : aSprintCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, sprint.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

            this.remove(sprint, uow);
View Full Code Here

        }
    }

    @Override
    public void save(Sprint aSprint) {
        LevelDBKey lockKey = new LevelDBKey(PRIMARY, aSprint.tenantId().id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

        this.save(aSprint, uow);
    }
View Full Code Here

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (Sprint sprint : aSprintCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, sprint.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

            this.save(sprint, uow);
View Full Code Here

            this.save(sprint, uow);
        }
    }

    private void remove(Sprint aSprint, LevelDBUnitOfWork aUoW) {
        LevelDBKey primaryKey = new LevelDBKey(PRIMARY, aSprint.tenantId().id(), aSprint.sprintId().id());
        aUoW.remove(primaryKey);

        LevelDBKey productSprints = new LevelDBKey(primaryKey, PRODUCT_RELEASES, aSprint.tenantId().id(), aSprint.productId().id());
        aUoW.removeKeyReference(productSprints);
    }
View Full Code Here

        LevelDBKey productSprints = new LevelDBKey(primaryKey, PRODUCT_RELEASES, aSprint.tenantId().id(), aSprint.productId().id());
        aUoW.removeKeyReference(productSprints);
    }

    private void save(Sprint aSprint, LevelDBUnitOfWork aUoW) {
        LevelDBKey primaryKey = new LevelDBKey(PRIMARY, aSprint.tenantId().id(), aSprint.sprintId().id());
        aUoW.write(primaryKey, aSprint);

        LevelDBKey productSprints = new LevelDBKey(primaryKey, PRODUCT_RELEASES, aSprint.tenantId().id(), aSprint.productId().id());
        aUoW.updateKeyReference(productSprints);
    }
View Full Code Here

    @Override
    public Collection<Team> allTeamsOfTenant(TenantId aTenantId) {
        List<Team> teams = new ArrayList<Team>();

        LevelDBKey teamsOfTenant = new LevelDBKey(TEAM_OF_TENANT, aTenantId.id());

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

        List<Object> keys = uow.readKeys(teamsOfTenant);
View Full Code Here

        return teams;
    }

    @Override
    public void remove(Team aTeam) {
        LevelDBKey lockKey = new LevelDBKey(PRIMARY, aTeam.tenantId().id());

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

        this.remove(aTeam, uow);
    }
View Full Code Here

TOP

Related Classes of com.saasovation.common.port.adapter.persistence.leveldb.LevelDBKey

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.