Search in sources :

Example 1 with AtomFeedEntry

use of org.apache.cxf.systests.cdi.base.AtomFeedEntry in project cxf by apache.

the class BookStoreFeed method getBooks.

@GET
@Path("/books/feed")
@NotNull
@Valid
@Produces("application/atom+xml")
public AtomFeed getBooks() {
    final AtomFeed feed = new AtomFeed();
    for (final Book book : service.all()) {
        final AtomFeedEntry entry = new AtomFeedEntry();
        entry.addLink("/bookstore/books/" + book.getId());
        feed.addEntry(entry);
    }
    return feed;
}
Also used : AtomFeed(org.apache.cxf.systests.cdi.base.AtomFeed) Book(org.apache.cxf.systests.cdi.base.Book) AtomFeedEntry(org.apache.cxf.systests.cdi.base.AtomFeedEntry) Path(javax.ws.rs.Path) Valid(javax.validation.Valid) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) NotNull(javax.validation.constraints.NotNull)

Aggregations

Valid (javax.validation.Valid)1 NotNull (javax.validation.constraints.NotNull)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 AtomFeed (org.apache.cxf.systests.cdi.base.AtomFeed)1 AtomFeedEntry (org.apache.cxf.systests.cdi.base.AtomFeedEntry)1 Book (org.apache.cxf.systests.cdi.base.Book)1