use of nl.uva.cs.lobcder.rest.wrappers.Stats in project lobcder by skoulouzis.
the class StatsService method setStats.
@Path("set")
@PUT
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public void setStats(JAXBElement<Stats> jbStats) {
MyPrincipal mp = (MyPrincipal) request.getAttribute("myprincipal");
if (mp.getRoles().contains("worker") || mp.isAdmin()) {
try {
Stats stats = jbStats.getValue();
getCatalogue().setSpeed(stats);
} catch (SQLException ex) {
Logger.getLogger(StatsService.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
Aggregations