Examples of IOSKeyVaultEntry


Examples of com.sparc.knappsack.components.entities.IOSKeyVaultEntry

    @Autowired(required = true)
    private UserService userService;

    @Override
    public IOSKeyVaultEntry createKeyVaultEntry(KeyVaultEntryForm keyVaultEntryForm) {
        IOSKeyVaultEntry keyVaultEntry = null;
        User user = userService.getUserFromSecurityContext();

        if (keyVaultEntryForm != null && user != null && user.getActiveOrganization() != null) {
            Domain parentDomain = user.getActiveOrganization();
            if (parentDomain != null) {
                keyVaultEntry = new IOSKeyVaultEntry();
                keyVaultEntry.setName(StringUtils.trimTrailingWhitespace(keyVaultEntryForm.getName()));
                keyVaultEntry.setDistributionKeyPassword(keyVaultEntryForm.getDistributionKeyPassword());
                keyVaultEntry.setStorageConfiguration(getStorageConfiguration(parentDomain));
                keyVaultEntry.setParentDomain(parentDomain);

                List<Long> childDomainIds = keyVaultEntryForm.getChildDomainIds();
                List<Domain> childDomains =  domainService.get(childDomainIds.toArray(new Long[childDomainIds.size()]));
                keyVaultEntry.setChildDomains(childDomains);

                parentDomain.getKeyVaultEntries().add(keyVaultEntry);

                keyVaultEntryService.add(keyVaultEntry);

                // Must add AppFiles after KeyVaultEntry is already added in order to comply with AppFile.Storable constraint.
                keyVaultEntry.setDistributionCert(saveFile(keyVaultEntryForm.getDistributionCert(), parentDomain, keyVaultEntry));
                keyVaultEntry.setDistributionKey(saveFile(keyVaultEntryForm.getDistributionKey(), parentDomain, keyVaultEntry));
                keyVaultEntry.setDistributionProfile(saveFile(keyVaultEntryForm.getDistributionProfile(), parentDomain, keyVaultEntry));
            }
        }

        return keyVaultEntry;
    }
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.