cern.jjar.repository
Class RepositoryXML

java.lang.Object
  extended by cern.jjar.repository.RepositoryXML
All Implemented Interfaces:
Repository

public class RepositoryXML
extends Object
implements Repository

A Repository holds one or several Stores.

Author:
Grzegorz Kruk

Field Summary
 
Fields inherited from interface cern.jjar.repository.Repository
REPOSITORY_FILE_NAME
 
Constructor Summary
RepositoryXML()
           
RepositoryXML(String defaultVersion)
           
 
Method Summary
 void addStore(RepositoryStore repositoryXMLStore)
           
 Product[] computeObsoleteProducts(Product product)
          Computes the obsolete versions of a certain product
 Product[] computeObsoleteVersionsForProduct(Product product)
          Computes a list of all obsolete versions for a given product
 Dependency[] getDependencies(Dependency[] dependenciesToResolve, boolean excludeTargets, Version defaultVersion)
          Returns array with all dependencies of given dependencies.
 Dependency[] getDependencies(Dependency dependencyToResolve, boolean excludeTarget, Version defaultVersion)
          Returns array with all dependencies of given dependency.
 Document getDocument()
          Returns the parsed document of the repository descriptor
 Product getProduct(String productName, Version version)
          Returns Product object with given name and version or null if not found in the repository.
 String getProductFilePath(String productName, Version version)
          Return URL of product's jar or null if product does not exist or product does not contain jar.
 URL getProductFileUrl(String productName, Version version)
          Return URL of product's jar or null if product does not exist or product does not contain jar.
 URL getProductionDescriptorRootDirURL()
          Returns the directory of production repository
 RepositoryStore getProductionStore()
          Returns the production repository store as defined by method @link RepositoryStore#isProduction()
static void main(String[] args)
           
 void printOut(Collection list)
           
 void printOut(Object[] list)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepositoryXML

public RepositoryXML(String defaultVersion)

RepositoryXML

public RepositoryXML()
Method Detail

addStore

public void addStore(RepositoryStore repositoryXMLStore)

getProductionStore

public RepositoryStore getProductionStore()
Description copied from interface: Repository
Returns the production repository store as defined by method @link RepositoryStore#isProduction()

Specified by:
getProductionStore in interface Repository
Returns:
production repository store

getDependencies

public Dependency[] getDependencies(Dependency dependencyToResolve,
                                    boolean excludeTarget,
                                    Version defaultVersion)
Description copied from interface: Repository
Returns array with all dependencies of given dependency.

Specified by:
getDependencies in interface Repository
Parameters:
dependencyToResolve - the dependency to resolve
excludeTarget - whether or not to include the target passed in parameter
defaultVersion - the default version to get is no version is specified
Returns:
the resolved dependencies after the tree of dependencies has been traversed

getDependencies

public Dependency[] getDependencies(Dependency[] dependenciesToResolve,
                                    boolean excludeTargets,
                                    Version defaultVersion)
Description copied from interface: Repository
Returns array with all dependencies of given dependencies.

Specified by:
getDependencies in interface Repository
Parameters:
dependenciesToResolve - the array of dependencies to resolve
excludeTargets - whether or not to include the targets passed in parameter
defaultVersion - the default version to get is no version is specified
Returns:
the resolved dependencies after the tree of dependencies has been traversed

getProductFileUrl

public URL getProductFileUrl(String productName,
                             Version version)
Return URL of product's jar or null if product does not exist or product does not contain jar.

Specified by:
getProductFileUrl in interface Repository
Parameters:
productName - the name of the product to get
version - the version of the product to get
Returns:
the URL of jar for given product and version.

getProductFilePath

public String getProductFilePath(String productName,
                                 Version version)
Return URL of product's jar or null if product does not exist or product does not contain jar.

Specified by:
getProductFilePath in interface Repository
Parameters:
productName - the name of the product to get
version - the version of the product to get
Returns:
the complete path of the jar from the root of the repository.

getProduct

public Product getProduct(String productName,
                          Version version)
Returns Product object with given name and version or null if not found in the repository.

Specified by:
getProduct in interface Repository
Parameters:
productName - the name of the product to get
version - the version of the product to get
Returns:
the product matching both the name and the version or null

getProductionDescriptorRootDirURL

public URL getProductionDescriptorRootDirURL()
Description copied from interface: Repository
Returns the directory of production repository

Specified by:
getProductionDescriptorRootDirURL in interface Repository
Returns:
URL

getDocument

public Document getDocument()
Description copied from interface: Repository
Returns the parsed document of the repository descriptor

Specified by:
getDocument in interface Repository
Returns:
Document

printOut

public void printOut(Object[] list)

printOut

public void printOut(Collection list)

computeObsoleteVersionsForProduct

public Product[] computeObsoleteVersionsForProduct(Product product)
Description copied from interface: Repository
Computes a list of all obsolete versions for a given product

Specified by:
computeObsoleteVersionsForProduct in interface Repository
Parameters:
product - the product for which to search for obsolete products
Returns:
Product[] A list of obsolete products

computeObsoleteProducts

public Product[] computeObsoleteProducts(Product product)
Description copied from interface: Repository
Computes the obsolete versions of a certain product

Specified by:
computeObsoleteProducts in interface Repository
Parameters:
product - the product to be cleaned
Returns:

main

public static void main(String[] args)


Copyright © 2007 CERN. All Rights Reserved.