Package org.apache.directory.studio.connection.core

Examples of org.apache.directory.studio.connection.core.PasswordsKeyStoreManager


        // Bind password
        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the password keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is loaded
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
            }
            else
            {
                // Asking the user to load the keystore
                if ( PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                {
                    passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
                }
            }
        }
        else
        {
View Full Code Here


        {
            // Checking of the connection passwords keystore is enabled
            if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
            {
                // Getting the passwords keystore manager
                PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                    .getPasswordsKeyStoreManager();

                // Checking if the keystore is not loaded
                if ( !passwordsKeyStoreManager.isLoaded() )
                {
                    // Asking the user to load the keystore
                    if ( !PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                    {
                        // The user failed to load the keystore and cancelled
                        return null;
                    }
                }

                // Getting the password
                String password = passwordsKeyStoreManager.getConnectionPassword( connectionParameter.getId() );

                // Checking if the bind password is available (the user chose to store the password)
                if ( password != null
                    && !"".equals( password ) ) //$NON-NLS-1$
                {
View Full Code Here

        // Bind password
        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the password keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is loaded
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
            }
            else
            {
                // Asking the user to load the keystore
                if ( PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                {
                    passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
                }
            }
        }
        else
        {
View Full Code Here

        // Bind password
        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the password keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is loaded
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
            }
            else
            {
                // Asking the user to load the keystore
                if ( PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                {
                    passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
                }
            }
        }
        else
        {
View Full Code Here

        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the password keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is loaded
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                bindPassword = passwordsKeyStoreManager.getConnectionPassword( parameter.getId() );
            }
        }
        else
        {
            bindPassword = parameter.getBindPassword();
View Full Code Here

        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the password keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is loaded
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                passwordsKeyStoreManager.storeConnectionPassword( parameter.getId(), getBindPassword() );
            }
        }
        else
        {
            parameter.setBindPassword( getBindPassword() );
View Full Code Here

        super( Messages.getString( "PasswordsKeystorePreferencePage.PasswordsKeystore" ) ); //$NON-NLS-1$
        super.setDescription( Messages
            .getString( "PasswordsKeystorePreferencePage.GeneralSettingsForPasswordsKeystore" ) ); //$NON-NLS-1$
        super.noDefaultAndApplyButton();

        passwordsKeyStoreManager = new PasswordsKeyStoreManager( TEMPORARY_KEYSTORE_FILENAME );
        connectionManager = ConnectionCorePlugin.getDefault().getConnectionManager();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public boolean performOk()
    {
        PasswordsKeyStoreManager globalPasswordsKeyStoreManager = ConnectionCorePlugin.getDefault()
            .getPasswordsKeyStoreManager();

        if ( enableKeystoreCheckbox.getSelection() )
        {
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                // First, let's save the temporary keystore manager
                try
                {
                    passwordsKeyStoreManager.save();
                }
                catch ( KeyStoreException e )
                {
                    ConnectionUIPlugin
                        .getDefault()
                        .getLog()
                        .log(
                            new Status( Status.ERROR, ConnectionUIConstants.PLUGIN_ID, Status.ERROR,
                                "Couldn't save the temporary password keystore.", e ) ); //$NON-NLS-1$
                }

                // Now, let's copy the temporary keystore as the global keystore
                try
                {
                    FileUtils.copyFile( getTemporaryKeystoreFile(), ConnectionCorePlugin.getDefault()
                        .getPasswordsKeyStoreManager().getKeyStoreFile() );
                }
                catch ( IOException e )
                {
                    ConnectionUIPlugin
                        .getDefault()
                        .getLog()
                        .log(
                            new Status( Status.ERROR, ConnectionUIConstants.PLUGIN_ID, Status.ERROR,
                                "Couldn't copy the temporary keystore as the global keystore.", e ) ); //$NON-NLS-1$
                }

                // Finally lets reload the global keystore
                try
                {
                    globalPasswordsKeyStoreManager.reload( passwordsKeyStoreManager.getMasterPassword() );
                }
                catch ( KeyStoreException e )
                {
                    ConnectionUIPlugin
                        .getDefault()
                        .getLog()
                        .log(
                            new Status( Status.ERROR, ConnectionUIConstants.PLUGIN_ID, Status.ERROR,
                                "Couldn't reload the global keystore file.", e ) ); //$NON-NLS-1$
                }

                // Clearing each connection password
                for ( Connection connection : connectionManager.getConnections() )
                {
                    connection.getConnectionParameter().setBindPassword( null );
                }

                // Saving the connections
                ConnectionCorePlugin.getDefault().getConnectionManager().saveConnections();

                // Saving the value to the preferences
                ConnectionCorePlugin.getDefault().getPluginPreferences()
                    .setValue( ConnectionCoreConstants.PREFERENCE_CONNECTIONS_PASSWORDS_KEYSTORE,
                        ConnectionCoreConstants.PREFERENCE_CONNECTIONS_PASSWORDS_KEYSTORE_ON );
            }
        }
        else
        {
            // Reseting the global passwords keystore
            globalPasswordsKeyStoreManager.reset();

            // Looking for connections passwords in the list
            if ( connectionsPasswordsBackup.size() > 0 )
            {
                // Adding them to the keystore
View Full Code Here

        // Bind password
        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the password keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is loaded
            if ( passwordsKeyStoreManager.isLoaded() )
            {
                passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
            }
            else
            {
                // Asking the user to load the keystore
                if ( PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                {
                    passwordsKeyStoreManager.storeConnectionPassword( connectionParameter.getId(), "secret" ); //$NON-NLS-1$
                }
            }
        }
        else
        {
View Full Code Here

        // Checking of the connection passwords keystore is enabled
        if ( PasswordsKeyStoreManagerUtils.isPasswordsKeystoreEnabled() )
        {
            // Getting the passwords keystore manager
            PasswordsKeyStoreManager passwordsKeyStoreManager = ConnectionCorePlugin.getDefault()
                .getPasswordsKeyStoreManager();

            // Checking if the keystore is not loaded
            if ( !passwordsKeyStoreManager.isLoaded() )
            {
                // Asking the user to load the keystore
                if ( !PasswordsKeyStoreManagerUtils.askUserToLoadKeystore() )
                {
                    // The user failed to load the keystore and cancelled
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.connection.core.PasswordsKeyStoreManager

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.