Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Invocation interface.

 
ganon bie
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
 
H Paul
Ranch Hand
Posts: 471
4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. Yes (implicitly).
2. Yes.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!