Package com.sparc.knappsack.components.entities

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


    @Override
    public void delete(Long id) {
        Region region = get(id);

        if (region != null) {
            Domain domain = domainService.getDomainForRegion(region);

            if (domain != null) {
                domain.getRegions().remove(region);
            }
            regionDao.delete(region);
        }
    }
View Full Code Here


    @Override
    public Region createRegion(DomainRegionForm regionForm) {
        Region region = null;

        if (regionForm != null) {
            Domain domain = domainService.get(regionForm.getDomainId());

            if (domain != null) {
                region = new Region();
                region.setName(regionForm.getName());
                region.getEmails().addAll(regionForm.getEmails());

                domain.getRegions().add(region);

                add(region);
            }
        }
View Full Code Here

    }

    @Override
    public List<Region> getAllForDomain(Long domainId) {
        List<Region> regions = new ArrayList<Region>();
        Domain domain = domainService.get(domainId);

        if (domain != null) {
            regions.addAll(domain.getRegions());
        }

        return regions;
    }
View Full Code Here

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

                AppState currentAppState = determineCurrentAppState(currentApplicationVersion);

                // Make a copy of the original requested AppState in case the application version is to be resigned.
                AppState requestedAppState = applicationVersionForm.getAppState();

                Domain parentDomain = parentApplication.getOwnedGroup();

                // Only continue if the parent domain exists.
                if (parentDomain != null) {

                    // Set the application version AppState to Resigning if requested.
View Full Code Here

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

    @Override
    public DomainUserRequest createDomainUserRequest(User user, String accessCode) {
        DomainUserRequest domainUserRequest = null;
        if (user != null && accessCode != null && !accessCode.isEmpty()) {

            Domain domain = domainService.getByUUID(accessCode);

            if (domain != null) {

                //Check if user is already in group or not
                if (userDomainService.get(user, domain.getId()) == null) {
                    //Check if there is already a pendingRequest for this given user and this group
                    if (!doesRequestExist(user, domain, Status.PENDING)) {
                        domainUserRequest = new DomainUserRequest();
                        domainUserRequest.setDomain(domain);
                        domainUserRequest.setUser(user);
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.components.entities.Domain

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.