Examples of PasswordEncoding


Examples of org.apache.cayenne.conf.PasswordEncoding

    public String getDataSourceUrl() {
        return dataSourceUrl;
    }

    public PasswordEncoding getPasswordEncoder() {
        PasswordEncoding encoder = null;

        try {
            encoder = (PasswordEncoding) Thread
                    .currentThread()
                    .getContextClassLoader()
View Full Code Here

Examples of org.apache.cayenne.conf.PasswordEncoding

    public String getDataSourceUrl() {
        return dataSourceUrl;
    }

    public PasswordEncoding getPasswordEncoder() {
        PasswordEncoding encoder = null;

        try {
            encoder = (PasswordEncoding) Thread
                    .currentThread()
                    .getContextClassLoader()
View Full Code Here

Examples of org.apache.cayenne.conf.PasswordEncoding

    public String getDataSourceUrl() {
        return dataSourceUrl;
    }

    public PasswordEncoding getPasswordEncoder() {
        PasswordEncoding encoder = null;

        try {
            encoder = (PasswordEncoding) Thread
                    .currentThread()
                    .getContextClassLoader()
View Full Code Here

Examples of org.apache.cayenne.configuration.PasswordEncoding

                // & URL options
                if (encoderKey != null) {
                    passwordSource = passwordSource.replaceAll("\\{\\}", encoderKey);
                }

                PasswordEncoding passwordEncoder = dataSourceDescriptor
                        .getPasswordEncoder();

                if (passwordLocation != null) {
                    if (passwordLocation
                            .equals(DataSourceInfo.PASSWORD_LOCATION_CLASSPATH)) {

                        ClassLoader classLoader = Thread
                                .currentThread()
                                .getContextClassLoader();
                        URL url = classLoader.getResource(username);
                        if (url != null) {
                            password = passwordFromURL(url);
                        }
                        else {
                            logger.error("Could not find resource in CLASSPATH: "
                                    + passwordSource);
                        }
                    }
                    else if (passwordLocation
                            .equals(DataSourceInfo.PASSWORD_LOCATION_URL)) {
                        try {
                            password = passwordFromURL(new URL(passwordSource));
                        }
                        catch (MalformedURLException exception) {
                            logger.warn(exception);
                        }
                    }
                    else if (passwordLocation
                            .equals(DataSourceInfo.PASSWORD_LOCATION_EXECUTABLE)) {
                        if (passwordSource != null) {
                            try {
                                Process process = Runtime.getRuntime().exec(
                                        passwordSource);
                                password = passwordFromInputStream(process
                                        .getInputStream());
                                process.waitFor();
                            }
                            catch (IOException exception) {
                                logger.warn(exception);
                            }
                            catch (InterruptedException exception) {
                                logger.warn(exception);
                            }
                        }
                    }
                }

                if (password != null && passwordEncoder != null) {
                    dataSourceDescriptor.setPassword(passwordEncoder.decodePassword(
                            password,
                            encoderKey));
                }
            }
            else if (localName.equals("url")) {
View Full Code Here

Examples of org.apache.cayenne.configuration.PasswordEncoding

                // & URL options
                if (encoderKey != null) {
                    passwordSource = passwordSource.replaceAll("\\{\\}", encoderKey);
                }

                PasswordEncoding passwordEncoder = dataSourceDescriptor
                        .getPasswordEncoder();

                if (passwordLocation != null) {
                    if (passwordLocation
                            .equals(DataSourceInfo.PASSWORD_LOCATION_CLASSPATH)) {

                        ClassLoader classLoader = Thread
                                .currentThread()
                                .getContextClassLoader();
                        URL url = classLoader.getResource(username);
                        if (url != null) {
                            password = passwordFromURL(url);
                        }
                        else {
                            // ignoring..
                        }
                    }
                    else if (passwordLocation
                            .equals(DataSourceInfo.PASSWORD_LOCATION_URL)) {
                        try {
                            password = passwordFromURL(new URL(passwordSource));
                        }
                        catch (MalformedURLException exception) {
                            // ignoring...
                        }
                    }
                    else if (passwordLocation
                            .equals(DataSourceInfo.PASSWORD_LOCATION_EXECUTABLE)) {
                        if (passwordSource != null) {
                            try {
                                Process process = Runtime.getRuntime().exec(
                                        passwordSource);
                                password = passwordFromInputStream(process
                                        .getInputStream());
                                process.waitFor();
                            }
                            catch (IOException exception) {
                                // ignoring...
                            }
                            catch (InterruptedException exception) {
                                // ignoring...
                            }
                        }
                    }
                }

                if (password != null && passwordEncoder != null) {
                    dataSourceDescriptor.setPassword(passwordEncoder.decodePassword(
                            password,
                            encoderKey));
                }
            }
            else if (localName.equals("url")) {
View Full Code Here

Examples of org.apache.cayenne.configuration.PasswordEncoding

        encoder.print("<login");
        encoder.printAttribute("userName", userName);

        if (DataSourceInfo.PASSWORD_LOCATION_MODEL.equals(passwordLocation)) {

            PasswordEncoding passwordEncoder = getPasswordEncoder();

            if (passwordEncoder != null) {
                String passwordEncoded = passwordEncoder.encodePassword(
                        password,
                        passwordEncoderKey);
                encoder.printAttribute("password", passwordEncoded);
            }
        }
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.