org.apache.hadoop.hbase.stargate
Class RESTServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.sun.jersey.spi.container.servlet.ServletContainer
com.sun.jersey.server.impl.container.servlet.ServletAdaptor
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 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 |
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 |
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 |
RESTServlet
public RESTServlet()
throws IOException
- Constructor
- Throws:
IOException
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 userwant
- the number of tokens desired
- Throws:
IOException
Copyright © 2010 The Apache Software Foundation