Examples of CharacterInfo


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

            logger.debug("User does not have any characters, setting main character to null, main character corporation titles to null and character infos to null");
            user.setCharacterInfos(null);
            user.setMainCharacterInfo(null);
            user.setMainCharacterCorporationTitles(null);
        } else if (user.getMainCharacterInfo() == null) {
            CharacterInfo characterInfo = characterInfos.get(0);
            logger.debug("User does not have main character, will set to first random: {} ({})", characterInfo.getName(), characterInfo.getCharacterID());
            user.setMainCharacterInfo(characterInfo);
        } else {
            CharacterInfo mainCharacterInfo = user.getMainCharacterInfo();
            Long mainCharacterID = mainCharacterInfo.getCharacterID();
            logger.debug("Checking whether current main character still exists: {} ({})", mainCharacterInfo.getName(), mainCharacterID);
            for (CharacterInfo characterInfo : characterInfos) {
                if (characterInfo.getCharacterID().equals(mainCharacterID)) {
                    logger.debug("Current main character exists, updating only list of character infos");
                    user.setCharacterInfos(characterInfos);
                    userDao.put(user);
                    return;
                }
            }
            CharacterInfo characterInfo = characterInfos.get(0);
            logger.debug("Current main character does not exist, will set to first random: {} ({})", characterInfo.getName(), characterInfo.getCharacterID());
            user.setMainCharacterInfo(characterInfo);
        }
        CharacterInfo mainCharacterInfo = user.getMainCharacterInfo();
        if (mainCharacterInfo != null) {
            Character character = characterDao.get(new Key<Character>(Character.class, mainCharacterInfo.getId()));
            List<String> corporationTitles = character.getCorporationTitles();
            logger.debug("Setting main character corporation titles: {}", corporationTitles);
            user.setMainCharacterCorporationTitles(corporationTitles);
        }
        userDao.put(user);
View Full Code Here

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

    private List<CharacterInfo> createCharacterInfos(Key<lv.odylab.evemanage.domain.user.User> userKey) {
        List<CharacterInfo> characterInfos = new ArrayList<CharacterInfo>();
        List<lv.odylab.evemanage.domain.eve.Character> characters = characterDao.getAll(userKey);
        for (lv.odylab.evemanage.domain.eve.Character character : characters) {
            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());
            characterInfos.add(characterInfo);
        }
        return characterInfos;
    }
View Full Code Here

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

    }

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

        List<PriceSet> priceSets = priceSetDao.getAllForCorporationID(mainCharacterInfo.getCorporationID());
        for (PriceSet priceSet : priceSets) {
            StringBuilder stringBuilder = new StringBuilder(priceSet.getName());
            stringBuilder.append(" (").append(priceSet.getAttachedCharacterInfo().getName()).append(")");
            priceSet.setName(stringBuilder.toString());
        }
View Full Code Here

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

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

        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

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

    }

    @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

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

    }

    @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

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

    @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

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

        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

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

            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
TOP
Copyright © 2018 www.massapi.com. 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.