Examples of JDBCSecurityServiceConfig


Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

    }

    @Override
    protected void initializeComponents() {
        super.initializeComponents();
        JDBCSecurityServiceConfig config = (JDBCSecurityServiceConfig) configHelper.getConfig();
       if (config.isJndi()) {
           comp = new JDBCConnectFormComponent("jdbcConnectFormComponent",Mode.DYNAMIC,config.getJndiName());
       } else {
           comp = new JDBCConnectFormComponent("jdbcConnectFormComponent",Mode.DYNAMIC,
                   config.getDriverClassName(),config.getConnectURL(),
                   config.getUserName(),config.getPassword()
                   );
       }
        addOrReplace(comp);

        add(creatingTablesComponent=new CheckBox("config.creatingTables"));
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

        super.updateModel();
        comp.updateModel();
        creatingTablesComponent.updateModel();
        propertyFileNameDDLComponent.updateModel();
        propertyFileNameDMLComponent.updateModel();
        JDBCSecurityServiceConfig config = (JDBCSecurityServiceConfig) configHelper.getConfig();
        JDBCConnectConfig c = comp.getModelObject();
        config.setJndiName(null);
        config.setDriverClassName(null);
        config.setConnectURL(null);
        config.setUserName(null);
        config.setPassword(null);
       
        config.setJndi(c.getType().equals(JDBCConnectConfig.TYPEJNDI));
        if (config.isJndi()) {
            config.setJndiName(c.getJndiName());
        } else {
            config.setDriverClassName(c.getDriverName());
            config.setConnectURL(c.getConnectURL());
            config.setUserName(c.getUsername());
            config.setPassword(c.getPassword());
        }
    }
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

    protected void initializeComponents() {
        super.initializeComponents();
        if (configHelper.isNew()) {
            comp = new JDBCConnectFormComponent("jdbcConnectFormComponent",Mode.DYNAMIC);
        } else {
            JDBCSecurityServiceConfig config = (JDBCSecurityServiceConfig) configHelper.getConfig();
           if (config.isJndi()) {
               comp = new JDBCConnectFormComponent("jdbcConnectFormComponent",Mode.DYNAMIC,config.getJndiName());
           } else {
               comp = new JDBCConnectFormComponent("jdbcConnectFormComponent",Mode.DYNAMIC,
                       config.getDriverClassName(),config.getConnectURL(),
                       config.getUserName(),config.getPassword()
                       );
           }
        }       
        addOrReplace(comp);       
       
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

        comp.updateModel();
        creatingTablesComponent.updateModel();
        propertyFileNameDDLComponent.updateModel();
        propertyFileNameDMLComponent.updateModel();

        JDBCSecurityServiceConfig config = (JDBCSecurityServiceConfig) configHelper.getConfig();
        JDBCConnectConfig c = comp.getModelObject();
        config.setJndiName(null);
        config.setDriverClassName(null);
        config.setConnectURL(null);
        config.setUserName(null);
        config.setPassword(null);
       
        config.setJndi(c.getType().equals(JDBCConnectConfig.TYPEJNDI));
        if (config.isJndi()) {
            config.setJndiName(c.getJndiName());
        } else {
            config.setDriverClassName(c.getDriverName());
            config.setConnectURL(c.getConnectURL());
            config.setUserName(c.getUsername());
            config.setPassword(c.getPassword());
        }
    }
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

    }

    @Override
    public void validate(SecurityRoleServiceConfig config) throws SecurityConfigException {
        super.validate(config);
        JDBCSecurityServiceConfig jdbcConfig = (JDBCSecurityServiceConfig) config;
       
        validateFileNames(jdbcConfig,JDBCRoleService.DEFAULT_DDL_FILE,JDBCRoleService.DEFAULT_DML_FILE);
        checkAutomaticTableCreation(jdbcConfig);
       
        if (jdbcConfig.isJndi())
            validateJNDI(jdbcConfig);
        else
            validateJDBC(jdbcConfig);
    }
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

    @Override
    public void validate(SecurityUserGroupServiceConfig config)
            throws SecurityConfigException {
        super.validate(config);
                       
        JDBCSecurityServiceConfig jdbcConfig = (JDBCSecurityServiceConfig) config;
       
        validateFileNames(jdbcConfig,JDBCUserGroupService.DEFAULT_DDL_FILE,JDBCUserGroupService.DEFAULT_DML_FILE);
        checkAutomaticTableCreation(jdbcConfig);
       
        if (jdbcConfig.isJndi())
            validateJNDI(jdbcConfig);
        else
            validateJDBC(jdbcConfig);
    }
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

     *
     * @param config
     * @throws IOException
     */
    public void initializeDSFromConfig(SecurityNamedServiceConfig namedConfig) throws IOException {
        JDBCSecurityServiceConfig config = (JDBCSecurityServiceConfig) namedConfig;
        if (config.isJndi()) {
            String jndiName = config.getJndiName();           
            try {
                Context initialContext = new InitialContext();
                datasource = (DataSource)initialContext.lookup(jndiName);
            } catch (NamingException e) {
                throw new IOException(e);
            }
        } else {           
            BasicDataSource bds = new BasicDataSource();
            bds.setDriverClassName(config.getDriverClassName());
            bds.setUrl(config.getConnectURL());
            bds.setUsername(config.getUserName());
            bds.setPassword(config.getPassword());
            bds.setDefaultAutoCommit(false);
            bds.setDefaultTransactionIsolation(DEFAULT_ISOLATION_LEVEL);
            bds.setMaxActive(10);
            datasource=bds;
        }
View Full Code Here

Examples of org.geoserver.security.jdbc.config.JDBCSecurityServiceConfig

       
        this.name=config.getName();
        initializeDSFromConfig(config);

        if (config instanceof JDBCSecurityServiceConfig) {
            JDBCSecurityServiceConfig jdbcConfig =
                (JDBCSecurityServiceConfig) config;
                       
            String fileNameDML =jdbcConfig.getPropertyFileNameDML();
            File file = checkORCreateJDBCPropertyFile(fileNameDML,getConfigRoot(),DEFAULT_DML_FILE);
            dmlProps = Util.loadUniversal(new FileInputStream(file));
                       
            String fileNameDDL =jdbcConfig.getPropertyFileNameDDL();
            if (fileNameDDL!=null && fileNameDDL.length()> 0 ) {
                file = checkORCreateJDBCPropertyFile(fileNameDDL, getConfigRoot(), DEFAULT_DDL_FILE);
                ddlProps = Util.loadUniversal(new FileInputStream(file));
                createTablesIfRequired((JDBCSecurityServiceConfig)config);
            }
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.