org.apache.oodt.cas.filemgr.system
Class XmlRpcFileManagerClient

java.lang.Object
  extended by org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient

public class XmlRpcFileManagerClient
extends Object

Version:
$Revision$

The XML RPC based file manager client.

Author:
mattmann (Chris Mattmann), bfoster (Brian Foster)

Constructor Summary
XmlRpcFileManagerClient(URL url)
           
XmlRpcFileManagerClient(URL url, boolean testConnection)
           Constructs a new XmlRpcFileManagerClient with the given url.
 
Method Summary
 void addMetadata(Product product, Metadata metadata)
           
 void addProductReferences(Product product)
           
 String addProductType(ProductType type)
           
 String catalogProduct(Product product)
           
 List<QueryResult> complexQuery(ComplexQuery complexQuery)
           
 Query getCatalogQuery(Query query, ProductType productType)
           
 Metadata getCatalogValues(Metadata metadata, ProductType productType)
           
 FileTransferStatus getCurrentFileTransfer()
           
 List<FileTransferStatus> getCurrentFileTransfers()
           
 DataTransfer getDataTransfer()
           
 Element getElementById(String elementId)
           
 Element getElementByName(String elementName)
           
 Element getElementByName(String elementName, ProductType type)
           
 List<Element> getElementsByProductType(ProductType type)
           
 URL getFileManagerUrl()
           
 ProductPage getFirstPage(ProductType type)
           
 ProductPage getLastPage(ProductType type)
           
 Metadata getMetadata(Product product)
           
 ProductPage getNextPage(ProductType type, ProductPage currPage)
           
 int getNumProducts(ProductType type)
           
 Metadata getOrigValues(Metadata metadata, ProductType productType)
           
 ProductPage getPrevPage(ProductType type, ProductPage currPage)
           
 Product getProductById(String productId)
           
 Product getProductByName(String productName)
           
 double getProductPctTransferred(Product product)
           
 List<Reference> getProductReferences(Product product)
           
 List<Product> getProductsByProductType(ProductType type)
           
 ProductType getProductTypeById(String productTypeId)
           
 ProductType getProductTypeByName(String productTypeName)
           
 List<ProductType> getProductTypes()
           
 Metadata getReducedMetadata(Product product, List elements)
           
 double getRefPctTransferred(Reference reference)
           
 List<Product> getTopNProducts(int n)
           
 List<Product> getTopNProducts(int n, ProductType type)
           
 boolean hasProduct(String productName)
           
 String ingestProduct(Product product, Metadata metadata, boolean clientTransfer)
           
 boolean isAlive()
           
 boolean isTransferComplete(Product product)
           
static void main(String[] args)
           
 boolean modifyProduct(Product product)
           
 boolean moveProduct(Product product, String newPath)
           
 ProductPage pagedQuery(Query query, ProductType type, int pageNum)
           
 List<Product> query(Query query, ProductType type)
           
 boolean refreshConfigAndPolicy()
           
 boolean removeFile(String filePath)
           
 boolean removeProduct(Product product)
           
 boolean removeProductTransferStatus(Product product)
           
 byte[] retrieveFile(String filePath, int offset, int numBytes)
           
 void setDataTransfer(DataTransfer dataTransfer)
           
 void setFileManagerUrl(URL fileManagerUrl)
           
 void setProductTransferStatus(Product product)
           
 void transferFile(String filePath, byte[] fileData, int offset, int numBytes)
           
 boolean transferringProduct(Product product)
           
 boolean updateMetadata(Product product, Metadata met)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlRpcFileManagerClient

public XmlRpcFileManagerClient(URL url)
                        throws ConnectionException
Throws:
ConnectionException

XmlRpcFileManagerClient

public XmlRpcFileManagerClient(URL url,
                               boolean testConnection)
                        throws ConnectionException

Constructs a new XmlRpcFileManagerClient with the given url.

Parameters:
url - The url pointer to the xml rpc file manager service.
testConnection - Whether or not to check if server at given url is alive.
Throws:
ConnectionException
Method Detail

refreshConfigAndPolicy

public boolean refreshConfigAndPolicy()

isAlive

public boolean isAlive()

transferringProduct

public boolean transferringProduct(Product product)
                            throws DataTransferException
Throws:
DataTransferException

removeProductTransferStatus

public boolean removeProductTransferStatus(Product product)
                                    throws DataTransferException
Throws:
DataTransferException

isTransferComplete

public boolean isTransferComplete(Product product)
                           throws DataTransferException
Throws:
DataTransferException

moveProduct

public boolean moveProduct(Product product,
                           String newPath)
                    throws DataTransferException
Throws:
DataTransferException

modifyProduct

public boolean modifyProduct(Product product)
                      throws CatalogException
Throws:
CatalogException

removeProduct

public boolean removeProduct(Product product)
                      throws CatalogException
Throws:
CatalogException

getCurrentFileTransfer

public FileTransferStatus getCurrentFileTransfer()
                                          throws DataTransferException
Throws:
DataTransferException

getCurrentFileTransfers

public List<FileTransferStatus> getCurrentFileTransfers()
                                                 throws DataTransferException
Throws:
DataTransferException

getProductPctTransferred

public double getProductPctTransferred(Product product)
                                throws DataTransferException
Throws:
DataTransferException

getRefPctTransferred

public double getRefPctTransferred(Reference reference)
                            throws DataTransferException
Throws:
DataTransferException

pagedQuery

public ProductPage pagedQuery(Query query,
                              ProductType type,
                              int pageNum)
                       throws CatalogException
Throws:
CatalogException

getFirstPage

public ProductPage getFirstPage(ProductType type)
                         throws CatalogException
Throws:
CatalogException

getLastPage

public ProductPage getLastPage(ProductType type)
                        throws CatalogException
Throws:
CatalogException

getNextPage

public ProductPage getNextPage(ProductType type,
                               ProductPage currPage)
                        throws CatalogException
Throws:
CatalogException

getPrevPage

public ProductPage getPrevPage(ProductType type,
                               ProductPage currPage)
                        throws CatalogException
Throws:
CatalogException

addProductType

public String addProductType(ProductType type)
                      throws RepositoryManagerException
Throws:
RepositoryManagerException

hasProduct

public boolean hasProduct(String productName)
                   throws CatalogException
Throws:
CatalogException

getNumProducts

public int getNumProducts(ProductType type)
                   throws CatalogException
Throws:
CatalogException

getTopNProducts

public List<Product> getTopNProducts(int n)
                              throws CatalogException
Throws:
CatalogException

getTopNProducts

public List<Product> getTopNProducts(int n,
                                     ProductType type)
                              throws CatalogException
Throws:
CatalogException

setProductTransferStatus

public void setProductTransferStatus(Product product)
                              throws CatalogException
Throws:
CatalogException

addProductReferences

public void addProductReferences(Product product)
                          throws CatalogException
Throws:
CatalogException

addMetadata

public void addMetadata(Product product,
                        Metadata metadata)
                 throws CatalogException
Throws:
CatalogException

updateMetadata

public boolean updateMetadata(Product product,
                              Metadata met)
                       throws CatalogException
Throws:
CatalogException

catalogProduct

public String catalogProduct(Product product)
                      throws CatalogException
Throws:
CatalogException

getMetadata

public Metadata getMetadata(Product product)
                     throws CatalogException
Throws:
CatalogException

getReducedMetadata

public Metadata getReducedMetadata(Product product,
                                   List elements)
                            throws CatalogException
Throws:
CatalogException

removeFile

public boolean removeFile(String filePath)
                   throws DataTransferException
Throws:
DataTransferException

retrieveFile

public byte[] retrieveFile(String filePath,
                           int offset,
                           int numBytes)
                    throws DataTransferException
Throws:
DataTransferException

transferFile

public void transferFile(String filePath,
                         byte[] fileData,
                         int offset,
                         int numBytes)
                  throws DataTransferException
Throws:
DataTransferException

getProductsByProductType

public List<Product> getProductsByProductType(ProductType type)
                                       throws CatalogException
Throws:
CatalogException

getElementsByProductType

public List<Element> getElementsByProductType(ProductType type)
                                       throws ValidationLayerException
Throws:
ValidationLayerException

getElementById

public Element getElementById(String elementId)
                       throws ValidationLayerException
Throws:
ValidationLayerException

getElementByName

public Element getElementByName(String elementName)
                         throws ValidationLayerException
Throws:
ValidationLayerException

getElementByName

public Element getElementByName(String elementName,
                                ProductType type)
                         throws ValidationLayerException
Throws:
ValidationLayerException

complexQuery

public List<QueryResult> complexQuery(ComplexQuery complexQuery)
                               throws CatalogException
Throws:
CatalogException

query

public List<Product> query(Query query,
                           ProductType type)
                    throws CatalogException
Throws:
CatalogException

getProductTypeByName

public ProductType getProductTypeByName(String productTypeName)
                                 throws RepositoryManagerException
Throws:
RepositoryManagerException

getProductTypeById

public ProductType getProductTypeById(String productTypeId)
                               throws RepositoryManagerException
Throws:
RepositoryManagerException

getProductTypes

public List<ProductType> getProductTypes()
                                  throws RepositoryManagerException
Throws:
RepositoryManagerException

getProductReferences

public List<Reference> getProductReferences(Product product)
                                     throws CatalogException
Throws:
CatalogException

getProductById

public Product getProductById(String productId)
                       throws CatalogException
Throws:
CatalogException

getProductByName

public Product getProductByName(String productName)
                         throws CatalogException
Throws:
CatalogException

ingestProduct

public String ingestProduct(Product product,
                            Metadata metadata,
                            boolean clientTransfer)
                     throws Exception
Throws:
Exception

getCatalogValues

public Metadata getCatalogValues(Metadata metadata,
                                 ProductType productType)
                          throws org.apache.xmlrpc.XmlRpcException,
                                 IOException
Throws:
org.apache.xmlrpc.XmlRpcException
IOException

getOrigValues

public Metadata getOrigValues(Metadata metadata,
                              ProductType productType)
                       throws org.apache.xmlrpc.XmlRpcException,
                              IOException
Throws:
org.apache.xmlrpc.XmlRpcException
IOException

getCatalogQuery

public Query getCatalogQuery(Query query,
                             ProductType productType)
                      throws org.apache.xmlrpc.XmlRpcException,
                             IOException
Throws:
org.apache.xmlrpc.XmlRpcException
IOException

main

public static void main(String[] args)

getFileManagerUrl

public URL getFileManagerUrl()
Returns:
Returns the fileManagerUrl.

setFileManagerUrl

public void setFileManagerUrl(URL fileManagerUrl)
Parameters:
fileManagerUrl - The fileManagerUrl to set.

getDataTransfer

public DataTransfer getDataTransfer()
Returns:
Returns the dataTransfer.

setDataTransfer

public void setDataTransfer(DataTransfer dataTransfer)
Parameters:
dataTransfer - The dataTransfer to set.


Copyright © 1999-2013
Apache OODT. All Rights Reserved.