Examples of SyncopeConf


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

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

    @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

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

    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

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

@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

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

        return userTO;
    }

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

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

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

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

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

        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

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

        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

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

    @Autowired
    private SchemaDAO schemaDAO;

    @Override
    public SyncopeConf get() {
        SyncopeConf instance = entityManager.find(SyncopeConf.class, 1L);
        if (instance == null) {
            instance = new SyncopeConf();
            instance.setId(1L);

            instance = entityManager.merge(instance);
        }

        return instance;
View Full Code Here

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

    @Override
    public SyncopeConf save(final CAttr attr) {
        delete(attr.getSchema().getName());

        SyncopeConf instance = get();
        instance.addAttr(attr);
        return entityManager.merge(instance);
    }
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.