oodt-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ross Laidlaw" <rlaidlaw.o...@gmail.com>
Subject Re: Review Request: OODT-470: Modified RSSProductTransferServlet to allow setup via XML configuration file (similar to RDF and RSS product servlets)
Date Thu, 18 Apr 2013 21:09:20 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated April 18, 2013, 9:09 p.m.)

Review request for oodt and Chris Mattmann.

Summary (updated)

OODT-470: Modified RSSProductTransferServlet to allow setup via XML configuration file (similar
to RDF and RSS product servlets)


This change allows the RSSProductTransferServlet to be configured using an external XML configuration
file, rather than using hard-coded properties within the class.

I added a default configuration file 'rss-transfer-conf.xml' to the webapp/fmprod/src/main/resources
directory.  This contains configurations that were originally in the RSSProductTransferServlet
class, such as the cas namespace and three 'cas' prefixed tags assigned to metadata fields
(BytesTransferred, TotalBytes and PercentComplete).

I then modified the RSSProductTransferServlet class to read the data from this configuration
file.  To allow the servlet to locate the file, I added a parameter named "filemgr.rss-transfer-conf.file"
to the cas-product-tomcat-5.5.9.xml properties file and a constant RSS_TRANSFER_CONF_KEY (set
to the same parameter name "filemgr.rss-transfer-conf.file") to the RSSConfigMetKeys interface.

In the RSSProductTransferServlet class, I removed the hard-coded NS_MAP HashMap for namespaces
and I also removed the calls to XMLUtils.addNode() with hard-coded cas-prefixed tags.  I then
added code to read this information from the configuration file as an RSSConfig object.  Two
for-each loops are used - the first to read namespaces and the second to read tags from the
configuration file.  The three properties - BytesTransferred, TotalBytes and PercentComplete
- are computed for each product and stored as metadata for access by tags.

This addresses bug OODT-470.


  /trunk/webapp/fmprod/src/main/resources/cas-product-tomcat-5.5.9.xml 1468408 
  /trunk/webapp/fmprod/src/main/resources/rss-transfer-conf.xml PRE-CREATION 

Diff: https://reviews.apache.org/r/10611/diff/


To test this change I performed the following steps:

Set up the cas-product webapp:

1) cd webapp/fmprod and then mvn clean install to compile the cas-product webapp
2) cp target/cas-product-xx.war and target/classes/*.xml to /usr/local/oodt/webapp/fmprod
3) add a soft-link (ln -s) from $CATALINA_HOME/localhost/fmprod.xml to /usr/local/oodt/webapp/fmprod/cas-product-tomcat-5.5.9.xml
4) edit /usr/local/oodt/webapp/fmprod/cas-product-tomcat-5.5.9.xml to point to the right locations
for config files, in particular:

  <Parameter name="filemgr.rss-transfer-conf.file" value="/usr/local/oodt/webapp/fmprod/rss-transfer-conf.xml"

Start File Manager, then start Tomcat:

1) cd oodt/filemgr/bin
    ./filemgr start

2) start tomcat

Ingest file(s) with the File Manager Client and access the RSS product transfer servlet while
the files are being ingested:

1) ingest large file(s) using the file manager client.
2) while the files are being ingested, in a separate terminal window run the following:

curl http://localhost:8080/fmprod/viewTransfers

Example output:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<rss xmlns:cas="http://oodt.apache.org/ns/cas" version="2.0">
    <title>File Manager Transfers</title>
    <description>Current Files Being Transferred to the File Manager</description>
    <copyright>Copyright 2010: Apache Software Foundation</copyright>
    <pubDate>Thu, 18 Apr 2013 21:47:11 BST</pubDate>
    <category>data transfer</category>
    <generator>CAS File Manager</generator>
    <lastBuildDate>Thu, 18 Apr 2013 21:47:11 BST</lastBuildDate>
      <pubDate>Thu, 18 Apr 2013 22:46:50 BST</pubDate>
      <pubDate>Thu, 18 Apr 2013 22:46:46 BST</pubDate>

This showed that the namespace information (xmlns:cas="http://oodt.apache.org/ns/cas") and
the three cas-prefixed metadata tags (cas:bytesTransferred, cas:totalBytes and cas:percentComplete)
were successfully read from the configuration file and inserted into the output RSS XML.


Ross Laidlaw

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message