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

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


    public ConfigurationTO read(final HttpServletResponse response, @PathVariable("key") final String key)
            throws MissingConfKeyException {

        ConfigurationTO result;
        try {
            SyncopeConf conf = confDAO.find(key);
            result = configurationDataBinder.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(final HttpServletResponse response, @RequestBody final ConfigurationTO configurationTO)
            throws MissingConfKeyException {

        SyncopeConf conf = confDAO.find(configurationTO.getKey());
        conf.setValue(configurationTO.getValue());

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

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

    private ConfDAO confDAO;

    public ConnectorInfoManager getConnectorManager() throws NotFoundException, MissingConfKeyException {

        // 1. Bundles directory
        SyncopeConf connectorBundleDir = confDAO.find("connid.bundles.directory");

        // 2. Find bundles inside that directory
        File bundleDirectory = new File(connectorBundleDir.getValue());
        String[] bundleFiles = bundleDirectory.list();
        if (bundleFiles == null) {
            throw new NotFoundException("Bundles from dir " + connectorBundleDir.getValue());
        }

        List<URL> bundleFileURLs = new ArrayList<URL>();
        for (String file : bundleFiles) {
            try {
                bundleFileURLs.add(IOUtil.makeURL(bundleDirectory, file));
            } catch (Exception ignore) {
                // ignore exception and don't add bundle
                if (LOG.isDebugEnabled()) {
                    LOG.debug(bundleDirectory.toString() + "/" + file + "\"" + " is not a valid connector bundle.",
                            ignore);
                }
            }
        }
        if (bundleFileURLs.isEmpty()) {
            throw new NotFoundException("Bundles from dir " + connectorBundleDir.getValue());
        }
        LOG.debug("Bundle file URLs: {}", bundleFileURLs);

        // 3. Get connector info manager
        ConnectorInfoManager manager = ConnectorInfoManagerFactory.getInstance().getLocalManager(
View Full Code Here

@Component
public class ConfigurationDataBinder {

    public SyncopeConf createSyncopeConfiguration(final ConfigurationTO configurationTO) {

        SyncopeConf syncopeConfiguration = new SyncopeConf();
        syncopeConfiguration.setKey(configurationTO.getKey());
        syncopeConfiguration.setValue(configurationTO.getValue());

        return syncopeConfiguration;
    }
View Full Code Here

        return userTO;
    }

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

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

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

        notificationDAO.flush();

        // 2. use a real SMTP server
        try {
            SyncopeConf smtpHostConf = confDAO.find("smtp.host");
            smtpHostConf.setValue(smtpHost);
            confDAO.save(smtpHostConf);
        } catch (Exception e) {
            LOG.error("Unexpected exception", e);
            fail("Unexpected exception while setting SMTP host");
        }
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.