• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Invocation interface.

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question:
1) Is this code requesting a Json object? I'm guessing it is because accept is "application /json"

Invocation generateReport = client.target("http://commerce.com/orders/report")
.queryParam("start", "now - 5 minutes")
.queryParam("end", "now")
.request()
.accept("application/json")
.buildGet();


2)
why is Report.class part of the parameter Is it because in #3 below specifies a responseType? So Report.class is the responseType.

while (true)
{
Report report = generateReport.invoke(Report.class);
renderReport(report);
Thread.sleep(300000);
}



3)
Here's the interface

package javax.ws.rs.client;
public interface Invocation
{
public Response invoke();
public <T> T invoke(Class<T> responseType);
public <T> T invoke(GenericType<T> responseType);
...
}


I'm not too sure about what I'm reading, but I'm guessing the above is the author's message.

Thanks
 
Ranch Hand
Posts: 491
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Yes (implicitly).
2. Yes.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic