Hi Chris, Thanks for your responses!
Wanted to ask a follow-up on your second point: > http://svn.apache.org/repos/asf/oodt/trunk/product/src/main/java/org/apache/oodt/product/LargeProductQueryHandler.java > > Basically the way it works is that you can't assume that the retrieveChunk > method is only called 1x. It will be called as many times as needed i order > to retrieve the bytes of the product. I think my question is whether there exists some specification allowing for processing of an entire product to occur before bytes of a product are returned. The processing should occur before the product is returned via "retrieveChunk" and only occur once. The only way I can think of enabling this kind of feature to have special code within "retreiveChunk" which 'processes' the product only during the first invocation of 'retrieveChunk', and subsequently returns the processed bytes in any following invocations. Do you have any recommendations on a better technique or does the webgrid infrastructure support for something like this? Thanks so much! Rishi On Dec 9, 2010, at 9:06 PM, Mattmann, Chris A (388J) wrote: > Hi Rishi, > > Thanks for your question! My comments below: > >> I wanted to ask two questions regarding an OFSNGetHandler: >> [1] Is it possible to customize the name and type extension of byte[] file >> data returned by an OFSNGetHandler? If so, where could this be done in the >> scope of OFSNGetHandler methods or related config files? > > Yep. One way to do this would be customize in Tomcat the URL path (and > filter) to the web-grid container serving up the OFSN product handler. Right > now if you look at web-grid, I think it assumes a default filename (that it > sets via the response header in the javax.servlet.HttpServletResponse class I > believe). > > One way to customize this might be to extend Web-Grid's product service here: > > http://svn.apache.org/repos/asf/oodt/trunk/grid/src/main/java/org/apache/oodt/grid/ProductQueryServlet.java > > and override the characterize method, which suggests the filename, and allow > the ability of the underlying handler to help set the name. Then in turn you > could have your handler call this callback. > >> [2] Is it possible to ensure the OFSNGetHandler "retrieveChunk"method is >> only invoked once (ie. the offset is set at zero and the length is the total >> byte size of the file)? The processing my query handler performs is time >> intensive and dependent on reading the entire file at once - not in chunks. >> Therefore, I want to ensure the processing happens only once. > > Check out the LargeProductQueryHandler interface, here: > > http://svn.apache.org/repos/asf/oodt/trunk/product/src/main/java/org/apache/oodt/product/LargeProductQueryHandler.java > > Basically the way it works is that you can't assume that the retrieveChunk > method is only called 1x. It will be called as many times as needed i order > to retrieve the bytes of the product. > > HTH! > > Cheers, > Chris > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Chris Mattmann, Ph.D. > Senior Computer Scientist > NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA > Office: 171-266B, Mailstop: 171-246 > Email: [email protected] > WWW: http://sunset.usc.edu/~mattmann/ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Adjunct Assistant Professor, Computer Science Department > University of Southern California, Los Angeles, CA 90089 USA > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >
