Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Created July 12, 2015 20:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abhirockzz/b49f678d543bdf7d08b3 to your computer and use it in GitHub Desktop.
Save abhirockzz/b49f678d543bdf7d08b3 to your computer and use it in GitHub Desktop.
@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public Response getAllTimers() {
List<String> ejbTimers = auditScheduler.getAllTimers();
List<ScheduledTimerInfo> timers = ejbTimers.stream().map((id) -> auditScheduler.getTimerInfo(id)).collect(Collectors.toList());
GenericEntity<List<ScheduledTimerInfo>> entities = new GenericEntity<List<ScheduledTimerInfo>>(timers) {};
return Response.ok(entities).build();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment