-
-
Save sunnygleason/570703 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Inject a {@link Broadcaster} based on @Path | |
*/ | |
private @PathParam("tablename") Broadcaster tablename; | |
@GET | |
@Path("{tablename}") | |
@Suspend(resumeOnBroadcast=true, period=30, listeners={EventsLogger.class}) | |
public String getData(@PathParam("tablename") String tableName, | |
@Context UriInfo uri) throws Exception { | |
return mapper.writeValueAsString(manager.loadData(tableName, | |
convertUriToMap(uri.getPath()))); | |
} | |
@PUT | |
@Path("{tablename}") | |
@Broadcast | |
public Broadcastale insertData(@PathParam("tablename") String tableName, | |
@Context UriInfo uri) throws Exception { | |
manager.insertData(tableName, convertUriToMap(uri.getPath())); | |
return new Broadcastable(/*thechange*/,tablename); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment