本文整理汇总了Java中org.jboss.resteasy.plugins.providers.atom.Feed类的典型用法代码示例。如果您正苦于以下问题:Java Feed类的具体用法?Java Feed怎么用?Java Feed使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Feed类属于org.jboss.resteasy.plugins.providers.atom包,在下文中一共展示了Feed类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@GET
@Produces("application/atom+xml")
public Feed getFeed() throws URISyntaxException {
Feed feed = new Feed();
feed.setId(new URI("http://test.com/1"));
feed.setTitle("WildFly Camel Test Feed");
feed.setUpdated(new Date());
Link link = new Link();
link.setHref(new URI("http://localhost"));
link.setRel("edit");
feed.getLinks().add(link);
feed.getAuthors().add(new Person("WildFly Camel"));
Entry entry = new Entry();
entry.setTitle("Hello Kermit");
Content content = new Content();
content.setType(MediaType.TEXT_HTML_TYPE);
content.setText("Greeting Kermit");
entry.setContent(content);
feed.getEntries().add(entry);
return feed;
}
示例2: queryFullArtifacts
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@Override
public List<BaseArtifactType> queryFullArtifacts(String query) throws Exception {
String path = "/s-ramp?query=" + query;
List<BaseArtifactType> artifacts = new ArrayList<BaseArtifactType>();
Feed feed = getFeed(path, 200);
for (Entry entry : feed.getEntries()) {
for (Link link : entry.getLinks()) {
// TODO: Safe assumption for all impls?
if ("self".equals(link.getRel())) {
artifacts.add(SrampAtomUtils.unwrapSrampArtifact(getArtifact(link.getHref().toString(), 200)));
}
}
}
return artifacts;
}
示例3: storedQuery
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@Override
public List<BaseArtifactType> storedQuery(String queryName, String pagingParams, int expectedResponse) throws Exception {
String path = "/s-ramp/query/" + queryName + "/results?" + pagingParams;
List<BaseArtifactType> artifacts = new ArrayList<BaseArtifactType>();
Feed feed = getFeed(path, expectedResponse);
if (feed != null) {
for (Entry entry : feed.getEntries()) {
artifacts.add(SrampAtomUtils.unwrapSrampArtifact(entry));
}
}
return artifacts;
}
示例4: getFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
private Feed getFeed(String endpoint, int expectedResponse) {
Builder clientRequest = getClientRequest(BASE_URL + endpoint);
Response response = clientRequest.get();
boolean continueProcessing = verifyResponse(response, expectedResponse);
if (continueProcessing) {
Feed feed = response.readEntity(Feed.class);
verifyFeed(feed);
return feed;
} else {
return null;
}
}
示例5: verifyFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
private void verifyFeed(Feed feed) {
for (Object key : feed.getExtensionAttributes().keySet()) {
QName qname = (QName) key;
// Foundation 1.9
assertEquals(NAMESPACE, qname.getNamespaceURI());
}
for (Entry entry : feed.getEntries()) {
verifyEntry(entry);
}
}
示例6: getFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
public Feed getFeed(Integer page) {
try {
Feed feed = new Feed();
feed.setId(getFeedId());
feed.setTitle(getFeedTitle());
feed.getLinks().addAll(generateLinks(page));
feed.getAuthors().addAll(getAuthors());
feed.getEntries().addAll(generateEntries(page));
feed.setUpdated(feed.getEntries().isEmpty() ? new Date() : feed.getEntries().get(0).getUpdated());
return feed;
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
}
示例7: getFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@GET
@Path("/feed")
@Produces("application/atom+xml")
public Feed getFeed() throws URISyntaxException
{
Feed feed = new Feed();
feed.setId(new URI("http://example.com/42"));
feed.setTitle("Veterinarians");
feed.setUpdated(new Date());
Link link = new Link();
link.setHref(new URI("http://localhost"));
link.setRel("edit");
feed.getLinks().add(link);
feed.getAuthors().add(new Person("Thomas Woehlke"));
for(Vet vet:vetDao.getAll()){
Entry entry = new Entry();
entry.setTitle("Vet: "+vet.getFirstName()+" "+vet.getLastName());
Content content = new Content();
content.setType(MediaType.TEXT_HTML_TYPE);
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("[");
Iterator<Specialty> i = vet.getSpecialties().iterator();
while(i.hasNext() ){
stringBuilder.append(i.next().getName());
if(i.hasNext()){
stringBuilder.append(", ");
}
}
stringBuilder.append("]");
content.setText(stringBuilder.toString());
entry.setContent(content);
feed.getEntries().add(entry);
}
return feed;
}
示例8: feedBasicAsserts
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
private void feedBasicAsserts(FeedRestService tested, UriInfo uriInfo, MultivaluedMap<String, String> qp,
QuerySettings qs, Object response) {
Mockito.verify(uriInfo, Mockito.times(2)).getQueryParameters();
Mockito.verify(tested.querySettingsParser).parseUriParams(qp);
Mockito.verify(tested.searchService).performSearch(Mockito.eq(qs), Mockito.notNull(String.class),
Mockito.eq(StatsRecordType.FEED));
Assert.assertTrue("Bad class instead of Feed: " + response.getClass().getName(), response instanceof Feed);
}
示例9: getFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@Override
@Timed
public Feed getFeed() {
return super.getFeed();
}
示例10: getFeed
import org.jboss.resteasy.plugins.providers.atom.Feed; //导入依赖的package包/类
@GET
@Path("/notifications")
@Produces("application/atom+xml")
public Feed getFeed();