Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

JAX-RS Servlet

Maven POM

The Maven POM inherits from the OODT-core POMincludes the following dependencies in the dependencies section:

The cxf-rt-frontend-jaxrs dependency is the main Apache CXF dependency for JAX-RS:

Code Block
xml
xml
borderStylesolid
<parent>    <dependency>
      <groupId>org.apache.oodt<cxf</groupId>
      <artifactId>oodt-core<<artifactId>cxf-rt-frontend-jaxrs</artifactId>
  <version>0.7-SNAPSHOT</version>
  <relativePath>../../core/pom.xml</relativePath>
</parent>

It includes the following dependencies within the dependencies section of the POM:

The cxf-rt-frontend-jaxrs dependency is the main Apache CXF dependency for JAX-RS:

Code Block
xmlxml
borderStylesolid

    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
           <version>2.6.8</version>
    </dependency>

...

The web.xml file, located in the src/main/webapp/WEB-INF directory, is used to configure all of the servlets in the web application. The JAX-RS package only uses one servlet and it is configured as shown below.

Code Block
title
xml
xml
web.xmlborderStylesolid
<?xml version="1.0" encoding="UTF-8"?>
<web-app ...>
  ...
  <servlet>
    <servlet-name>CasProductJaxrsServlet</servlet-name>
    <servlet-class>
       org.apache.oodt.cas.product.jaxrs.servlets.CasProductJaxrsServlet
    </servlet-class>
    <init-param>
      <param-name>jaxrs.serviceClasses</param-name>
      <param-value>
        org.apache.oodt.cas.product.jaxrs.services.CasProductJaxrsService
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.providers</param-name>
      <param-value>
        org.apache.cxf.jaxrs.provider.json.JSONProvider,
        org.apache.oodt.cas.product.jaxrs.writers.ReferenceFileWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ReferenceZipWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ReferenceRssWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ProductZipWriter,
        org.apache.oodt.cas.product.jaxrs.writers.ProductRssWriter,
        org.apache.oodt.cas.product.jaxrs.writers.DatasetZipWriter,
        org.apache.oodt.cas.product.jaxrs.writers.DatasetRdfWriter,
        org.apache.oodt.cas.product.jaxrs.writers.DatasetRssWriter,
        org.apache.oodt.cas.product.jaxrs.writers.TransfersRssWriter
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.inInterceptors</param-name>
      <param-value>
        org.apache.oodt.cas.product.jaxrs.filters.BackwardsCompatibleInterceptor
      </param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.scope</param-name>
      <param-value>prototype</param-value>
    </init-param>
    <init-param>
      <param-name>jaxrs.extensions</param-name>
      <param-value>
        file=application/octet-stream
        json=application/json
        rdf=application/rdf+xml
        rss=application/rss+xml
        xml=application/xml
        zip=application/zip
      </param-value>
    </init-param>
  </servlet>

  <servlet-mapping>
    <servlet-name>CasProductJaxrsServlet</servlet-name>
    <url-pattern>/jaxrs/*</url-pattern>
  </servlet-mapping>
</web-app>

...

The resource classes are all located in the org.apache.oodt.cas.product.jaxrs.resources package. These are JAXB-annotated representations of file manager entities such as references, products, metadata, file transfers and groups of products (datasets). All of the resource classes have a suffix Resource.

...

  • Redesign the configurations package (the current design is a 'get it working' design and a bit ugly)
  • Use ROME for feed writers, i.e. create classes such as ProductFeedWriter to handle all feeds (including RDF, RSS, Atom) to replace individual writers such as ProductRdfWriter and ProductRssWriterto replace individual writers such as ProductRdfWriter and ProductRssWriter. A stumbling block might be the requirement to configure the outputs, and whether ROME's custom modules need to be hard-coded or can be configurable/dynamic.
  • Introduce configurable XML and JSON outputs.
  • Introduce a ProductTypeResource to represent product types.
  • Leverage the full power of OODT. Currently the JAX-RS service only uses basic calls to an XmlRpcFileManagerClient instance. It doesn't yet take advantage of the OODT Product Server, for example to handle large products.

Further Information

Further information can be found in the OODT trunk Javadocs and by contacting the user and developer mailing lists.