Package lv.odylab.evemanage.domain.user

Examples of lv.odylab.evemanage.domain.user.CharacterInfo


    }

    @Override
    public List<PriceSet> getAlliancePriceSets(Key<User> userKey) {
        User user = userDao.get(userKey);
        CharacterInfo mainCharacterInfo = user.getMainCharacterInfo();
        if (mainCharacterInfo == null) {
            return Collections.emptyList();
        }

        List<PriceSet> priceSets = priceSetDao.getAllForAllianceID(mainCharacterInfo.getAllianceID());
        for (PriceSet priceSet : priceSets) {
            StringBuilder stringBuilder = new StringBuilder(priceSet.getName());
            CharacterInfo attachedCharacterInfo = priceSet.getAttachedCharacterInfo();
            stringBuilder.append(" (").append(attachedCharacterInfo.getCorporationTicker()).append(", ").append(attachedCharacterInfo.getName()).append(")");
            priceSet.setName(stringBuilder.toString());
        }
        return priceSets;
    }
View Full Code Here


        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());
View Full Code Here

    }

    @Override
    public List<Blueprint> getCorporationBlueprints(Key<User> userKey) {
        User user = userDao.get(userKey);
        CharacterInfo mainCharacterInfo = user.getMainCharacterInfo();
        if (mainCharacterInfo == null || mainCharacterInfo.getCorporationID() == null) {
            return Collections.emptyList();
        }
        return blueprintDao.getAllForCorporationID(mainCharacterInfo.getCorporationID());
    }
View Full Code Here

    }

    @Override
    public List<Blueprint> getAllianceBlueprints(Key<User> userKey) {
        User user = userDao.get(userKey);
        CharacterInfo mainCharacterInfo = user.getMainCharacterInfo();
        if (mainCharacterInfo == null || mainCharacterInfo.getAllianceID() == null) {
            return Collections.emptyList();
        }
        return blueprintDao.getAllForAllianceID(mainCharacterInfo.getAllianceID());
    }
View Full Code Here

    @Override
    public UserDto map(User user, Class<UserDto> userDtoClass) {
        UserDto userDto = new UserDto();
        userDto.setId(user.getId());
        CharacterInfo mainCharacterInfo = user.getMainCharacterInfo();
        if (mainCharacterInfo != null) {
            CharacterDto mainCharacter = map(mainCharacterInfo, CharacterDto.class);
            userDto.setMainCharacter(mainCharacter);
        }
        return userDto;
View Full Code Here

        return attachedCharacterInfoDto;
    }

    @Override
    public CharacterInfo map(Character character, Class<CharacterInfo> characterInfoClass) {
        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());
        return characterInfo;
    }
View Full Code Here

            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);
View Full Code Here

            Long userID = Long.valueOf(req.getParameter("userID"));
            Long blueprintID = Long.valueOf(req.getParameter("blueprintID"));
            Long characterID = req.getParameter("characterID") == null ? null : Long.valueOf(req.getParameter("characterID"));
            Blueprint blueprint = blueprintDao.get(blueprintID, 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"));
                blueprint.setAttachedCharacterInfo(characterInfo);
            } else {
                blueprint.setAttachedCharacterInfo(null);
            }
            blueprintDao.putWithoutChecks(blueprint);
View Full Code Here

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            Long blueprintID = Long.valueOf(req.getParameter("blueprintID"));
            logger.debug("Checking blueprint for consistency: {}", blueprintID);
            Blueprint blueprint = blueprintDao.get(new Key<Blueprint>(Blueprint.class, blueprintID));
            CharacterInfo attachedCharacterInfo = blueprint.getAttachedCharacterInfo();
            if (attachedCharacterInfo == null) {
                logger.debug("Blueprint does not have attached character, skipping");
                return;
            }
            try {
                Character character = characterDao.get(new Key<Character>(Character.class, attachedCharacterInfo.getId()));
                logger.debug("Updating blueprint attached character information: {} ({})", character.getName(), character.getCharacterID());
                attachedCharacterInfo.setCharacterID(character.getCharacterID());
                attachedCharacterInfo.setName(character.getName());
                attachedCharacterInfo.setCorporationID(character.getCorporationID());
                attachedCharacterInfo.setCorporationName(character.getCorporationName());
                attachedCharacterInfo.setCorporationTicker(character.getCorporationTicker());
                attachedCharacterInfo.setAllianceID(character.getAllianceID());
                attachedCharacterInfo.setAllianceName(character.getAllianceName());
            } catch (NotFoundException e) {
                logger.warn("Attached character does not exist: {}", attachedCharacterInfo.getId());
                blueprint.setAttachedCharacterInfo(null);
            }
            blueprint.setUpdatedDate(new Date());
            blueprintDao.putWithoutChecks(blueprint);
        } catch (Throwable t) {
View Full Code Here

    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        try {
            Long priceSetID = Long.valueOf(req.getParameter("priceSetID"));
            logger.debug("Checking price set for consistency: {}", priceSetID);
            PriceSet priceSet = priceSetDao.get(new Key<PriceSet>(PriceSet.class, priceSetID));
            CharacterInfo attachedCharacterInfo = priceSet.getAttachedCharacterInfo();
            if (attachedCharacterInfo == null) {
                logger.debug("Price set does not have attached character, skipping");
                return;
            }
            try {
                Character character = characterDao.get(new Key<Character>(Character.class, attachedCharacterInfo.getId()));
                logger.debug("Updating price set attached character information: {} ({})", character.getName(), character.getCharacterID());
                attachedCharacterInfo.setCharacterID(character.getCharacterID());
                attachedCharacterInfo.setName(character.getName());
                attachedCharacterInfo.setCorporationID(character.getCorporationID());
                attachedCharacterInfo.setCorporationName(character.getCorporationName());
                attachedCharacterInfo.setCorporationTicker(character.getCorporationTicker());
                attachedCharacterInfo.setAllianceID(character.getAllianceID());
                attachedCharacterInfo.setAllianceName(character.getAllianceName());
            } catch (NotFoundException e) {
                logger.warn("Attached character does not exist: {}", attachedCharacterInfo.getId());
                priceSet.setAttachedCharacterInfo(null);
            }
            priceSetDao.putWithoutChecks(priceSet);
        } catch (Throwable t) {
            logger.error("Caught Throwable", t);
View Full Code Here

TOP

Related Classes of lv.odylab.evemanage.domain.user.CharacterInfo

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.