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

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


    @PreAuthorize("hasRole('CONFIGURATION_CREATE')")
    @RequestMapping(method = RequestMethod.POST, value = "/create")
    public ConfigurationTO create(final HttpServletResponse response,
            @RequestBody final ConfigurationTO configurationTO) {

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

        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);
        return confToDelete;
    }
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);
        } catch (MissingConfKeyException e) {
            LOG.error("Could not find configuration key '" + key + "', returning null");

            result = new ConfigurationTO();
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());
        return binder.getConfigurationTO(conf);
    }
View Full Code Here

    @Autowired
    private ConfDAO confDAO;

    @Test
    public void issueSYNCOPE418() {
        SyncopeConf conf = new SyncopeConf();
        conf.setKey("http://schemas.examples.org/security/authorization/organizationUnit");

        try {
            confDAO.save(conf);
            fail();
        } catch (InvalidEntityException e) {
View Full Code Here

    }

    @Before
    public void setupSMTP() {
        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 dataBinder;

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

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

        SecurityContextHolder.getContext().setAuthentication(authentication);
    }

    @Before
    public void setupSMTP() throws Exception {
        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);
        confDAO.flush();
    }
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 = configurationDataBinder.createSyncopeConfiguration(configurationTO);
        conf = confDAO.save(conf);

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

        response.setStatus(HttpServletResponse.SC_CREATED);

        return configurationDataBinder.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) throws MissingConfKeyException {

        SyncopeConf conf = confDAO.find(key);
        ConfigurationTO confToDelete = configurationDataBinder.getConfigurationTO(conf);
        confDAO.delete(key);

        auditManager.audit(Category.configuration, ConfigurationSubCategory.delete, Result.success,
                "Successfully deleted conf: " + key);
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.