info.sswap.api.servlet
Class CacheHandler

java.lang.Object
  extended by info.sswap.api.servlet.CacheHandler

public class CacheHandler
extends java.lang.Object

Handler for HTTP requests for the cache (e.g., polling for RRGs). The cache-related requests are forwarded to this class by AbstractSSWAPServlet

Author:
Blazej Bulka

Field Summary
static java.lang.String EXECUTION_STATUS_HEADER
           
private static CacheHandler instance
          A singleton instance of this class
static java.lang.String POLLING_INTERVAL_HEADER
          The name of the HTTP field in the response to the polling request that should contain the suggested polling interval (in milliseconds)
static java.lang.String TOKEN_PARAM
          The name of the parameter in the query string that should contain the token
 
Constructor Summary
CacheHandler()
           
 
Method Summary
static CacheHandler get()
          Accessor to the singleton instance
 void handleGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Handles an HTTP GET request for the cache
private  void sendError(javax.servlet.http.HttpServletResponse response, int status, java.lang.String errMsg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOKEN_PARAM

public static final java.lang.String TOKEN_PARAM
The name of the parameter in the query string that should contain the token

See Also:
Constant Field Values

POLLING_INTERVAL_HEADER

public static final java.lang.String POLLING_INTERVAL_HEADER
The name of the HTTP field in the response to the polling request that should contain the suggested polling interval (in milliseconds)

See Also:
Constant Field Values

EXECUTION_STATUS_HEADER

public static final java.lang.String EXECUTION_STATUS_HEADER
See Also:
Constant Field Values

instance

private static final CacheHandler instance
A singleton instance of this class

Constructor Detail

CacheHandler

public CacheHandler()
Method Detail

get

public static final CacheHandler get()
Accessor to the singleton instance

Returns:
the singleton instance

handleGet

public final void handleGet(javax.servlet.http.HttpServletRequest request,
                            javax.servlet.http.HttpServletResponse response)
                     throws javax.servlet.ServletException
Handles an HTTP GET request for the cache

Parameters:
request - the request
response - the response
Throws:
javax.servlet.ServletException

sendError

private void sendError(javax.servlet.http.HttpServletResponse response,
                       int status,
                       java.lang.String errMsg)
                throws java.io.IOException
Throws:
java.io.IOException


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.