Package lv.odylab.evemanage.domain.eve

Examples of lv.odylab.evemanage.domain.eve.Character


    }

    @Test
    public void testLaunchForUpdate_NoAlliance() {
        when(googleAppEngineServices.getQueue("default")).thenReturn(queue);
        Character character = new Character();
        character.setCharacterID(1L);
        character.setName("characterName");
        character.setCorporationID(2L);
        character.setCorporationName("corporationName");
        character.setCorporationTicker("corporationTicker");
        List<Blueprint> blueprints = new ArrayList<Blueprint>();
        Blueprint blueprint1 = new Blueprint();
        blueprint1.setId(4L);
        Blueprint blueprint2 = new Blueprint();
        blueprint2.setId(5L);
View Full Code Here


            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

        logger.debug("Getting all detached characters with apiKey=null, some of them might get linked to new api key");
        List<Character> characters = characterDao.getAllWithoutApiKey(userKey);
        List<Character> updatedCharacters = new ArrayList<Character>();
        logger.debug("Processing new api key character infos and looking for detached characters that is present in new api key");
        for (ApiKeyCharacterInfo apiKeyCharacterInfo : apiKey.getCharacterInfos()) {
            Character character = findCharacterInApiKeyCharacterInfos(characters, apiKeyCharacterInfo);
            if (character != null) {
                logger.debug("Found character than can be linked to new api key: {} ({})", apiKeyCharacterInfo.getName(), apiKeyCharacterInfo.getCharacterID());
                if (character.getApiKey() == null) {
                    character.setApiKey(new Key<ApiKey>(ApiKey.class, apiKey.getId()));
                    eveApiDataService.populateCharacterData(character);
                    characterDao.put(character, userKey);
                    updatedCharacters.add(character);
                } else {
                    logger.debug("Character has api key, so there is no need for relinking");
View Full Code Here

    }

    @Override
    public void createCharacter(Long characterID, Key<User> userKey) throws EveApiException {
        Key<ApiKey> apiKeyKey = apiKeyDao.getWithCharacterID(characterID, userKey);
        Character character = new Character();
        character.setApiKey(apiKeyKey);
        character.setUser(userKey);
        character.setCharacterID(characterID);
        character.setCreatedDate(new Date());
        eveApiDataService.populateCharacterData(character);
        characterDao.put(character, userKey);

        eveSynchronizationService.synchronizeCreateCharacter(character, userKey);
    }
View Full Code Here

    }

    @Override
    public void deleteCharacter(Long characterID, Key<User> userKey) {
        Key<Character> characterKey = new Key<Character>(Character.class, characterID);
        Character character = characterDao.get(characterKey);
        characterDao.delete(characterKey, userKey);

        eveSynchronizationService.synchronizeDeleteCharacter(character.getCharacterID(), userKey);
    }
View Full Code Here

        blueprint.setProductGraphicIcon(blueprintTypeDto.getProductGraphicIcon());
        blueprint.setProductTypeCategoryID(blueprintTypeDto.getProductCategoryID());
        blueprint.setProductivityLevel(peLevel);
        blueprint.setMaterialLevel(meLevel);
        if (attachedCharacterID != null) {
            Character character = characterDao.getByCharacterID(attachedCharacterID, userKey);
            blueprint.setAttachedCharacterInfo(mapper.map(character, CharacterInfo.class));
        } else {
            blueprint.setAttachedCharacterInfo(null);
        }
        blueprint.setSharingLevel(sharingLevel);
View Full Code Here

        Blueprint blueprint = blueprintDao.get(blueprintID, userKey);
        blueprint.setItemID(itemID);
        blueprint.setMaterialLevel(meLevel);
        blueprint.setProductivityLevel(peLevel);
        if (attachedCharacterID != null) {
            Character character = characterDao.getByCharacterID(attachedCharacterID, userKey);
            blueprint.setAttachedCharacterInfo(mapper.map(character, CharacterInfo.class));
        } else {
            blueprint.setAttachedCharacterInfo(null);
        }
        blueprint.setSharingLevel(sharingLevel);
View Full Code Here

    public void setMainCharacter(String characterName, Key<lv.odylab.evemanage.domain.user.User> userKey) {
        lv.odylab.evemanage.domain.user.User user = userDao.get(userKey);
        List<CharacterInfo> characterInfos = user.getCharacterInfos();
        for (CharacterInfo characterInfo : characterInfos) {
            if (characterName.equals(characterInfo.getName())) {
                Character character = characterDao.get(new Key<Character>(Character.class, characterInfo.getId()));
                user.setMainCharacterInfo(characterInfo);
                user.setMainCharacterCorporationTitles(character.getCorporationTitles());
                userDao.put(user);
                return;
            }
        }
    }
View Full Code Here

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

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

TOP

Related Classes of lv.odylab.evemanage.domain.eve.Character

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.