org.apache.hadoop.hbase.stargate
Class RESTServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.sun.jersey.spi.container.servlet.ServletContainer
              extended by com.sun.jersey.server.impl.container.servlet.ServletAdaptor
                  extended by org.apache.hadoop.hbase.stargate.RESTServlet
All Implemented Interfaces:
Serializable, javax.servlet.Filter, javax.servlet.Servlet, javax.servlet.ServletConfig, Constants, org.apache.zookeeper.Watcher

public class RESTServlet
extends com.sun.jersey.server.impl.container.servlet.ServletAdaptor
implements Constants, org.apache.zookeeper.Watcher

Singleton class encapsulating global REST servlet state and functions.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
com.sun.jersey.spi.container.servlet.ServletContainer.ContextInjectableProvider<T>
 
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event
 
Field Summary
 
Fields inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
APPLICATION_CONFIG_CLASS, JSP_TEMPLATES_BASE_PATH, PROPERTY_WEB_PAGE_CONTENT_REGEX, RESOURCE_CONFIG_CLASS
 
Fields inherited from interface org.apache.hadoop.hbase.stargate.Constants
AUTHENTICATOR_KEY, DEFAULT_MAX_AGE, INSTANCE_ZNODE_ROOT, MIMETYPE_BINARY, MIMETYPE_HTML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_TEXT, MIMETYPE_XML, MULTIUSER_KEY, STATUS_REPORT_PERIOD_KEY, USERS_TABLE, USERS_ZNODE_ROOT, VERSION_STRING
 
Constructor Summary
RESTServlet()
          Constructor
 
Method Summary
 Authenticator getAuthenticator()
           
static RESTServlet getInstance()
           
 int getMaxAge(String tableName)
           
 void invalidateMaxAge(String tableName)
          Signal that a previously calculated maximum cache age has been invalidated by a schema change.
 boolean isMultiUser()
           
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void setAuthenticator(Authenticator authenticator)
           
 void setMultiUser(boolean multiuser)
           
 boolean userRequestLimit(User user, int want)
          Check if the user has exceeded their request token limit within the current interval
 
Methods inherited from class com.sun.jersey.server.impl.container.servlet.ServletAdaptor
configure
 
Methods inherited from class com.sun.jersey.spi.container.servlet.ServletContainer
configure, configure, create, destroy, doFilter, doFilter, getDefaultResourceConfig, getDefaultResourceConfig, getServletContext, getStaticContentPattern, getWebConfig, init, init, init, initiate, load, reload, service, service
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RESTServlet

public RESTServlet()
            throws IOException
Constructor

Throws:
IOException
Method Detail

getInstance

public static RESTServlet getInstance()
                               throws IOException
Returns:
the RESTServlet singleton instance
Throws:
IOException

process

public void process(org.apache.zookeeper.WatchedEvent event)
Specified by:
process in interface org.apache.zookeeper.Watcher

getMaxAge

public int getMaxAge(String tableName)
              throws IOException
Parameters:
tableName - the table name
Returns:
the maximum cache age suitable for use with this table, in seconds
Throws:
IOException

invalidateMaxAge

public void invalidateMaxAge(String tableName)
Signal that a previously calculated maximum cache age has been invalidated by a schema change.

Parameters:
tableName - the table name

isMultiUser

public boolean isMultiUser()
Returns:
true if the servlet should operate in multiuser mode

setMultiUser

public void setMultiUser(boolean multiuser)
Parameters:
multiuser - true if the servlet should operate in multiuser mode

getAuthenticator

public Authenticator getAuthenticator()
Returns:
an authenticator

setAuthenticator

public void setAuthenticator(Authenticator authenticator)
Parameters:
authenticator -

userRequestLimit

public boolean userRequestLimit(User user,
                                int want)
                         throws IOException
Check if the user has exceeded their request token limit within the current interval

Parameters:
user - the user
want - the number of tokens desired
Throws:
IOException


Copyright © 2010 The Apache Software Foundation