Adding support for parameters.

This commit is contained in:
marcins78
2013-01-08 14:11:34 +00:00
parent 6242eadcb8
commit f6d3844441
2 changed files with 18 additions and 2 deletions

View File

@@ -16,8 +16,8 @@ import javax.ws.rs.core.Response;
public abstract class AbstractResource {
protected final boolean _test = System.getProperty("test") != null;
protected final long _longPollingLength = 5000;
protected final long _longPollingInterval = 200;
protected static long _longPollingLength = 5000;
protected static long _longPollingInterval = 200;
@Context
protected PlayerDAO _playerDao;

View File

@@ -56,6 +56,22 @@ public class AdminResource extends AbstractResource {
@Context
private CacheManager _cacheManager;
@Path("/parameter")
@GET
public String setParameter(
@QueryParam("pollLength") Long pollLength,
@QueryParam("pollInterval") Long pollInterval,
@Context HttpServletRequest request) throws Exception {
validateAdmin(request);
if (pollLength != null)
_longPollingLength= pollLength;
if (pollInterval != null)
_longPollingInterval = pollInterval;
return "OK";
}
@Path("/clearCache")
@GET
public String clearCache(@Context HttpServletRequest request) throws Exception {