org.jboss.dtf.testframework.productrepository
Class ProductRepository

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.jboss.dtf.testframework.productrepository.ProductRepository
All Implemented Interfaces:
java.io.Serializable, java.rmi.Remote, ProductRepositoryInterface, DirectoryChangeListener

public class ProductRepository
extends java.rmi.server.UnicastRemoteObject
implements ProductRepositoryInterface, DirectoryChangeListener

See Also:
Serialized Form

Field Summary
static java.lang.String PRODUCT_REPOSITORY_NAMESERVICE_NAME
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
ProductRepository(NameServiceInterface ns)
           
 
Method Summary
 void fileAdded(java.io.File f)
           
 void fileChanged(java.io.File f)
           
 void fileDeleted(java.io.File f)
           
 long getCurrentVersion(java.lang.String name)
          Retrieves the current version number for the given product.
 ProductConfiguration getProductConfiguration(java.lang.String productName)
          Retrieve the product configuration for the given product name.
 java.net.URL getProductInstaller(java.lang.String name)
          Retrieves the URL to the ANT script for installing the product represented by the given unique name.
 java.lang.String[] getProductNames()
          List the products in the repository.
 boolean isCurrentVersion(java.lang.String name, long versionId)
          Used to check that the version of a product is the most recent version.
static void main(java.lang.String[] args)
           
 void remoteProductConfiguration(java.lang.String productName)
           
 void setProductConfiguration(java.lang.String productName, ProductConfiguration productConfiguration)
          Add or update a product configuration in the product repository.
 long setProductInstaller(java.lang.String name, java.net.URL antURL)
          Sets the install procedure for a given product in the repository.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PRODUCT_REPOSITORY_NAMESERVICE_NAME

public static final java.lang.String PRODUCT_REPOSITORY_NAMESERVICE_NAME
See Also:
Constant Field Values
Constructor Detail

ProductRepository

public ProductRepository(NameServiceInterface ns)
                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException
Method Detail

fileAdded

public void fileAdded(java.io.File f)
Specified by:
fileAdded in interface DirectoryChangeListener

fileChanged

public void fileChanged(java.io.File f)
Specified by:
fileChanged in interface DirectoryChangeListener

fileDeleted

public void fileDeleted(java.io.File f)
Specified by:
fileDeleted in interface DirectoryChangeListener

getProductConfiguration

public ProductConfiguration getProductConfiguration(java.lang.String productName)
                                             throws java.rmi.RemoteException
Retrieve the product configuration for the given product name.

Specified by:
getProductConfiguration in interface ProductRepositoryInterface
Parameters:
productName - The name of the product to retrieve.
Throws:
java.rmi.RemoteException

remoteProductConfiguration

public void remoteProductConfiguration(java.lang.String productName)
                                throws java.rmi.RemoteException
Specified by:
remoteProductConfiguration in interface ProductRepositoryInterface
Throws:
java.rmi.RemoteException

setProductConfiguration

public void setProductConfiguration(java.lang.String productName,
                                    ProductConfiguration productConfiguration)
                             throws java.rmi.RemoteException
Description copied from interface: ProductRepositoryInterface
Add or update a product configuration in the product repository.

Specified by:
setProductConfiguration in interface ProductRepositoryInterface
Throws:
java.rmi.RemoteException

getProductNames

public java.lang.String[] getProductNames()
                                   throws java.rmi.RemoteException
List the products in the repository.

Specified by:
getProductNames in interface ProductRepositoryInterface
Throws:
java.rmi.RemoteException

setProductInstaller

public long setProductInstaller(java.lang.String name,
                                java.net.URL antURL)
                         throws java.rmi.RemoteException
Sets the install procedure for a given product in the repository.

Specified by:
setProductInstaller in interface ProductRepositoryInterface
Parameters:
name - The unique name of the product the installer is for.
antURL - The URL to the ANT script used to install the product.
Returns:
The current product version id.
Throws:
java.rmi.RemoteException

getProductInstaller

public java.net.URL getProductInstaller(java.lang.String name)
                                 throws java.rmi.RemoteException
Retrieves the URL to the ANT script for installing the product represented by the given unique name.

Specified by:
getProductInstaller in interface ProductRepositoryInterface
Parameters:
name - The unique name of the product.
Returns:
The URL to the ANT script used to install the product, null if this product has no installer.
Throws:
java.rmi.RemoteException

isCurrentVersion

public boolean isCurrentVersion(java.lang.String name,
                                long versionId)
                         throws java.rmi.RemoteException
Used to check that the version of a product is the most recent version.

Specified by:
isCurrentVersion in interface ProductRepositoryInterface
Parameters:
name - The name of the product to check the version against.
versionId - The versionId to check against.
Returns:
True if the versionId is the current version (or if no installer exists), false otherwise.
Throws:
java.rmi.RemoteException

getCurrentVersion

public long getCurrentVersion(java.lang.String name)
                       throws java.rmi.RemoteException
Retrieves the current version number for the given product.

Specified by:
getCurrentVersion in interface ProductRepositoryInterface
Parameters:
name - The unique name of the product.
Returns:
The version number of this product (-1 if not found).
Throws:
java.rmi.RemoteException

main

public static void main(java.lang.String[] args)