Package org.rhq.core.domain.install.remote

Examples of org.rhq.core.domain.install.remote.RemoteAccessInfo


     *
     * @param subject user making the request
     * @param sshSession the session that is currently connected
     */
    private void processRememberMe(Subject subject, SSHInstallUtility sshSession) {
        RemoteAccessInfo remoteAccessInfo = sshSession.getRemoteAccessInfo();
        String agentName = remoteAccessInfo.getAgentName();

        if (agentName == null) {
            return; // nothing we can do, don't know what agent this is for
        }

        boolean credentialsOK = sshSession.isConnected();
        if (!credentialsOK) {
            return; // do not store anything - the credentials are probably bad and why we aren't connected so no sense remembering them
        }

        AgentInstall ai = agentManager.getAgentInstallByAgentName(subject, agentName);
        if (ai == null) {
            ai = new AgentInstall();
            ai.setAgentName(agentName);
        }

        // ai.setSshHost(remoteAccessInfo.getHost()); do NOT change the host
        ai.setSshPort(remoteAccessInfo.getPort());
        if (remoteAccessInfo.getRememberMe()) {
            ai.setSshUsername(remoteAccessInfo.getUser());
            ai.setSshPassword(remoteAccessInfo.getPassword());
        } else {
            // user doesn't want to remember the creds, set them to "" which tells our persistence layer to null them out
            ai.setSshUsername("");
            ai.setSshPassword("");
        }
View Full Code Here


        } catch (NumberFormatException e) {
            portInt = 22;
        }
        connectionForm.setValue("port", portInt);

        RemoteAccessInfo info = new RemoteAccessInfo(host, portInt, username, password);

        if (this.initialAgentInstall != null) {
            info.setAgentName(this.initialAgentInstall.getAgentName());
        }

        boolean rememberme = Boolean.parseBoolean(connectionForm.getValueAsString("rememberme"));
        info.setRememberMe(rememberme);

        info.setHostAuthorized(hostAuthorized);

        return info;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.install.remote.RemoteAccessInfo

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.