You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oodt.apache.org by Ross Laidlaw <rl...@gmail.com> on 2012/07/26 15:08:10 UTC

OODT-470: RSSProductTransferServlet to use XML configuration file

Dear OODT-ers,

I'm trying to put together a patch for the RSSProductTransferServlet
class [1] for File Manager.  At the moment the class has some
hard-coded information and the idea is to make this configurable via
one of the XML configuration files (an example config file is: [2]).

In RSSProductTransferServlet, the 'cas' namespace is hard-coded:

    private static final Map NS_MAP = new HashMap();
    static { NS_MAP.put("cas", "http://oodt.jpl.nasa.gov/1.0/cas"); }

And the following fields within the 'cas' namespace are hard-coded:

    XMLUtils.addNode(doc, item, "cas:source", "file manager transfers");
    XMLUtils.addNode(doc, item, "cas:bytesTransferred", "" +
status.getBytesTransferred());
    XMLUtils.addNode(doc, item, "cas:totalBytes", "" +
status.getFileRef().getFileSize());
    XMLUtils.addNode(doc, item, "cas:percentComplete", "" +
status.computePctTransferred());


If we put the 'cas' namespace definition in the config file, would it
also make sense to move the above field definitions to the config file
as well?  If so, should we have a separate config file just for
transfers?  I was thinking that some of the above fields won't really
apply to the other servlet (RSSProductServlet) as they're related
specifically to transfers (bytes transferred so far, percent complete,
etc), so RSSProductServlet and RSSProductTransferServlet could have
separate configs.


Many thanks in advance for your advice,

Ross

[1]  http://svn.apache.org/repos/asf/oodt/trunk/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java
[2]  http://svn.apache.org/repos/asf/oodt/trunk/webapp/fmprod/src/main/resources/rssconf.xml

Re: OODT-470: RSSProductTransferServlet to use XML configuration file

Posted by Ross Laidlaw <rl...@gmail.com>.
Thanks Chris!

I'll put a patch together and post it to OODT-470 on JIRA for review.

Ross



On 28 July 2012 06:07, Mattmann, Chris A (388J)
<ch...@jpl.nasa.gov> wrote:
> Hey Ross,
>
> On Jul 26, 2012, at 6:08 AM, Ross Laidlaw wrote:
>
>> Dear OODT-ers,
>>
>> I'm trying to put together a patch for the RSSProductTransferServlet
>> class [1] for File Manager.  At the moment the class has some
>> hard-coded information and the idea is to make this configurable via
>> one of the XML configuration files (an example config file is: [2]).
>>
>> In RSSProductTransferServlet, the 'cas' namespace is hard-coded:
>>
>>    private static final Map NS_MAP = new HashMap();
>>    static { NS_MAP.put("cas", "http://oodt.jpl.nasa.gov/1.0/cas"); }
>
> Yep we should definitely make this configurable.
>
>>
>> And the following fields within the 'cas' namespace are hard-coded:
>>
>>    XMLUtils.addNode(doc, item, "cas:source", "file manager transfers");
>>    XMLUtils.addNode(doc, item, "cas:bytesTransferred", "" +
>> status.getBytesTransferred());
>>    XMLUtils.addNode(doc, item, "cas:totalBytes", "" +
>> status.getFileRef().getFileSize());
>>    XMLUtils.addNode(doc, item, "cas:percentComplete", "" +
>> status.computePctTransferred());
>>
>>
>> If we put the 'cas' namespace definition in the config file, would it
>> also make sense to move the above field definitions to the config file
>> as well?  If so, should we have a separate config file just for
>> transfers?
>
> Yep it would be nice to have them generated by the existing available
> Product met if they are there and then defined in the conf file.
>
>>  I was thinking that some of the above fields won't really
>> apply to the other servlet (RSSProductServlet) as they're related
>> specifically to transfers (bytes transferred so far, percent complete,
>> etc), so RSSProductServlet and RSSProductTransferServlet could have
>> separate configs.
>
> Yep we should probably make the config for RSSProductTransferServlet
> specific to it. +1 to that!
>
>>
>>
>> Many thanks in advance for your advice,
>
> Thanks Ross!
>
> Cheers,
> Chris
>
>>
>> Ross
>>
>> [1]  http://svn.apache.org/repos/asf/oodt/trunk/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java
>> [2]  http://svn.apache.org/repos/asf/oodt/trunk/webapp/fmprod/src/main/resources/rssconf.xml
>
>
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Chris Mattmann, Ph.D.
> Senior Computer Scientist
> NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
> Office: 171-266B, Mailstop: 171-246
> Email: chris.a.mattmann@nasa.gov
> WWW:   http://sunset.usc.edu/~mattmann/
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Adjunct Assistant Professor, Computer Science Department
> University of Southern California, Los Angeles, CA 90089 USA
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>

Re: OODT-470: RSSProductTransferServlet to use XML configuration file

Posted by "Mattmann, Chris A (388J)" <ch...@jpl.nasa.gov>.
Hey Ross,

On Jul 26, 2012, at 6:08 AM, Ross Laidlaw wrote:

> Dear OODT-ers,
> 
> I'm trying to put together a patch for the RSSProductTransferServlet
> class [1] for File Manager.  At the moment the class has some
> hard-coded information and the idea is to make this configurable via
> one of the XML configuration files (an example config file is: [2]).
> 
> In RSSProductTransferServlet, the 'cas' namespace is hard-coded:
> 
>    private static final Map NS_MAP = new HashMap();
>    static { NS_MAP.put("cas", "http://oodt.jpl.nasa.gov/1.0/cas"); }

Yep we should definitely make this configurable.

> 
> And the following fields within the 'cas' namespace are hard-coded:
> 
>    XMLUtils.addNode(doc, item, "cas:source", "file manager transfers");
>    XMLUtils.addNode(doc, item, "cas:bytesTransferred", "" +
> status.getBytesTransferred());
>    XMLUtils.addNode(doc, item, "cas:totalBytes", "" +
> status.getFileRef().getFileSize());
>    XMLUtils.addNode(doc, item, "cas:percentComplete", "" +
> status.computePctTransferred());
> 
> 
> If we put the 'cas' namespace definition in the config file, would it
> also make sense to move the above field definitions to the config file
> as well?  If so, should we have a separate config file just for
> transfers?

Yep it would be nice to have them generated by the existing available
Product met if they are there and then defined in the conf file.

>  I was thinking that some of the above fields won't really
> apply to the other servlet (RSSProductServlet) as they're related
> specifically to transfers (bytes transferred so far, percent complete,
> etc), so RSSProductServlet and RSSProductTransferServlet could have
> separate configs.

Yep we should probably make the config for RSSProductTransferServlet
specific to it. +1 to that!

> 
> 
> Many thanks in advance for your advice,

Thanks Ross!

Cheers,
Chris

> 
> Ross
> 
> [1]  http://svn.apache.org/repos/asf/oodt/trunk/webapp/fmprod/src/main/java/org/apache/oodt/cas/product/rss/RSSProductTransferServlet.java
> [2]  http://svn.apache.org/repos/asf/oodt/trunk/webapp/fmprod/src/main/resources/rssconf.xml


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattmann@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++