org.rhq.plugins.platform.content.yum
Class YumProxy

java.lang.Object
  extended by org.rhq.plugins.platform.content.yum.YumProxy

public class YumProxy
extends Object

Represents the yum command line tool.

Author:
jortel

Constructor Summary
YumProxy()
           
 
Method Summary
 void cleanMetadata()
          Clean the yum metadata Equal to "yum clean metadata"
 void init(ResourceContext resourceContext)
          Initialize the proxy with the current system information.
 void install(Collection<String> packages)
          Install the specified packages.
 void remove(Collection<String> packages)
          Remove the specified packages.
 void update()
          Update packages Equal to "yum update"
 String version()
          Get the version of the yum executable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YumProxy

public YumProxy()
Method Detail

init

public void init(ResourceContext resourceContext)
Initialize the proxy with the current system information. During which the fully qualified path to the yum executable is determined.

Parameters:
resourceContext - contains things like plugin config and system information

version

public String version()
               throws Exception
Get the version of the yum executable. Equal to "yum --version".

Returns:
The version string of the yum execuatble.
Throws:
Exception

install

public void install(Collection<String> packages)
             throws Exception
Install the specified packages. Equal to "yum -y install package, ...."

Parameters:
packages - A list of packages to install.
Throws:
Exception - On any error.

remove

public void remove(Collection<String> packages)
            throws Exception
Remove the specified packages. Equal to "yum -y remove package, ...."

Parameters:
packages - A list of packages to remove.
Throws:
Exception - On any error.

cleanMetadata

public void cleanMetadata()
                   throws Exception
Clean the yum metadata Equal to "yum clean metadata"

Throws:
Exception - On any error.

update

public void update()
            throws Exception
Update packages Equal to "yum update"

Throws:
Exception - On any error.


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