org.apache.itest.pmanager
Class AptCmdLinePackageManager

java.lang.Object
  extended by org.apache.itest.pmanager.PackageManager
      extended by org.apache.itest.pmanager.AptCmdLinePackageManager
All Implemented Interfaces:
groovy.lang.GroovyObject

public class AptCmdLinePackageManager
extends PackageManager
implements groovy.lang.GroovyObject


Constructor Summary
AptCmdLinePackageManager()
           
 
Method Summary
 int addBinRepo(String record, String url, String key, String cookie)
          Register a binary package repository so that packages can be accessed from it.
 int cleanup()
          Clean up the repository cache
 List getContentList(PackageInstance pkg)
          List a content of a given package
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String name)
           
static String getRepository_registry()
           
 List getServices(PackageInstance pkg)
          Get a list of services (System V init scripts) provided by a given package
static String getType()
           
 int install(PackageInstance pkg)
          Install a given package (from collection of all the packages available in all the repositories)
 Object invokeMethod(String name, Object args)
           
 boolean isInstalled(PackageInstance pkg)
          Check if a given package is installed on the system
 int refresh()
          Refresh the cached data describing the content of all registered repositories
 int remove(PackageInstance pkg)
          Remove a given package that is already installed on the system
 List search(String name, String version)
          Search for a package in all registered repositories
 void setDefaults(String defaults)
          Set package manager specific default values
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
static void setRepository_registry(String value)
           
static void setType(String value)
           
 
Methods inherited from class org.apache.itest.pmanager.PackageManager
addBinRepo, getPackageManager, getPackageManager, getShRoot, getShUser, removeBinRepo, setShRoot, setShUser, svc_do
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AptCmdLinePackageManager

public AptCmdLinePackageManager()
Method Detail

getType

public static String getType()

setType

public static void setType(String value)

getRepository_registry

public static String getRepository_registry()

setRepository_registry

public static void setRepository_registry(String value)

setDefaults

public void setDefaults(String defaults)
Description copied from class: PackageManager
Set package manager specific default values

Specified by:
setDefaults in class PackageManager
Parameters:
defaults - String of default values encoded in a package manager specific way

addBinRepo

public int addBinRepo(String record,
                      String url,
                      String key,
                      String cookie)
Description copied from class: PackageManager
Register a binary package repository so that packages can be accessed from it. NOTE: repository management is assumed to follow a KVP API with unique implementation specific keys (records) referencing tuples of information describing a repository

Specified by:
addBinRepo in class PackageManager
Parameters:
record - a package manager specific KEY portion of the repository registration (null is default)
url - a URL containing the packages constituting the repository (null is default)
key - an optional (can be null) cryptographic key for authenticating the content of the repository
cookie - an optional, package manager specific opaque string
Returns:
int return code of the operation: o in case of success, non-zero otherwise

refresh

public int refresh()
Description copied from class: PackageManager
Refresh the cached data describing the content of all registered repositories

Specified by:
refresh in class PackageManager
Returns:
int return code of the operation: o in case of success, non-zero otherwise

cleanup

public int cleanup()
Description copied from class: PackageManager
Clean up the repository cache

Specified by:
cleanup in class PackageManager
Returns:
int return code of the operation: o in case of success, non-zero otherwise

search

public List search(String name,
                   String version)
Description copied from class: PackageManager
Search for a package in all registered repositories

Specified by:
search in class PackageManager
Parameters:
name - name of the package (inexact matches are ok)
version - a particular version of the package
Returns:
list of matching packages found in all registered repositories (can be empty)

install

public int install(PackageInstance pkg)
Description copied from class: PackageManager
Install a given package (from collection of all the packages available in all the repositories)

Specified by:
install in class PackageManager
Parameters:
pkg - a package to be installed
Returns:
int return code of the operation: o in case of success, non-zero otherwise

remove

public int remove(PackageInstance pkg)
Description copied from class: PackageManager
Remove a given package that is already installed on the system

Specified by:
remove in class PackageManager
Parameters:
pkg - a package to be installed
Returns:
int return code of the operation: o in case of success, non-zero otherwise

isInstalled

public boolean isInstalled(PackageInstance pkg)
Description copied from class: PackageManager
Check if a given package is installed on the system

Specified by:
isInstalled in class PackageManager
Parameters:
pkg - a package to be checked
Returns:
true if the package is installed and can be used, false otherwise

getServices

public List getServices(PackageInstance pkg)
Description copied from class: PackageManager
Get a list of services (System V init scripts) provided by a given package

Specified by:
getServices in class PackageManager
Parameters:
pkg - a package that is expected to provide 0, 1 or multiple services
Returns:
list of Service instances

getContentList

public List getContentList(PackageInstance pkg)
Description copied from class: PackageManager
List a content of a given package

Specified by:
getContentList in class PackageManager
Parameters:
pkg - a package that is expected to provide >1 entry in its content
Returns:
list file and directory names belong to the package.

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject
Overrides:
getMetaClass in class PackageManager

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject
Overrides:
setMetaClass in class PackageManager

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class PackageManager

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class PackageManager

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class PackageManager


Copyright © 2011. All Rights Reserved.