Adding support for parameters.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user