org.rhq.enterprise.server.install.remote
Class RemoteInstallManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.install.remote.RemoteInstallManagerBean
All Implemented Interfaces:
RemoteInstallManagerLocal, RemoteInstallManagerRemote

public class RemoteInstallManagerBean
extends Object
implements RemoteInstallManagerLocal, RemoteInstallManagerRemote

Installs, starts and stops remote agents via SSH.

Author:
Greg Hinkle, John Mazzitelli

Constructor Summary
RemoteInstallManagerBean()
           
 
Method Summary
 boolean agentInstallCheck(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
          Checks to see if an agent is installed in the given directory.
 String agentStatus(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
          Determines the running status of the agent located in the given installation directory.
 String findAgentInstallPath(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String parentPath)
          Given a root parent path to check, this will scan all subdirectories (recursively) to try to find where the agent is installed (if it is installed at all).
 org.rhq.core.domain.install.remote.AgentInstallInfo installAgent(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String parentPath)
          Installs the agent update binary distribution file to the given parent directory.
 String[] remotePathDiscover(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String parentPath)
          Returns the given parent directory's child files/directories.
 String startAgent(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
          Starts the agent located in the given installation directory.
 String stopAgent(org.rhq.core.domain.auth.Subject subject, org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo, String agentInstallPath)
          Stops the agent located in the given installation directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteInstallManagerBean

public RemoteInstallManagerBean()
Method Detail

agentInstallCheck

public boolean agentInstallCheck(org.rhq.core.domain.auth.Subject subject,
                                 org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                                 String agentInstallPath)
Description copied from interface: RemoteInstallManagerRemote
Checks to see if an agent is installed in the given directory.

Specified by:
agentInstallCheck in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
agentInstallPath - the directory to check
Returns:
true if an agent is installed in the given install path, false if not

installAgent

public org.rhq.core.domain.install.remote.AgentInstallInfo installAgent(org.rhq.core.domain.auth.Subject subject,
                                                                        org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                                                                        String parentPath)
Description copied from interface: RemoteInstallManagerRemote
Installs the agent update binary distribution file to the given parent directory. Note that the agent's install directory will be a child of the given parent directory, with that child install directory usually named "rhq-agent".

Specified by:
installAgent in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
parentPath - where the agent install directory will be
Returns:
info containing the results of the installation

startAgent

public String startAgent(org.rhq.core.domain.auth.Subject subject,
                         org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                         String agentInstallPath)
Description copied from interface: RemoteInstallManagerRemote
Starts the agent located in the given installation directory.

Specified by:
startAgent in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
agentInstallPath - where the agent is installed
Returns:
results of the start command

stopAgent

public String stopAgent(org.rhq.core.domain.auth.Subject subject,
                        org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                        String agentInstallPath)
Description copied from interface: RemoteInstallManagerRemote
Stops the agent located in the given installation directory.

Specified by:
stopAgent in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
agentInstallPath - where the agent is installed
Returns:
results of the stop command

agentStatus

public String agentStatus(org.rhq.core.domain.auth.Subject subject,
                          org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                          String agentInstallPath)
Description copied from interface: RemoteInstallManagerRemote
Determines the running status of the agent located in the given installation directory.

Specified by:
agentStatus in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
agentInstallPath - where the agent is installed
Returns:
results of the status command

findAgentInstallPath

public String findAgentInstallPath(org.rhq.core.domain.auth.Subject subject,
                                   org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                                   String parentPath)
Description copied from interface: RemoteInstallManagerRemote
Given a root parent path to check, this will scan all subdirectories (recursively) to try to find where the agent is installed (if it is installed at all). If parentPath is null or empty, the more common locations where agents are normally installed will be scanned. Returns the path to the first location where an agent is probably installed; null is returned if it does not look like the agent is installed anywhere under the given parent path (or in any of the common locations, if parent path is null).

Specified by:
findAgentInstallPath in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
parentPath - the parent directory whose children files/directories are scanned
Returns:
the probable location of an installed agent; null if no agent install was found

remotePathDiscover

public String[] remotePathDiscover(org.rhq.core.domain.auth.Subject subject,
                                   org.rhq.core.domain.install.remote.RemoteAccessInfo remoteAccessInfo,
                                   String parentPath)
Description copied from interface: RemoteInstallManagerRemote
Returns the given parent directory's child files/directories.

Specified by:
remotePathDiscover in interface RemoteInstallManagerRemote
Parameters:
subject - the RHQ user making the request
remoteAccessInfo - the remote machine information and remote user SSH credentials
parentPath - the parent directory whose children files/directories are returned
Returns:
names of the parent's child files/directories


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.