Package com.sparc.knappsack.models

Examples of com.sparc.knappsack.models.KeyVaultEntryModel


        model.addAttribute("isEdit", false);

        // Create a List of all KeyVaultEntries which are available for the given application.
        List<KeyVaultEntryModel> keyVaultEntryModels = new ArrayList<KeyVaultEntryModel>();
        for (KeyVaultEntry keyVaultEntry : keyVaultEntryService.getAllForDomainAndApplicationType(group, application.getApplicationType())) {
            KeyVaultEntryModel keyVaultEntryModel = keyVaultEntryService.convertToModel(keyVaultEntry);
            if (keyVaultEntry != null) {
                keyVaultEntryModels.add(keyVaultEntryModel);
            }
        }
        model.addAttribute("keyVaultEntries", keyVaultEntryModels);
View Full Code Here


            model.addAttribute("isEdit", true);

            // Create a List of all KeyVaultEntries which are available for the given application.
            List<KeyVaultEntryModel> keyVaultEntryModels = new ArrayList<KeyVaultEntryModel>();
            for (KeyVaultEntry keyVaultEntry : keyVaultEntryService.getAllForDomainAndApplicationType(group, application.getApplicationType())) {
                KeyVaultEntryModel keyVaultEntryModel = keyVaultEntryService.convertToModel(keyVaultEntry);
                if (keyVaultEntry != null) {
                    keyVaultEntryModels.add(keyVaultEntryModel);
                }
            }
            model.addAttribute("keyVaultEntries", keyVaultEntryModels);
View Full Code Here

        return keyVaultEntry;
    }

    @Override
    public KeyVaultEntryModel convertToModel(KeyVaultEntry keyVaultEntry) {
        KeyVaultEntryModel model = null;
        if (keyVaultEntry != null) {
            model = new KeyVaultEntryModel();
            model.setId(keyVaultEntry.getId());
            model.setName(keyVaultEntry.getName());

            Domain parentDomain = keyVaultEntry.getParentDomain();
            if (parentDomain != null) {
                DomainEntityService domainEntityService = domainEntityServiceFactory.getDomainEntityService(parentDomain.getDomainType());
                if (domainEntityService != null) {
                    model.setParentDomain(domainEntityService.createDomainModel(parentDomain));
                }
            }

            for (Domain childDomain : keyVaultEntry.getChildDomains()) {
                DomainEntityService domainEntityService = domainEntityServiceFactory.getDomainEntityService(childDomain.getDomainType());
                if (domainEntityService != null) {
                    model.getChildDomains().add(domainEntityService.createDomainModel(childDomain));
                }
            }

            model.setApplicationType(keyVaultEntry.getApplicationType());
            model.setCreateDate(keyVaultEntry.getCreateDate());

            User user = userService.getByEmail(keyVaultEntry.getChangedBy());
            if (user != null) {
                UserModel userModel = new UserModel();
                userModel.setFirstName(user.getFirstName());
                userModel.setLastName(user.getLastName());
                userModel.setEmail(user.getEmail());

                model.setCreatedBy(userModel);
            }
        }
        return model;
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.models.KeyVaultEntryModel

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.