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

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


    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);

        for (Object sprintId : keys) {
            Sprint sprint = uow.readObject(sprintId.toString().getBytes(), Sprint.class);

            if (sprint != null) {
                sprints.add(sprint);
            }
        }
View Full Code Here


    @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

    @Override
    public void removeAll(Collection<Sprint> aSprintCollection) {
        boolean locked = false;

        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

    @Override
    public void saveAll(Collection<Sprint> aSprintCollection) {
        boolean locked = false;

        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

    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);

        for (Object teamId : keys) {
            Team team = uow.readObject(teamId.toString().getBytes(), Team.class);

            if (team != null) {
                teams.add(team);
            }
        }
View Full Code Here

    @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

    @Override
    public void removeAll(Collection<Team> aTeamCollection) {
        boolean locked = false;

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (Team team : aTeamCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, team.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

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

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

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        uow.lock(lockKey.key());

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

    @Override
    public void saveAll(Collection<Team> aTeamCollection) {
        boolean locked = false;

        LevelDBUnitOfWork uow = LevelDBUnitOfWork.current();

        for (Team team : aTeamCollection) {
            if (!locked) {
                LevelDBKey lockKey = new LevelDBKey(PRIMARY, team.tenantId().id());

                uow.lock(lockKey.key());

                locked = true;
            }

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

TOP

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

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.