Package org.apache.cayenne.conn

Examples of org.apache.cayenne.conn.DataSourceInfo


    @Inject
    protected JdbcEventLogger jdbcEventLogger;

    public DataSource getDataSource(DataNodeDescriptor nodeDescriptor) throws Exception {

        DataSourceInfo dataSourceDescriptor = nodeDescriptor.getDataSourceDescriptor();
      

        if (dataSourceDescriptor == null) {
            String message = "Null dataSourceDescriptor for nodeDescriptor '"
                    + nodeDescriptor.getName()
                    + "'";
            logger.info(message);
            throw new ConfigurationException(message);
        }
       
        try {
            return new PoolManager(
                    dataSourceDescriptor.getJdbcDriver(),
                    dataSourceDescriptor.getDataSourceUrl(),
                    dataSourceDescriptor.getMinConnections(),
                    dataSourceDescriptor.getMaxConnections(),
                    dataSourceDescriptor.getUserName(),
                    dataSourceDescriptor.getPassword(),
                    jdbcEventLogger);
        }
        catch (Exception e) {
            jdbcEventLogger.logConnectFailure(e);
            throw e;
View Full Code Here


   
    @Override
    public void setNode(DataNodeDescriptor node) {
        if (!Util.nullSafeEquals(getNode(), node)) {
            if (node.getDataSourceDescriptor() == null) {
                node.setDataSourceDescriptor(new DataSourceInfo());
            }
            super.setNode(node);
        }
    }
View Full Code Here

        if (getNode() == null || getNode().getDataSourceDescriptor() == null) {
            return;
        }

        DataSourceInfo projectDSI = getNode().getDataSourceDescriptor();

        ProjectController parent = (ProjectController) getParent();
        String key = parent.getDataNodePreferences().getLocalDataSource();
        if (key == null) {
            mainController.updateStatus("No Local DataSource selected for node...");
View Full Code Here

    public void validatePasswordEncoderAction() {
        if (node == null || node.getDataSourceDescriptor() == null)
            return;

        DataSourceInfo dsi = node.getDataSourceDescriptor();

        if (view.getPasswordEncoder().getSelectedItem().equals(
                dsi.getPasswordEncoderClass()) == false)
            return;

        if (dsi.getPasswordEncoder() == null) {
            JOptionPane
                    .showMessageDialog(
                            getView(),
                            "A valid Password Encoder should be specified (check your CLASSPATH).",
                            "Invalid Password Encoder",
View Full Code Here

    public void passwordLocationChangedAction() {
        if (node == null || node.getDataSourceDescriptor() == null)
            return;

        DataSourceInfo dsi = node.getDataSourceDescriptor();

        String selectedItem = (String) view.getPasswordLocation().getSelectedItem();

        if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_CLASSPATH))
            updatePasswordElements(
                    true,
                    true,
                    dsi.getPassword(),
                    "Password Filename:",
                    dsi.getPasswordSourceFilename());
        else if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_EXECUTABLE))
            updatePasswordElements(false, true, null, "Password Executable:", dsi
                    .getPasswordSourceExecutable());
        else if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_MODEL))
            updatePasswordElements(
                    true,
                    false,
                    dsi.getPassword(),
                    "Password Source:",
                    dsi.getPasswordSourceModel());
        else if (selectedItem.equals(DataSourceInfo.PASSWORD_LOCATION_URL))
            updatePasswordElements(false, true, null, "Password URL:", dsi
                    .getPasswordSourceUrl());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.conn.DataSourceInfo

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.