Package org.apache.syncope.core.persistence.beans

Examples of org.apache.syncope.core.persistence.beans.SyncopeConf


        notificationDAO.flush();

        // 2. use test SMTP server
        try {
            SyncopeConf smtpHostConf = confDAO.find("smtp.host");
            smtpHostConf.setValue(smtpHost);
            confDAO.save(smtpHostConf);

            SyncopeConf smtpPortConf = confDAO.find("smtp.port");
            smtpPortConf.setValue(Integer.toString(smtpPort));
            confDAO.save(smtpPortConf);
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
            fail("Unexpected exception while setting SMTP host and port");
        }
View Full Code Here


    @Autowired
    private UserRequestDataBinder binder;

    public Boolean isCreateAllowedByConf() {
        final SyncopeConf createRequestAllowed = confDAO.find("createRequest.allowed", "false");

        return Boolean.valueOf(createRequestAllowed.getValue());
    }
View Full Code Here

        }
        if (localConnIdLocation == null) {
            throw new IllegalArgumentException("No local ConnId location was found, aborting");
        }

        SyncopeConf cipher = confDAO.find("password.cipher.algorithm");
        if ("MD5".equals(cipher.getValue())) {
            cipher.setValue(CipherAlgorithm.SMD5.name());
        }

        return localConnIdLocation.toString();
    }
View Full Code Here

    @RequestMapping(method = RequestMethod.POST, value = "/create")
    public ConfigurationTO create(final HttpServletResponse response,
            @RequestBody final ConfigurationTO configurationTO) {
        LOG.debug("Configuration create called with parameters {}", configurationTO);

        SyncopeConf conf = binder.create(configurationTO);
        conf = confDAO.save(conf);

        auditManager.audit(Category.configuration, ConfigurationSubCategory.create, Result.success,
                "Successfully created conf: " + conf.getKey());

        response.setStatus(HttpServletResponse.SC_CREATED);

        return binder.getConfigurationTO(conf);
    }
View Full Code Here

    }

    @PreAuthorize("hasRole('CONFIGURATION_DELETE')")
    @RequestMapping(method = RequestMethod.GET, value = "/delete/{key}")
    public ConfigurationTO delete(@PathVariable("key") final String key) {
        SyncopeConf conf = confDAO.find(key);
        ConfigurationTO confToDelete = binder.getConfigurationTO(conf);
        confDAO.delete(key);

        auditManager.audit(Category.configuration, ConfigurationSubCategory.delete, Result.success,
                "Successfully deleted conf: " + key);
View Full Code Here

    @PreAuthorize("hasRole('CONFIGURATION_READ')")
    @RequestMapping(method = RequestMethod.GET, value = "/read/{key}")
    public ConfigurationTO read(final HttpServletResponse response, @PathVariable("key") final String key) {
        ConfigurationTO result;
        try {
            SyncopeConf conf = confDAO.find(key);
            result = binder.getConfigurationTO(conf);

            auditManager.audit(Category.configuration, ConfigurationSubCategory.read, Result.success,
                    "Successfully read conf: " + key);
        } catch (MissingConfKeyException e) {
View Full Code Here

    }

    @PreAuthorize("hasRole('CONFIGURATION_UPDATE')")
    @RequestMapping(method = RequestMethod.POST, value = "/update")
    public ConfigurationTO update(@RequestBody final ConfigurationTO configurationTO) {
        SyncopeConf conf = confDAO.find(configurationTO.getKey());
        conf.setValue(configurationTO.getValue());

        auditManager.audit(Category.configuration, ConfigurationSubCategory.update, Result.success,
                "Successfully updated conf: " + conf.getKey());

        return binder.getConfigurationTO(conf);
    }
View Full Code Here

@Component
public class ConfigurationDataBinder {

    public SyncopeConf create(final ConfigurationTO configurationTO) {
        SyncopeConf syncopeConfiguration = new SyncopeConf();
        syncopeConfiguration.setKey(configurationTO.getKey());
        syncopeConfiguration.setValue(configurationTO.getValue());

        return syncopeConfiguration;
    }
View Full Code Here

@Repository
public class ConfDAOImpl extends AbstractDAOImpl implements ConfDAO {

    @Override
    public SyncopeConf find(final String name) throws MissingConfKeyException {
        SyncopeConf result = find(name, null);
        if (result == null) {
            throw new MissingConfKeyException(name);
        }

        return result;
View Full Code Here

        return result;
    }

    @Override
    public SyncopeConf find(final String name, final String defaultValue) {
        SyncopeConf syncopeConf = entityManager.find(SyncopeConf.class, name);

        if (syncopeConf == null && defaultValue != null) {
            syncopeConf = new SyncopeConf();
            syncopeConf.setKey(name);
            syncopeConf.setValue(defaultValue);
        }

        return syncopeConf;
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.beans.SyncopeConf

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.