You use the feed element in the Atom plug-in framework configuration file to define a single feed within a feed application.
The feed element is required; you can define as many feed elements as you want.
| Element | Description |
|---|---|
| description | A description of the feed; this element is optional. |
| display-name | A display name for the feed; this element is optional. |
| feed-name | The name of the feed; this name must be unique within the feed application. This element is required. |
| feed-class | The implementation class for the feed. This class must be loaded into WSRR in a plug-in JAR file; see Loading an Atom application JAR file for more information. This element is required. |
| init-param | An initialization parameter that is passed to
the implementation class. The parameter is stored in the FeedConfig object,
which is made available to the implementation class; for details of
accessing an initialization parameter in the feed implementation class,
see Accessing initialization parameters.
This element is optional; you can define as many init-param elements
as you want. The init-param element contains the following child
elements:
|
| feed-mapping | You use the feed-mapping element to define mapping
rules, in the form of regular expressions, that are used to match
an incoming HTTP request to this feed, and to call the appropriate
method. This element is optional; you can define as many feed-mapping
elements as you want. The atom plug-in framework attempts to match an incoming HTTP request to the mapping rules strictly in the order that you define them in the configuration file. As soon as a match is found, the request is routed to the feed in which that feed-mapping element is defined, and the corresponding feed-mapping settings determine how the request is processed. This can help to simplify the regular expressions that you define, because it means that you can safely use more general expressions, that might match several different URIs, provided that you define them after more specific expressions. The feed-mapping element contains
the following child elements:
|
This example defines an Atom feed called "EndpointsFeed" whose implementation class is com.ibm.serviceregistry.feeds.ExampleFeed.
An initialization parameter, called "debug", is passed to the implementation class, with a value of "false".
If the context root for the application in which this feed is defined is "/WSRR/service", an HTTP request URL of the form "http://hostname:port/ServiceRegistryFeeds//WSRR/service/endpoints" is routed to this feed, and an Atom feed document is returned.
If the context root for the application in which this feed is defined is "/WSRR/service", an HTTP request URL of the form "http://hostname:port/ServiceRegistryFeeds//WSRR/service/endpoints/AccountCreation/online" is routed to this feed. "AccountCreation" is stored in a field called "endpoint_name", and "online" is stored in a field called "endpoint_status". An Atom entry document is returned.
<feed>
<description>A feed that returns online service endpoints</description>
<display-name>Service endpoints feed</display-name>
<feed-name>EndpointsFeed</feed-name>
<feed-class>com.ibm.serviceregistry.feeds.ExampleFeed</feed-class>
<init-param>
<description>Debug flag</description>
<param-name>debug</param-name>
<param-value>false</param-value>
</init-param>
<feed-mapping>
<regex-pattern
target-type="COLLECTION">
/endpoints
</regex-pattern>
</feed-mapping>
<feed-mapping>
<regex-pattern
target-type="ENTRY">
/endpoints/(\w+)/(\w+)
</regex-pattern>
<regex-field>endpoint_name</regex-field>
<regex-field>endpoint_status</regex-field>
</feed-mapping>
</feed>