Examples of DomainConfiguration


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

    public String domainConfiguration(Model model, @PathVariable Long domainId) {
        Domain domain = domainService.get(domainId);
        if (domain == null) {
            throw new EntityNotFoundException(String.format("Domain entity not found while viewing DomainConfiguration page: %s", domainId));
        }
        DomainConfiguration domainConfiguration = domain.getDomainConfiguration() == null ? new DomainConfiguration() : domain.getDomainConfiguration();
        DomainConfigurationForm domainConfigurationForm = getDomainConfigurationForm(domain.getId(), domainConfiguration);

        model.addAttribute("domain", domain);
        model.addAttribute("domainConfiguration", domainConfigurationForm);
        model.addAttribute("domainType", domain.getDomainType().name());
View Full Code Here

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

        if (domain == null) {
            throw new EntityNotFoundException(String.format("Domain entity not found while saving DomainConfiguration: %s", domainConfigurationForm.getDomainId()));
        }
        model.addAttribute("domain", domain);

        DomainConfiguration domainConfiguration = getDomainConfiguration(domain, domainConfigurationForm);
        domainConfigurationService.update(domainConfiguration);
        model.addAttribute("domainConfiguration", domainConfigurationForm);
        model.addAttribute("domainType", domain.getDomainType().name());
        model.addAttribute("success", true);
        setSideBarNavAttribute(model, domain.getDomainType());
View Full Code Here

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

        return domainConfigurationForm;
    }

    private DomainConfiguration getDomainConfiguration(Domain domain, DomainConfigurationForm domainConfigurationForm) {
        DomainConfiguration domainConfiguration = domain.getDomainConfiguration() == null ? new DomainConfiguration() : domain.getDomainConfiguration();
        domainConfiguration.setMonitorBandwidth(domainConfigurationForm.isMonitorBandwidth());
        //First check to see if the new bandwidth limit amount is higher than the existing limit.  If it is reset the bandwidth limit reached flag to false.
        if(domainConfigurationForm.getMegabyteBandwidthLimit() > domainConfiguration.getMegabyteBandwidthLimit()) {
            domainConfiguration.setBandwidthLimitReached(false);
        }
        domainConfiguration.setMegabyteBandwidthLimit(domainConfigurationForm.getMegabyteBandwidthLimit());
        domainConfiguration.setApplicationLimit(domainConfigurationForm.getApplicationLimit());
        domainConfiguration.setApplicationVersionLimit(domainConfigurationForm.getApplicationVersionLimit());
        domainConfiguration.setDisabledDomain(domainConfigurationForm.isDisabled());
        domainConfiguration.setDisableLimitValidations(domainConfigurationForm.isDisableLimitValidations());
        domainConfiguration.setMegabyteStorageLimit(domainConfigurationForm.getMegabyteStorageLimit());
        domainConfiguration.setUserLimit(domainConfigurationForm.getUserLimit());
        domainConfiguration.setApplicationResignerEnabled(domainConfigurationForm.isApplicationResignerEnabled());
        domainConfiguration.setCustomBrandingEnabled(domainConfigurationForm.isCustomBrandingEnabled());

        return domainConfiguration;
    }
View Full Code Here

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

        return false;
    }


    private boolean validateOrganizationUserLimit(Set<String> emails, Organization organization, Errors errors) {
        DomainConfiguration domainConfiguration = organization.getDomainConfiguration();
        if (domainConfiguration == null) {
            log.error(String.format("Null domainConfiguration for Organization with ID: %s", organization.getId()));
            errors.reject("invitationValidator.error.generic");
            return false;
        }

        long numEmailsWithoutInvitations = invitationService.countEmailsWithoutInvitationsForOrganization(emails, organization.getId(), true);

        long currentOrgUsers = organizationService.countOrganizationUsers(organization.getId(), true);
        long currentOrgPendingInvites = invitationService.countAllForOrganizationIncludingGroups(organization.getId());

        long totalUsers = currentOrgUsers + currentOrgPendingInvites;

        if (domainConfiguration.getUserLimit() < totalUsers + numEmailsWithoutInvitations) {
            String domainTypeMessage = messageSource.getMessage(DomainType.ORGANIZATION.getMessageKey(), null, LocaleContextHolder.getLocale());

            if (emails.size() > 1) {
                errors.reject("invitationValidator.domain.userLimit.multipleInvites", new Object[]{domainTypeMessage, domainConfiguration.getUserLimit(), totalUsers - domainConfiguration.getUserLimit()}, "");
            } else {
                errors.reject("invitationValidator.domain.userLimit", new Object[]{domainTypeMessage}, "");
            }
            return false;
        }
View Full Code Here

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

            validateOrganizationApplicationLimit(organization, errors);
        }
    }

    private void validateOrganizationApplicationLimit(Organization organization, Errors errors) {
        DomainConfiguration domainConfiguration = organization.getDomainConfiguration();
        if(domainConfiguration.isDisabledDomain()) {
            errors.reject("applicationValidator.organization.disabled");
        }

        if(domainConfiguration.isDisableLimitValidations()) {
            return;
        }

        if(organizationService.isApplicationLimit(organization)) {
            errors.reject("applicationValidator.organization.applicationLimit");
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGACore.DomainConfiguration

    private void assingRoleToDefaultManager(WGDatabase db, WGACL acl, ACLRole role) {

        try {
            // Retrieve default manager
            DomainConfiguration domain = _core.getDomainConfigForDatabase(db);
            if (domain == null || domain.getDefaultManager() == null) {
                return;
            }
           
            // Retrieve ACL entry for default manager
            WGACLEntry aclEntry = acl.getEntry(domain.getDefaultManager());
            if (aclEntry == null) {
                acl.createUserEntry(domain.getDefaultManager(), WGDatabase.ACCESSLEVEL_MANAGER);
            }
           
            // Modify flags to include role and store
            WGACLEntryFlags flags = acl.parseFlags(aclEntry);
            if (!flags.getRoles().contains(role.getName())) {
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGACore.DomainConfiguration

   
    public int login(WGDatabase db, String username, String password) throws WGAPIException {
       
       
        String domain = (String) db.getAttribute(WGACore.DBATTRIB_DOMAIN);
        DomainConfiguration domainConfig = _core.getDomainConfig(domain);
        LoginAttemptInformation inf = getLoginAttemptInformation(domain, username);
        if (inf != null && inf.isBlocked()) {
            LOG.warn("Failed login for '" + username + "': Username is blocked because of too many wrong login attempts (Brute force login blocker on database " + db.getDbReference() + ")");
            return WGDatabase.ACCESSLEVEL_NOTLOGGEDIN;
        }
       
        int level = (db.isSessionOpen() ? db.reopenSession(username, password) : db.openSession(username, password));
        
        if (level == WGDatabase.ACCESSLEVEL_NOTLOGGEDIN) {
            if (inf == null) {
                inf = new LoginAttemptInformation(domain, username, domainConfig.getMaximumLoginAttempts());
                inf.map(_failedLoginAttempts);
            }
            inf.addFailedAttempt();
           
            if (inf.isBlocked()) {
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGACore.DomainConfiguration


  public RemoteSession login(String domain, String user, String pwd) throws WGAServiceException {
    WGAConfiguration config = _core.getWgaConfiguration();

        DomainConfiguration domainConfig = _core.getDomainConfig(domain);
        if (domainConfig == null) {
            throw new WGAServiceException("Unknown domain '" + domain + "'");
        }
       
        if (domainConfig.getAuthModule() != null) {
            try {
                if (_core.getBruteForceLoginBlocker().login(domainConfig, user, pwd) == null) {
                    throw new WGAServiceException("Invalid login");  
                }
            }
            catch (AuthenticationException e) {
                throw new WGAServiceException("Authentication exception logging into domain '" + domain + "': " + e.getMessage());
            }
        }
       
        return new RemoteSession(domainConfig.getName(), user, pwd);
  }
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGACore.DomainConfiguration

            }
           
            // Normal db user login
            if (session.getDomain() != null) {
              
                DomainConfiguration domainConfig = _core.getDomainConfigForDatabase(db);
                if (!domainConfig.getName().equals(session.getDomain())) {
                    throw new WGAServiceException("The database '" + db.getDbReference() + "' is not in domain '" + session.getDomain() + "'");
                }
               
                if (_core.getBruteForceLoginBlocker().login(db, session.getUsername(), session.getPassword()) <= WGDatabase.ACCESSLEVEL_NOACCESS) {
                    throw new WGAServiceException("Login is invalid or no access to database '" + dbkey + "'");
View Full Code Here

Examples of de.innovationgate.wgpublisher.WGACore.DomainConfiguration

       
        if (!_ready) {
            return null;
        }
       
        DomainConfiguration conf = _core.getDomainConfig(_domainName);
        if (conf != null) {       
            return conf.getAuthModule();
        }
        else {
            return null;
        }
    }
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.