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

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

public class YumProxy
extends java.lang.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(java.util.Collection<java.lang.String> packages)
          Install the specified packages.
 void remove(java.util.Collection<java.lang.String> packages)
          Remove the specified packages.
 void update()
          Update packages Equal to "yum update"
 java.lang.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 java.lang.String version()
                         throws java.lang.Exception
Get the version of the yum executable. Equal to "yum --version".

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

install

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

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

remove

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

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

cleanMetadata

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

Throws:
java.lang.Exception - On any error.

update

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

Throws:
java.lang.Exception - On any error.


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