Package lv.odylab.evemanage.domain.priceset

Examples of lv.odylab.evemanage.domain.priceset.PriceSet


        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        List<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        priceSet1.setId(4L);
        PriceSet priceSet2 = new PriceSet();
        priceSet2.setId(5L);
        priceSets.add(priceSet1);
        priceSets.add(priceSet2);
        when(priceSetDao.getAll(new Key<User>(User.class, 4L), 1L)).thenReturn(priceSets);
        updatePriceSetTaskLauncher.launchForUpdate(4L, character);
        verify(queue, times(2)).add(any(TaskOptions.class));
View Full Code Here


        character.setName("characterName");
        character.setCorporationID(2L);
        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        List<PriceSet> priceSets = new ArrayList<PriceSet>();
        PriceSet priceSet1 = new PriceSet();
        priceSet1.setId(4L);
        PriceSet priceSet2 = new PriceSet();
        priceSet2.setId(5L);
        priceSets.add(priceSet1);
        priceSets.add(priceSet2);
        when(priceSetDao.getAll(new Key<User>(User.class, 4L), 1L)).thenReturn(priceSets);
        updatePriceSetTaskLauncher.launchForUpdate(4L, character);
        verify(queue, times(2)).add(any(TaskOptions.class));
View Full Code Here

            throw new InvalidNameException(priceSetName, ErrorCode.NAME_CANNOT_BE_EMPTY);
        }
        if (priceSetNameAlreadyExists(priceSetName, userKey)) {
            throw new InvalidNameException(priceSetName, ErrorCode.NAME_MUST_BE_UNIQUE);
        }
        PriceSet priceSet = new PriceSet();
        priceSet.setUser(userKey);
        priceSet.setName(priceSetName);
        priceSet.setAttachedCharacterInfo(null);
        priceSet.setSharingLevel(SharingLevel.PERSONAL.toString());
        priceSet.setCreatedDate(new Date());
        priceSet.setUpdatedDate(new Date());
        priceSetDao.put(priceSet, userKey);
        return priceSet;
    }
View Full Code Here

            throw new InvalidNameException(priceSetName, ErrorCode.NAME_CANNOT_BE_EMPTY);
        }
        if (priceSetNameAlreadyExists(priceSetName, userKey)) {
            throw new InvalidNameException(priceSetName, ErrorCode.NAME_MUST_BE_UNIQUE);
        }
        PriceSet priceSet = priceSetDao.get(priceSetID, userKey);
        priceSet.setName(priceSetName);
        priceSet.setUpdatedDate(new Date());
        priceSetDao.put(priceSet, userKey);
    }
View Full Code Here

        priceSetDao.put(priceSet, userKey);
    }

    @Override
    public void savePriceSet(Long priceSetID, Set<PriceSetItem> priceSetItems, String sharingLevel, Long attachedCharacterID, Key<User> userKey) {
        PriceSet priceSet = priceSetDao.get(priceSetID, userKey);
        priceSet.setItems(priceSetItems);
        priceSet.setSharingLevel(sharingLevel);
        if (attachedCharacterID != null) {
            Character character = characterDao.getByCharacterID(attachedCharacterID, userKey);
            CharacterInfo characterInfo = new CharacterInfo();
            characterInfo.setId(character.getId());
            characterInfo.setCharacterID(character.getCharacterID());
            characterInfo.setName(character.getName());
            characterInfo.setCorporationID(character.getCorporationID());
            characterInfo.setCorporationName(character.getCorporationName());
            characterInfo.setCorporationTicker(character.getCorporationTicker());
            characterInfo.setAllianceID(character.getAllianceID());
            characterInfo.setAllianceName(character.getAllianceName());
            priceSet.setAttachedCharacterInfo(characterInfo);
        } else {
            priceSet.setAttachedCharacterInfo(null);
        }
        priceSet.setUpdatedDate(new Date());
        priceSetDao.put(priceSet, userKey);
    }
View Full Code Here

        return typeIdToPriceMap;
    }

    @Override
    public void deletePriceSet(Long priceSetID, Key<User> userKey) {
        PriceSet priceSet = priceSetDao.get(priceSetID, userKey);
        priceSetDao.delete(priceSet);
    }
View Full Code Here

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            Long userID = Long.valueOf(req.getParameter("userID"));
            Long priceSetID = Long.valueOf(req.getParameter("priceSetID"));
            Long characterID = req.getParameter("characterID") == null ? null : Long.valueOf(req.getParameter("characterID"));
            PriceSet priceSet = priceSetDao.get(priceSetID, new Key<User>(User.class, userID));
            if (characterID != null) {
                CharacterInfo characterInfo = new CharacterInfo();
                characterInfo.setCharacterID(characterID);
                characterInfo.setName(req.getParameter("characterName"));
                String corporationID = req.getParameter("corporationID");
                characterInfo.setCorporationID(corporationID == null ? null : Long.valueOf(corporationID));
                characterInfo.setCorporationName(req.getParameter("corporationName"));
                characterInfo.setCorporationTicker(req.getParameter("corporationTicker"));
                String allianceID = req.getParameter("allianceID");
                characterInfo.setAllianceID(allianceID == null ? null : Long.valueOf(allianceID));
                characterInfo.setAllianceName(req.getParameter("allianceName"));
                priceSet.setAttachedCharacterInfo(characterInfo);
            } else {
                priceSet.setAttachedCharacterInfo(null);
            }
            priceSetDao.putWithoutChecks(priceSet);
        } catch (Throwable t) {
            logger.error("Caught Throwable", t);
        }
View Full Code Here

        applicationFacade.importBlueprintsUsingFullApiKey(characterID, level, attachedCharacterID, sharingLevel);
    }

    @Override
    public PriceSetDto getPriceSet(Long priceSetID) {
        PriceSet priceSet = applicationFacade.getPriceSet(priceSetID);
        return priceSet == null ? null : mapper.map(priceSet, PriceSetDto.class);
    }
View Full Code Here

        return priceSet == null ? null : mapper.map(priceSet, PriceSetDto.class);
    }

    @Override
    public PriceSetDto getCorporationPriceSet(Long priceSetID) {
        PriceSet priceSet = applicationFacade.getCorporationPriceSet(priceSetID);
        return priceSet == null ? null : mapper.map(priceSet, PriceSetDto.class);
    }
View Full Code Here

        return priceSet == null ? null : mapper.map(priceSet, PriceSetDto.class);
    }

    @Override
    public PriceSetDto getAlliancePriceSet(Long priceSetID) {
        PriceSet priceSet = applicationFacade.getAlliancePriceSet(priceSetID);
        return priceSet == null ? null : mapper.map(priceSet, PriceSetDto.class);
    }
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.domain.priceset.PriceSet

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.