java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
net.i2p.imagegen.RandomArtServlet
- All Implemented Interfaces:
Serializable, Servlet, ServletConfig
This servlet generates random art (visual identifier) images.
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longHow long a generated identicon may be cached - 24 hours.private longHow long a rendered identicon stays in the cache.private static final StringRequest parameter naming the identicon code.private static final StringRequest parameter naming the identicon mode.private static final longPinned for serialized-form compatibility.private intBumped when the rendered output format changes.Constructor Summary
ConstructorsConstructorDescriptionA fresh servlet on format version 1 with the default 24 hour identicon expiry; init() may raise the version when a newer format is requested.Method Summary
All MethodsModifier and TypeMethodDescriptionprotected voiddoGet(HttpServletRequest request, HttpServletResponse response) Handle GET request: generate random art from destination hash.Methods inherited from class HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, serviceMethods inherited from class GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
Field Details
serialVersionUID
private static final long serialVersionUIDPinned for serialized-form compatibility.- See Also:
PARAM_IDENTICON_CODE_SHORT
Request parameter naming the identicon code.- See Also:
PARAM_IDENTICON_MODE_SHORT
Request parameter naming the identicon mode.- See Also:
DEFAULT_IDENTICON_EXPIRES_IN_MILLIS
private static final long DEFAULT_IDENTICON_EXPIRES_IN_MILLISHow long a generated identicon may be cached - 24 hours.- See Also:
version
private int versionBumped when the rendered output format changes.identiconExpiresInMillis
private long identiconExpiresInMillisHow long a rendered identicon stays in the cache.
Constructor Details
RandomArtServlet
public RandomArtServlet()A fresh servlet on format version 1 with the default 24 hour identicon expiry; init() may raise the version when a newer format is requested.
Method Details
doGet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException Handle GET request: generate random art from destination hash.- Overrides:
doGetin classHttpServlet- Throws:
ServletExceptionIOException