Creating an Atom feed implementation class

Your Atom feed implementation class contains code that performs actions in response to Atom HTTP requests.

Procedure

To create an Atom feed implementation class, complete the following steps:

  1. Open your chosen Java™ development tooling environment.
  2. Create a new Java project, with a name of your choice.
  3. Add ServiceRegistryClient.jar to the project build path. ServiceRegistryClient.jar is located in the <WSRR_HOME> directory; this is the directory in which you installed the WSRR files.
  4. Add abdera-0.4.0-incubating.jar to the project build path; abdera-0.4.0-incubating.jar is located in the <WSRR_HOME> directory.
  5. Create a Java class that extends the ServiceRegistryFeedAdapter class.
  6. Override one or more methods, depending on the actions that your Atom feed implementation class performs. The available methods are as follows:
    Method Description
    deleteEntry Delete an entry from a collection.
    deleteMedia Delete a media resource from a collection.
    destroy The destroy method is called when the feed is being taken out of service. This can occur when the WSRR application is being stopped or when the configuration for a feed has been changed. In the case of a configuration change, all the feeds running within the feed container are taken out of service and replaced with new instances that reflect the most recent configuration data.
    extensionRequest Any request that is not covered by the other methods in this table is passed to the extensionRequest method.
    getCategories Return an Atom categories document.
    getEntry Return an entry from a collection.
    getFeed Return an Atom feed document for a collection.
    getMedia Return a media resource.
    getWorkspaces Return the list of workspaces that the feed contributes to the service document.
    headEntry Return metadata for an entry in a collection.
    headMedia Return metadata for a media resource.
    init The init method is called just after the feed has been created and prior to it going into service. The FeedConfig object is passed to the init method; if the feed is to make use of information contained within the FeedConfig object at some point during its lifetime, then it must store a reference to the object.
    optionsEntry Return the options for an entry in a collection.
    optionsMedia Return the options for a media resource.
    postEntry Add a new entry to a collection.
    putEntry Update an existing entry.
    postMedia Add a new media resource to a collection, resulting in the creation of a new media link entry.
    putMedia Update a media resource.
  7. Export your project to a JAR file; the project can contain more than one Atom feed implementation class.
  8. Load your JAR file into WSRR; see Loading an Atom application JAR file.
  9. Amend the WSRR_ENDPOINT_URL_PREFIX environment variable, if necessary. The WSRR_ENDPOINT_URL_PREFIX WebSphere® Application Server environment variable is created by the WSRR deployment process. It is set to "http://hostname:port" or "https://hostname:port", depending on whether WSRR is secure or not. For a cluster it is defined at cluster scope to point to an arbitrary cluster member. If you are using a web server front end or IP Sprayer, you must update the value of WSRR_ENDPOINT_URL_PREFIX accordingly.
  10. Optional: Amend the WSRR_ENDPOINT_URL_ABSOLUTE environment variable, if necessary. The WSRR_ENDPOINT_URL_ABSOLUTE WebSphere Application Server environment variable is created by the WSRR deployment process.
    Note: From WSRR Version 8.0 and above, the URIs returned in the Atom feeds are relative URIs by default instead of using absolute URIs. Set the WSRR_ENDPOINT_URL_ABSOLUTE property to true to return to using absolute URIs.

Example

An example Atom feed implementation class is provided in the Atom feed application sample

Further specific aspects of creating an Atom feed implementation class are described in the following subtopics: